代做161.777 Practical Data Mining 2025调试R程序

161.777 Practical Data Mining

Project 2025

General information

This project is assessed. Your work must be submitted by 11:59pm on 9th June 2025.

There are questions on prediction and classification, as well as clustering and association rules.

For the prediction and classification problems you should provide both the writeup of your methodology in the space provided in the project.Rmd file, as well as a .csv file for each exercise. In each case these should be the provided test set, with an additional column containing your predictions or classifications.

Make sure that your predictions or classifications make sense. e.g. that your .csv file has the correct number of rows, and there is a clear column with your predictions.

You may include your code to do the prediction and classification in the project.Rmd provided if you wish. Alternatively you may do your modelling work in a separate R script. or markdown file. This may save re-running code whenever you Knit your project.Rmd as you writeup your methodology and answer the exercises on clustering and association rules.

Start by downloading the project file by Right clicking and Save File As… here:

https://www.massey.ac.nz/~jcmarsha/161777/assessment/project.Rmd

Then loading it into RStudio.

Exercise 1: Predicting Arctic Ice Thickness [25 marks]

This exercise is concerned with measurements of arctic ice thickness collected by scientific vessels in the Arctic Ocean. Each record corresponds to data collected over a single track (voyage between two points).

Variable

Description

Year

Calendar year

MinDay

First day of track (day of the year)

MaxDay

Last day of track (day of the year)

MinLat

Minimum latitude of track, in degrees

MaxLat

Maximum latitude of track, in degrees

MinLon

Minimum longitude of track, in degrees

MaxLon

Maximum longitude of track, in degrees

Length

Length of track, in km

Nsamps

Number of thickness measurements taken during track

Thickness

Mean ice thickness over track, in metres (target)

The aim is to predict the target variable Thickness using information from the other 9 variables (the predictors). The training dataset contains 10,000 records (on all variables) while the test dataset contains 1,085 records (on all variables except for Thickness).

You are to produce predictions for the Thickness variable on the 1,085 records in the test data, adding it as a column to the ice.test data frame. and writing to a .csv file. You can do this with

write_csv(ice.test.with.predictions, "ex1_studentid.csv")

replacing studentid with your student id code.

Please make sure that the column with your predictions is named .pred. This is the default if you use tidymodels.

Make sure you attach your ex1_studentid.csv file to your stream submission.

You will be scored based on root mean squared error on the test set, worth a total of 15 marks. A score of 0 will correspond to utilising the mean of the target on the training set as your predictions.

You should also writeup your methodology for answering this question in the section provided in the project.Rmd file. This writeup should include:

· What, if any, data processing you performed.

· What exploratory analysis you undertook.

· Which modelling techniques you tried, including information on predictors chosen and any tuning performed.

· EITHER: A statement that you did not use information from outside of the course, OR: A statement detailing what information from outside the course was used, where it was from, and how you learnt from that.

· A clear statement of which model you chose, and why you chose it.

Your methodology will be marked out of 10 marks.

Exercise 2: Classifying Campylobacter [25 marks]

This exercise is concerned with some Campylobacter isolates that were collected as part of the Source Assigned Case Control Study in New Zealand (SACNZ) project.

There are 400 isolates of Campylobacter isolated from Beef, Sheep or Poultry sources (from faeces or meat). Each isolate was whole-genome sequenced with 1343 ‘core’ genes identified. For each isolate and each gene, sequences were scored based on sequence similarity, projecting each gene into two dimensional space, and a subset of 25 genes were selected.

The training data thus consists of 50 numeric predictors named as CAMP0003.V1, representing the first score of the CAMP0003 gene, and the target Source, which takes the values Beef, Sheep or Poultry for these 400 isolates.

In addition, we have a test dataset with 160 additional isolates where the Source is unknown.

Based on previous work, we would expect that Poultry isolates are likely to differ compared to Beef and Sheep, but distinguishing Beef and Sheep may be difficult.

You are to produce classifications for the Source variable on the 160 records in the test data, adding it as a column to the campy.test data frame. and writing to a .csv file. You can do this with

write_csv(campy.test.with.classifications, "ex2_studentid.csv")

replacing studentid with your student id code.

Please make sure your classifications are named .pred_class. This is the default if you use tidymodels.

Make sure you attach your ex2_studentid.csv file to your stream submission.

You will be scored based on classification rate, worth a total of 15 marks. A score of 0 will correspond to picking sources at random.

You should also writeup your methodology for answering this question in the section provided in the project.Rmd file. This writeup should include:

· What, if any, data processing you performed.

· What exploratory analysis you undertook.

· Which modelling techniques you tried, including information on predictors chosen and any tuning performed.

· EITHER: A statement that you did not use information from outside of the course, OR: A statement detailing what information from outside the course was used, where it was from, and how you learnt from that.

· A clear statement of which model you chose, and why you chose it.

Your methodology will be marked out of 10 marks.

Exercise 3: Clustering the New Zealand World Values Survey [32 marks]

We consider some data from the New Zealand version of the 2014 World Values Survey. The variables we consider are:

Variable

Description

Female

1 means yes the person is female, 0 means male

Age

is in years

StateofHealth

is coded as 1=very good, 2= good, 3=fair, 4= poor.

MaritalStatus

1= married, 2=living together as married, 3= divorced, 4=separated, 5=widowed, 6=single.

HighestEducation

is coded as 1= no secondary schooling, 2= some secondary, 3= finished secondary, 4=some tertiary, 5=degree.

LifeSatisfaction

is coded from 1 (least satisfied) to 10 (most satisfied)

IncomeDecile

is coded from 1 (least income) to 10 (most income) decile of the population

SocialClass

is coded by self-identification as 1= upper class, 2= upper middle class, 3= lower middle class, 4= working class, 5= lower class.

BelieveinGod

1= yes, 0=no.

FeelingofHappiness

1= very happy, 2=rather happy, 3=not very happy, 4= not at all happy.

All other answers to these questions are coded as missing, NA.

1. 

Do an initial exploration of the dataset:

2. 

Showing plots and summary tables to examining the distributions of values of each variable, commenting on the distributions. 6 marks

Some sorts of people may be more/less willing to do a Values survey. Comment on how this may bias the survey. 2 marks

Which three variables have the most missing values? Suggest possible reasons for these. 2 marks

3. 

Prepare a new version of the dataset with all variables normalised. Comment on why these this step is appropriate prior to a cluster analysis for these data. 3 marks

4. 

5. 

Produce a dendrogram of the sample, selecting the variables Age, Female, MaritalStatus, StateofHealth, HighestEducation and LifeSatisfaction, after normalisation. Remove all missing values. Use hierarchical clustering with complete linkage. What do you think is the best number of clusters to divide the sample into. 4 marks

6. 

7. 

Perform. a kk-means cluster analysis of the new reduced, normalised dataset, based on Euclidean distances. Choose an appropriate value of kk within 1,2,…,10, and explain why you chose it. Include graphs of tot.withinSS and average silhouette width and silhouettes. Note there is no one perfect answer. 6 marks

8. 

9. 

Regardless of your answer to part 3, show a fviz_cluster graph, based on 4 clusters and complete hierarchical linkage. Does the graph show sufficient separation between the clusters? Explain. 3 marks

10. 

11. 

Assume four clusters, and use kmeans. Explore the differences among the clusters using boxplots. For each cluster, write a sentence or two characterizing the cluster in terms of the variables. 6 marks

12. 

Exercise 4: Association Rules [18 marks]

A vexillologist is a person who studies flags. In this exercise we will consider the colours of 211 flags of different countries. Certain colours seem to go together.

1. 

Make a plot showing how frequently the various colours have been used. What are the top three most popular colours? 3 marks

2. 

3. 

Consider only rules where there are at least 5 countries have used the same colour combination (i.e. those with support parameter 0.023) and with the confidence cutoff set to confidence = 0.5. How many rules are found? 2 marks

4. 

5. 

Find the 5 rules with the highest support. Take the third one in this list and (i) explain the rule itself (i.e. what ‘itemset => itemset’ represents), and (ii) interpret the values of support, confidence, and lift for this rule. 6 marks

6. 

7. 

Find the rules for which lift is greater than 2. How many are there? Explain what these rules tell you. 3 marks

8. 

9. 

Suppose the island of Choiseul declares its independence. The leaders solicit ideas for a flag. Their main stipulation is that it must have black as a prominent colour. Answer the following, making sure you justify your answers from the data:

10. 

· 

If there is going to be at least one other colour, then on the basis of the data, which colour do you think is most likely to be chosen?

· 

· 

If the leaders were tending towards a four-colour flag including black, blue and red, what would be the most likely extra colour? 4 marks

· 


热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图