久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

代做CITS5508、代做 Python 語(yǔ)言程序

時(shí)間:2024-04-21  來源:  作者: 我要糾錯(cuò)



CITS5508 Machine Learning Semester 1, 2024
Assignment 2
Assessed, worth 15%. Due: 8pm, Friday 03th May 2024
Discussion is encouraged, but all work must be done and submitted individually. This assign- ment has 21 tasks, from which 20 are assessed, which total 45 marks.
You will develop Python code for classification tasks. You will use Grid Search and cross- validation to find the optimal hyperparameters of the model and discuss and interpret the differ- ent decisions and their impact on the model’s performance and interpretability.
1 Submission
Your submission consists of two files. The first file is a report describing your analysis/results. Your analysis should provide the requested plots, tables and your reflections about the results. Each deliverable task is indicated as D and a number. Your report should be submitted as a “.PDF” file. Name your file as assig1 <student id>.pdf (where you should replace <student id> with your student ID).
The second file is your Python notebook with the code supporting your analysis/results. Your code should be submitted as assig1 <student id>.ipynb, the Jupyter notebook exten- sion.
Submit your files to LMS before the due date and time. You can submit them multiple times. Only the latest version will be marked. Your submission will follow the rules provided in LMS.
Important:
• You must submit the first part of your assignment as an electronic file in PDF format (do not send DOCX, ZIP or any other file format). Only PDF format is accepted, and any other file format will receive a zero mark.
• You should provide comments on your code.
• You must deliver parts one and two to have your assignment assessed. That is, your submission should contain your analysis and your Jupyter notebook with all coding, both with appropriate formatting.
• Bysubmittingyourassignment,youacknowledgeyouhavereadallinstructionsprovided in this document and LMS.
• There is a general FAQ section and a section in your LMS, Assignments - Assignment 2 - Updates, where you will find updates or clarifications about the tasks when necessary. It is your responsibility to check this page regularly.
1

• You will be assessed on your thinking and process, not only on your results. A perfect performance without demonstrating understanding what you have done won’t provide you marks.
• Your answer must be concise. A few sentences (2-5) should be enough to answer most of the open questions. You will be graded on thoughtfulness. If you are writing long answers, rethink what you are doing. Probably, it is the wrong path.
• Youcanaskinthelaborduringconsultationifyouneedclarificationabouttheassignment questions.
• You should be aware that some algorithms can take a while to run. A good approach to improving their speed in Python is to use the vectorised forms discussed in class. In this case, it is strongly recommended that you start your assignment soon to accommodate the computational time.
• For the functions and tasks that require a random procedure (e.g. splitting the data into 80% training and 20% validation set), you should set the seed of the random generator to the value “5508” or the one(s) specified in the question.
2 Dataset
In this assignment, you are asked to train a few decision tree classifiers on the Breast cancer wisconsin (diagnostic) dataset available on Scikit-Learn and compare their performances.
Description about this dataset can be found on the Scikit-Learn web page:
https://scikit-learn.org/stable/datasets/toy dataset.html#breast-cancer-wisconsin-diagnostic-dataset
There are two classes in the dataset:
• malignant (212 instances, class value 0) and
• benign (357 instances, class value 1). Follow the example code given on the web page
https://scikit-learn.org/stable/modules/generated/sklearn.datasets.load breast cancer.html#sklearn.datasets. load breast cancer
to read the dataset and separate it into a feature matrix and a class vector. Your feature matrix should have 569 (rows) × 30 (columns) and your class vector should have 569 elements.
In all asked implementations using Decision Trees, Random Forests or data splits (such as when using train test split()), you should set random state as specified for results reproducibil- ity. You should aim to round your results to the second decimal place.
2

3 Tasks
First inspections on the dataset and preprocessing
D1 2 marks
Re-order the columns in your feature matrix (or dataframe) based on the column name. Provide a scatter plot to inspect the relationship between the first 10 features in the dataset. Use different colours in the visualisation to show instances coming from each class. (Hint: use a grid plot.)
D2 2 marks
Provide a few comments about what you can observe from the scatter plot:
• •
• •
What can be observed regarding the relationship between these features?
Can you observe the presence of clusters of groups? How do they relate to the target variable?
Are there any instances that could be outliers?
Are there features that could be removed? Why or why not?
1 mark
Compute and show the correlation matrix where each cell contains the correlation coefficient between the corresponding pair of features (Hint: you may use the heatmap function from the seaborn package).
D4 1 mark
Do the correlation coefficients support your previous observations?
D5
In a data science project, it’s crucial not just to remove highly correlated features but to consider the context and implications of feature selection carefully. Blindly dropping features may lead to the loss of valuable information or unintended bias in the model’s performance. Here, for the assignment context, we will drop a few features to simplify the classification tasks and speed up the computational time. Create a code that drop the features: mean perimeter, mean radius, worst radius, worst perimeter and radius error. These are features with a linear corre- lation higher than 0.97 in magnitude with some other features kept in the data.
After this process, your data matrix should be updated accordingly and contain 25 features. Task D5 must be performed; otherwise, your order deliverable tasks will be incorrect. However, there are no marks for task D5.
Fitting a Decision Tree model with default hyperparameters
D6 3 marks
Fit a decision tree classifier using default hyperparameters using 80% of the data. Remember to set the random generator’s state to the value “5508” (for both the split and class). Use the trained classifier to perform predictions on the training and test sets. Provide the accuracy, precision and recall scores for both sets and the confusion matrix for the test set.
D3
3

D7 2 marks
Comment on these results. Do you think your classifier is overfitting? If so, why this is happen- ing? If not, why not?
D8 2 marks
Display the decision tree built from the training process (like the one shown in Figure 6.1 of the textbook for the iris dataset).
D9 2 marks
Study the tree diagram and comment on the following:
• How many levels resulted from the model?
• Did the diagram help you to confirm whether the classifier has an overfitting issue? • What can you observe from the leaves?
• Is this an interpretable model?
D10 3 marks
Repeat the data split another four times, each using 80% of the data to train the model and the remaining 20% for testing. For these splits, set the seed of the random state to the values “5509”, “5510”, “5511” and “5512”. The random state of the model can be kept at “5508”.
For each of these four splits, fit the decision tree classifier and use the trained classifier to perform predictions on the test set. Provide three plots to show the accuracy, precision and recall scores for the test set for each split and comment on the consistency of the results in the five splits (including the original split with random state “5508”).
D11 3 marks
Investigate the impact of the training size on the performance of the model. You will do five different splits: 50%-50% (training the model on 50% of the data and testing on the remaining 50%), 60%-40%, 70%-30%, 80%-20% and 90%-10%. For each of these data splits, set back the seed of the random state to the value “5508”.
Provide three plots to show the accuracy, precision and recall scores for the test set for each data split and comment on the results. Did the performance behave as you expected?
Fitting a Decision Tree model with optimal hyperparameters
D12 4 marks
Create a training set using 80% of the data and a test set with the remaining 20%. Use a 10-fold cross-validation and grid-search to find the optimal combination of hyperparameters max depth — using values [2, 3, 4, 5], min samples split — using values [2, 4, 5, 10],andminsamplesleaf—usingvalues[2, 5]ofadecisiontreemodel.Remembertoset the seed of the random state of the data split function and model class to the value “5508”. For the cross-validation, set the value of the random state to “42”. Use accuracy for the scoring argument of the grid-search function.
With the optimal obtained hyperparameters, retrain the model and report: 4

• The optimal hyperparameters;
• The obtained accuracy, precision and recall on the training set;
• The obtained accuracy, precision and recall on the test set;
• The confusion matrix on the test set.
D13
2 marks
Comment: What was the impact of fine-tuning the hyperparameters as opposed to what you obtained in D6? Has fine-tuning done what you expected?
D14 3 marks Repeat the training of task D12 twice: one considering the scoring argument of the grid-search function as precision and the other recall.
For each of the scoring options (accuracy, precision, recall), provide the optimal hyperparame- ters according to the 10-fold cross-validation and grid-search, and, after retraining each model accordingly, provide the confusion matrix on the test set. Comment on the results, considering the problem.
Fitting a Decision Tree with optimal hyperparameters and a reduced feature set
D15 1 mark
Using the model with fine-tuned hyperparameters based on accuracy (the one you obtained in D12), display the feature importance for each feature obtained from the training process. You should sort the feature importances in descending order.
D16 3 marks
Using the feature importance you calculated in the previous task, trim the feature dimension of the data. That is, you should retain only those features whose importance values are above 1% (i.e., 0.01). You can either write your own Python code or use the function SelectFromModel from the sklearn.feature selection package to work out which feature(s) can be removed.
Report what features were retained and removed in the above process. Also report the total feature importance value that is retained after your dimension reduction step.
D17 3 marks
Compare the model’s performance (accuracy, precision, recall) on training and test sets when using the reduced set of features and the model trained on the complete set of features. Also, report the corresponding confusion matrices on the test sets. (You will need to consider whether you should repeat the cross-validation process to find the optimal hyperparameters).
D18 1 mark
Comment on your results. What was the impact (if any) of reducing the number of features?
5

Fitting a Random Forest
D19 3 marks
Considering all features and the 80%-20% data split you did before, use 10-fold cross-validation and grid-search to find a Random Forest classifier’s optimal hyperparameters n estimators (number of estimators) and max depth. Remember to set the seed of the random state of the data split function and model class to the value “5508”. Use n estimators:[10, 20, 50, 100, 1000], and max depth:[2, 3, 4, 5]. For the cross-validation, set the value of the random state to “42”. Use accuracy for the scoring argument of the grid-search function.
Keep the other hyperparameter values to their default values. Use the optimal values for the n estimators and max depth hyperparameters to retrain the model and report:
• The obtained optimal number of estimators and max depth;
• The obtained accuracy, precision and recall on the training set;
• The obtained accuracy, precision and recall on the test set;
• The confusion matrix on the test set.
D20
How do these performances compare with the ones you obtained in D12? What changed with the use of a Random Forest model? Is this result what you would expect?
D21 2 marks
Thinking about the application and the different models you created, discuss:
• Do you think these models are good enough and can be trusted to be used for real?
• Do you think a more complex model is necessary?
• Do you think using a machine learning algorithm for this task is a good idea? That is, should this decision process be automated? Justify.
• Are there considerations with the used dataset?


請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

標(biāo)簽:

掃一掃在手機(jī)打開當(dāng)前頁(yè)
  • 上一篇:代做CPT206、c/c++,Python程序設(shè)計(jì)代寫
  • 下一篇:FIT5225 代做、代寫 java,c++語(yǔ)言程序
  • 無(wú)相關(guān)信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗(yàn)證碼平臺(tái) 理財(cái) WPS下載

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

    欧美精品第三页| 男的插女的下面视频| 男女裸体影院高潮| 亚洲免费一级视频| 欧美三级午夜理伦三级| 国产二区视频在线| 日韩免费在线观看av| 天天综合中文字幕| 天堂在线中文在线| 午夜免费看视频| 性刺激的欧美三级视频| 青青在线免费观看视频| 99精品在线免费视频| 欧美精品卡一卡二| 国产真人做爰毛片视频直播 | 黄色高清无遮挡| 91av资源网| 国产精品亚洲αv天堂无码| 国产av麻豆mag剧集| www精品久久| 欧美日韩一道本| 欧美日韩成人免费视频| av日韩一区二区三区| 九一国产精品视频| 日韩网址在线观看| 日本xxxxxxx免费视频| 日本999视频| 一级黄色特级片| 91精产国品一二三产区别沈先生| 做a视频在线观看| 日本一级淫片演员| 精品少妇人欧美激情在线观看| 91免费黄视频| 超碰网在线观看| 在线观看免费黄网站| 三级av免费看| 日韩精品在线视频免费观看| 国产精品333| av丝袜天堂网| 国产成年人在线观看| 日本免费a视频| 成人免费观看毛片| 亚洲人视频在线| 50度灰在线观看| 99福利在线观看| 一区二区免费av| 成人在线免费高清视频| 99视频在线免费播放| 亚洲欧美国产日韩综合| 成人在线观看www| 一区二区传媒有限公司| www.日本一区| 隔壁人妻偷人bd中字| 黄色三级视频片| 天天做天天爱天天高潮| 91成人综合网| 一区二区xxx| 国产美女主播在线| 男操女免费网站| 青青青在线观看视频| 精品久久久久久久无码| 日本a级片在线观看| 91av在线免费播放| 国产日韩视频在线播放| 又粗又黑又大的吊av| 亚洲 国产 图片| 亚洲色成人www永久在线观看 | 亚洲天堂国产视频| 欧美在线观看视频免费| 99视频精品免费| 日本老太婆做爰视频| 91淫黄看大片| 996这里只有精品| 日日噜噜夜夜狠狠| 岛国大片在线播放 | 日韩中文字幕在线不卡| 成人免费xxxxx在线视频| 粉嫩av一区二区三区天美传媒| 日本黄网站免费| japanese在线播放| 亚洲 激情 在线| 日韩av片在线看| 日本福利视频网站| 小早川怜子一区二区三区| 妞干网在线免费视频| 六月婷婷在线视频| 色偷偷中文字幕| 日韩大片一区二区| 动漫av网站免费观看| 超碰人人爱人人| 亚洲最大天堂网| 国产v亚洲v天堂无码久久久 | www.亚洲一区二区| 亚洲另类第一页| 色综合av综合无码综合网站| 国产精品视频网站在线观看| 亚洲综合伊人久久| 午夜国产一区二区三区| 久久无码高潮喷水| 69sex久久精品国产麻豆| 亚洲自拍偷拍一区二区三区| 三上悠亚av一区二区三区| 成年人免费大片| 黑人糟蹋人妻hd中文字幕| 日韩国产一级片| 国产xxxx振车| 黄色成人在线免费观看| 2021国产视频| 大地资源网在线观看免费官网| 毛片毛片毛片毛片毛| gogogo高清免费观看在线视频| 国产精品乱码久久久久| 亚洲精品乱码久久久久久自慰| 亚洲熟妇av日韩熟妇在线| 欧美乱大交xxxxx潮喷l头像| 久久久久99精品成人片| 97超碰国产精品| 国产欧美日韩小视频| 久久手机在线视频| 精品无码国产一区二区三区av| 六月婷婷激情综合| 成人免费观看在线| 久久国产精品网| 免费国产黄色网址| 黄www在线观看| 欧美精品色婷婷五月综合| 美女av免费在线观看| 日本三级免费网站| 精品久久久久久无码国产| 精品久久久久av| 亚洲黄色a v| 小明看看成人免费视频| 中文字幕剧情在线观看| 色撸撸在线观看| 玖玖精品在线视频| 久久人人爽人人爽人人av| 尤物av无码色av无码| 成年人免费在线播放| 亚洲乱码国产一区三区| 亚洲欧美自偷自拍另类| 天天干天天曰天天操| 免费看黄色a级片| 国精产品一区一区三区视频| av免费在线播放网站| 岛国毛片在线播放| 久久视频免费在线| 欧美大片在线播放| 91香蕉视频污版| 91在线第一页| 久青草视频在线播放| 国产日韩一区二区在线| 午夜宅男在线视频| 乱子伦一区二区| 黄色影院一级片| 手机版av在线| 青青草视频在线视频| 国产午夜伦鲁鲁| 污污网站在线观看视频| 九九久久九九久久| 青青草原av在线播放| 亚洲av无日韩毛片久久| 阿v天堂2018| 黄色片视频在线| 少妇大叫太大太粗太爽了a片小说| 激情综合在线观看| 在线视频日韩欧美| 成熟丰满熟妇高潮xxxxx视频| 欧美一级特黄a| 女人帮男人橹视频播放| 久久久精品三级| 菠萝蜜视频在线观看入口| 熟女少妇精品一区二区| 神马午夜伦理影院| 成人3d动漫一区二区三区| 超碰在线免费观看97| 99热成人精品热久久66| 亚洲天堂av免费在线观看| 一区二区传媒有限公司| 亚洲最新免费视频| 黄色国产精品视频| 日本高清xxxx| av在线无限看| 久久久久久免费看| 91免费视频污| 青青在线免费观看视频| 无码日本精品xxxxxxxxx| 美女网站视频黄色| 欧美成人三级在线视频| 欧美激情第四页| 日本a√在线观看| 久久久久免费看黄a片app| av噜噜在线观看| 凹凸日日摸日日碰夜夜爽1| 国内精品国产三级国产99| 国产一二三区av| av观看免费在线| 僵尸世界大战2 在线播放| 精品日韩在线播放| 日韩成人精品视频在线观看| 女人扒开屁股爽桶30分钟|