Python代写 | COMP 2019 Assignment 2 – Machine Learning

本次Python代写是运用机器学习完成评估指标、基准线等问题

COMP 2019 Assignment 2 – Machine Learning
Task 1: Report
Write a concise report showing your analysis for Questions 1-5 described below.
Demonstrate that you have followed appropriate training and evaluation procedures and justify your
conclusions with relevant evidence from the evaluation output.
As part of the assignment you will need to decide and justify which training and evaluation procedures are
appropriate for this data set and the given questions.
Where there are alternatives (e.g. measures, procedures, models, conclusions), demonstrate that you have
considered all relevant alternatives and justify why the selected alternative is appropriate.
Ensure that the report is professionally presented and self-contained.
Do not include the python code in your report; instead, select relevant output from your program for use in
justifications and discussion. Do not copy and paste the entire output into the report. The Jupyter notebook
containing your code and complete output will be submitted as a separate deliverable.
Question 1: Evaluation Metric
Choose an appropriate measure to evaluate the classifier.
Select among Accuracy, F1-measure, Precision, Recall, or ROC curve.
Justify your selection.
Note that you will need to use the same measure for all tasks in this Assignment.
Question 2: Baseline
Construct a classifier that always predicts the majority class (as seen in the training data) for each sample.
What performance can we expect from this simple model when applied to new data?
Use a confusion matrix and/or classification report to support your analysis.
Question 3: Nearest Neighbour
Train a k Nearest Neighbour classifier (KNeighborsClassifier) to predict Target.
Use the Euclidean distance, 5 neighbours, and uniform weighting for the classifier. This should be the default
offered by sklearn for this classifier.
Ensure that you follow correct training and evaluation procedures.
1. Assess how well the classifier performs on the prediction task.
2. What performance can we expect from the trained model if we applied it to new data?
Question 4: Decision Tree
Train a DecisionTreeClassifier to predict Target. Use the default parameter values for the classifier (that is,
don’t specify your own values).
Ensure that you follow correct training and evaluation procedures.
1. Assess how well the classifier performs on the prediction task.
2. What performance can we expect from the trained model if we applied it to new data?
If you wish to visualise the decision tree you can use function print_dt provided in dtutils.py in the
Assignment 2 zip archive:
import dtutils
dtutils.print_dt(tree, feature_names=flabels)
where tree refers to the trained decision tree model, and flabels is a list of features names (columns) in the
data. This function prints a hierarchical representation of the tree where nodes deeper in the tree are
indented further. For internal nodes, the children are shown. For leaf nodes, the class label associated with
the node is shown, as well as the frequency of each class among the samples associated with the node (in
square brackets).
Question 5: Diagnosis
Does the Decision Tree model suffer from overfitting or underfitting? Justify what problem exists, if any, and
describe how you have arrived at your assessment.
If the model exhibits overfitting or underfitting, revise your training procedure to remedy the problem, and
re-evaluate the improved model. The DecisionTreeClassifier has a number of parameters that you can
consider for tuning the model:
• max_depth: maximum depth of the tree
• min_samples_split: minimum number of samples required to split an internal node in the tree
• max_leaf_nodes: maximum number of leaf nodes in the tree
• min_samples_leaf: minimum number of samples per leaf nodes
Question 6: Recommendation
Which of the models you trained should be selected for the prediction task?
Ensure that you use the appropriate results for making a decision.
Justify your recommendation.
Submission Instructions
Submit a single zip archive containing the following:
• emg.ipynb: the Jupyter Notebook file (in ipynb format).
• emg.html: the HTML version of emg.ipynb showing the notebook including all output. Create this by
selecting File>Download as>HTML after having run all cells in the Jupyter notebook.
• emg.pdf: the report as specified in Task 1 (i.e. your answers to questions 1-6) in PDF format
Restart your python kernel and run all cells from the top to ensure your code runs without errors prior to
saving the notebook and its HTML version.
Please check that all files are in the appropriate format before submitting.
Marking Scheme
Question Marks
Q1: Metrics
Appropriate measure selected and justified
10
Q2: Baseline
Appropriate measure selected and justified
10
Q3: k Nearest Neighbour
Correct training procedure applied
Correct evaluation procedure applied
Correct conclusion & analysis
15
Q4: Decision Tree
Correct training procedure applied
Correct evaluation procedure applied
Correct conclusion & analysis
15
Q5: Diagnosis
Correct diagnosis
Correct revised training and evaluation procedure applied
25
Q6: Recommendation
Correct recommendations
Recommendations justified by evaluation results


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: [email protected]  微信:itcsdx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank

发表评论