EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C++代做
您的位置: 主页 > 编程案例 > C++代做 >
代做C++/C:北美cs代写 COMP 204 – Assignment #3 - C++代做
发布时间:2021-07-25 22:56:39浏览次数:
Question 1 (10 Points)Complete the symptom_similarity() function, which measures the similarity between the symptoms of two patients. See below for an explanation of how the similarity is computed, and see my_test() function for examples.def symptom_similarity(my_symptoms, other_symptoms): """Args:my_symptoms: tuple of a set of symptoms present and a set of symptoms absent other_symptoms: tuple of a set of symptoms present and set symptoms absentReturns:common_present + common_absent common_present_absent common_absent_present where common_present is the number of symptoms present in both patients common_absent is the number of symptoms absent in both patients common_present_absent is the number of symptoms present in my_patient and absent in other_patientcommon_absent_present is the number of symptoms absent in my_patient and present in other_patient Question 2 (10 Points)Complete the similarity_to_patients() function, which measure the similarity between a symptom tuple and the entire set of patients in our database. See below for an explanation of exactly what is expected, and see my_test() function for examples.def similarity_to_patients(my_symptoms, all_patients): Args:my_symptoms: tuple of symptoms present and absentall_patients: dictionary of patients IDs (key) and associated tuple of present and absent symptomsReturns:List of tuples of the form: (patientID, similarity), sorted by the similarity between my_symptoms and the symptoms of each patient in all_patients. Question 3 (15 Points)Write the most_similar_patients() function, which identifies the patients that have symptoms that are the most similar to those of a new patient. See below for an explanation of exactly what is expected, and see my_test() function for examples.def most_similar_patients(my_symptoms, all_patients, n_top): Args:my_symptoms: tuple of a set of symptoms present and absent all_patients: dictionary of patients IDs (key) and associated tuple ofpresent and absent symptoms n_top: Maximum number of patients to returnReturns:The set of up to n_top patient IDs from all_patients with the highest similarity to my_symptoms  Question 4 (15 Points)Write the count_diagnostics() function, which counts, among a set of patients, what fraction exhibit each possible diagnostic. See below for an explanation of exactly what is expected, and see my_test() function for examples.def count_diagnostics(patient_set, diagnostic_by_patient): """Args:patient_set: A set of patient IDsdiagnostic_by_patient: A dictionary with key = patient_ID and values = diseases Returns:A dictionary with keys = diagnostic andvalues = fraction of patients in patient_set with that diagnostic Question 5 (10 Points)Write the diagnostics_from_symptoms () function, which assesses the probability of different diagnostics based on a patient’s symptoms. It does so by using the most_similar_patients() and count_diagnostics() functions. See below for an explanation of exactly what is expected, and see my_test() function for examples.def diagnostics_from_symptoms(my_symptoms, all_patients_symptoms,all_patients_diagnostics, n_top):"""Args:my_symptoms: tuple of symptoms present and absentall_patients_symptoms: dictionary of patients IDs (key) and associated symptoms all_patients_diagnostics: dictionary of patients IDs (key) and associateddiagnosticn_top: Number of most similar patients to consider.Returns:A dictionary with keys = diagnostic and values = fraction of the n_top most similar patients with that diagnostic Question 6 (15 Points)Write the pretty_print_diagnostics() function, which prints in a nicely formatted manner the frequency of diagnostics of the patients contained in the set it receives as argument. See below for an explanation of exactly what is expected, and see my_test() function for examples.def pretty_print_diagnostics(diagnostic_freq): """Args:diagnostic_freq: A dictionary with key = diagnostic and value = frequency Returns:Nothing Prints:A table of possible diagnostics, sorted by frequency, expressed as percentages. Only diagnostics with non-zero percentages should be printed.If a diagnostic is longer than 10 characters, it should be truncated to 10 Characters.Frequencies should be expressed as percentages, rounded to the nearest percent.  Question 7 (25 Points)When the diagnostic for a patient is unclear based on the symptoms that are present/absent, a doctor may want to ask for additional information about the symptoms of the patient. For example, for a patient who has a headache but no stomach ache, the doctor may want to enquire whether the patient has a stiff neck, which would suggest he/she may have meningitis. But which symptom should the doctor ask about? They should be asking about the symptom for which the answer would be the most informative with respect to the diagnostic. Suppose that we define the clarity of a list of diagnostic frequencies as the probability of the most likely diagnostic. For example, the clarity of the diagnostic { “meningitis”:0.8, “cold”:0.1, “flu”:0.1 } is 0.8. Suppose a patient has a certain set P of symptoms known to be present and a certain set A of symptoms known to be absent. Then, the value of asking the question “Do you have symptom X?” is defined asValue( X ) = max( clarity ( diagnostic ( P ∪ { X }, A ),clarity ( diagnostic ( P , A ∪ { X } ),Write the recommend_symptom_to_test() function, that recommends the maximum value symptom to enquire about. See below for an explanation of exactly what is expected, and see my_test() function for examples.def recommend_symptom_to_test(my_symptoms, all_patients_symptoms,all_patients_diagnostics, n_top):"""Args:my_symptoms: tuple of symptoms present and absentall_patients_symptoms: dictionary of patients IDs (key) and associated symptoms all_patients_diagnostics: dictionary of patients IDs (key) and associateddiagnosticn_top: Number of most similar patients to consider.Returns:A string describing the best symptom to enquire about in order to clarify the diagnostic.Explanation:The best symptom to test for is one that:has been tested at least once among the patients inall_patients_symptomsis not already in the new_patient_symptoms,andyields the maximum value (see text of question for definition ofvalue). Just for fun ( Nothing to submit for this).The approach you have implemented works best when the number of patients in the database is large. We have created a database of 1000 (fake) patients, with their symptoms and diagnostics. This is contained in the file medicalData.txt . We also provide you with the function read_data_from_file(), which will read the data contained in the file and build the symptoms and diagnostics dictionaries.def read_data_from_file(filename): """args:filename: Name of file containing medical data Returns:Tuple of a dictionary of symptoms and a dictionary of diagnostics See our my_test() function to see the results of the different functions on this larger patient database. Compare those results to yours to ensure your functions work properly.

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。