Lab 6 – Regression Trees Winemaking is a challenging and competitive business. There are myriad factors that impact the quality of a varietal, some of which are environmental and others having to do...

Can I get price quote for those 2 assignments


Lab 6 – Regression Trees Winemaking is a challenging and competitive business. There are myriad factors that impact the quality of a varietal, some of which are environmental and others having to do with the manufacturing process. As a result, the winemaking industry has invested heavily in data collection and machine learning methods that may assist in creating high quality wine. A review written by a critic often determines whether a bottle ends up on the top or bottom shelf. We want to create a systematic way of mimicking ‘expert’ wine ratings. This could help winemakers identify key factors that contribute to better-rated wines. This system will not suffer from the subjectivity that is inherent with human tastings, such as mood and/or palate fatigue. A machine learning algorithm may result in better wine as well as a more objective, consistent, and fair ratings. The red wine data includes values of 11 chemical properties of a large sample of red wines. For each wine, a laboratory analysis measured characteristics such as the acidity, sugar content, chloride, sulfur, alcohol, pH, density, and more. The samples were then rated in a blind tasting by panels of no less than three judges on a quality scale ranging from 0 (very bad) to 10 (excellent). In the case that judges disagreed on the rating, the median value was used. Use R and present all your answers/explanations/visualizations in a Word document, using font ‘Courier New’. The data file was recorded comma-separated-variable form in file “redwines”. You will need to watch the tutorials to complete some of these task. 1. Which feature is your target and what type of feature is it? 2. How many examples do we have in this data set? In your own words what does each example represent here? 3. What is the mean and variance of our target feature? 4. Let’s split the data into a Training set and a Test set. First, you should randomize, i.e. shuffle the examples in the data set. To do this, set seed to 9850 just before you specify runif to get the same results as professor. Once you have done this proceed to split the data into Training and Test sets. Take the first 1000 examples for Training and the rest for Testing. Create 2 assigned objects here: 1. Training data set with the target feature, you can name it redwine_train 2. Test data set with the target feature, you can name it redwine_test 5. What is the mean of the target feature in the training data and in the test data? If the examples were shuffled well the means should be close to each other. 6. With the Training and Test sets successfully split, you can now use the rpart algorithm to create a regression tree model. 1. install and load “rpart”, and “rpart.plot” if haven’t yet done so 2. define model: m1<- rpart(target="" ~="" .,="" data="redwine_train," method="”anova”)" 3.="" plot="" your="" classification="" tree="" using:="" rpart.plot(m1,="" type="5," extra="101," fallen.leaves="TRUE)" 4.="" how="" many="" leaf="" nodes="" do="" we="" have="" in="" this="" tree?="" which="" feature="" was="" the="" most="" predictive="" of="" target?="" how="" many="" features="" did="" we="" end="" up="" splitting="" the="" data="" on?="" 7.="" let’s="" apply="" our="" regression="" tree="" model="" learned="" on="" the="" training="" data="" to="" our="" test="" data="" and="" make="" some="" predictions.="" try:="" ·="" p1=""><- predict(m1,="" redwine_test)="" 8.="" compute="" the="" mean="" absolute="" error="" for="" the="" predictions="" made="" in="" q7?="" copy="" and="" paste="" the="" code="" below="" in="" order="" to="" create="" the="" custom="" function="" necessary="" to="" compute="" mae.="" then="" use="" the="" function="" to="" compare="" the="" actual="" target="" values="" in="" the="" test="" data="" to="" the="" predictions="" made="" in="" q7.="" mae=""><- function(actual, predicted) { mean(abs(actual - predicted)) } submit file in lab submission folder lab 8 – text mining use r and present all your answers/explanations/visualizations in a word document, using font ‘courier new’. (part 1) mining a single document find an article, paper, or any single document with a good amount of terms and mine it. 1. find a document of around 400 words, copy and paste the text into notepad, save as .txt file, place in your working directory for easy import 2. import the document into r 3. clean the document for numbers, punctuation, stopwords, whitespace, and any other items you deem insignificant 4. create a wordcloud and note the most frequent term 5. using the lexicon of positive and negative terms, get a sentiment score for your document. (part 2) find an interesting application of text mining summarize in one or two sentences. submit file in lab submission folder fixed acidity,volatile acidity,citric acid,residual sugar,chlorides,free sulfur dioxide,total sulfur dioxide,density,ph,sulphates,alcohol,quality 6.5,0.9,0,1.6,0.052,9,17,0.99467,3.5,0.63,10.9,6 9.1,0.22,0.24,2.1,0.078,1,28,0.999,3.41,0.87,10.3,6 6.9,0.52,0.25,2.6,0.081,10,37,0.99685,3.46,0.5,11,5 7.3,0.59,0.26,2,0.08,17,104,0.99584,3.28,0.52,9.9,5 12.5,0.28,0.54,2.3,0.082,12,29,0.9997,3.11,1.36,9.8,7 5.4,0.74,0.09,1.7,0.089,16,26,0.99402,3.67,0.56,11.6,6 10.4,0.28,0.54,2.7,0.105,5,19,0.9988,3.25,0.63,9.5,5 7.9,0.4,0.3,1.8,0.157,2,45,0.99727,3.31,0.91,9.5,6 7.3,0.39,0.31,2.4,0.074,9,46,0.9962,3.41,0.54,9.4,6 9.5,0.37,0.52,2,0.088,12,51,0.99613,3.29,0.58,11.1,6 6.8,0.69,0,5.6,0.124,21,58,0.9997,3.46,0.72,10.2,5 8.2,0.28,0.6,3,0.104,10,22,0.99828,3.39,0.68,10.6,5 6.1,0.34,0.25,1.8,0.084,4,28,0.99464,3.36,0.44,10.1,5 6.9,0.45,0.11,2.4,0.043,6,12,0.99354,3.3,0.65,11.4,6 7.1,0.43,0.17,1.8,0.082,27,51,0.99634,3.49,0.64,10.4,5 10,0.31,0.47,2.6,0.085,14,33,0.99965,3.36,0.8,10.5,7 7.3,0.51,0.18,2.1,0.07,12,28,0.99768,3.52,0.73,9.5,6 11.5,0.59,0.59,2.6,0.087,13,49,0.9988,3.18,0.65,11,6 12,0.28,0.49,1.9,0.074,10,21,0.9976,2.98,0.66,9.9,7 8.2,0.35,0.33,2.4,0.076,11,47,0.99599,3.27,0.81,11,6 7.7,0.58,0.1,1.8,0.102,28,109,0.99565,3.08,0.49,9.8,6 7.6,1.58,0,2.1,0.137,5,9,0.99476,3.5,0.4,10.9,3 9.1,0.3,0.34,2,0.064,12,25,0.99516,3.26,0.84,11.7,7 7.2,0.62,0.01,2.3,0.065,8,46,0.99332,3.32,0.51,11.8,6 7,0.55,0.13,2.2,0.075,15,35,0.9959,3.36,0.59,9.7,6 9.3,0.4,0.49,2.5,0.085,38,142,0.9978,3.22,0.55,9.4,5 6.2,0.52,0.08,4.4,0.071,11,32,0.99646,3.56,0.63,11.6,6 8.9,0.59,0.5,2,0.337,27,81,0.9964,3.04,1.61,9.5,6 7.1,0.47,0,2.2,0.067,7,14,0.99517,3.4,0.58,10.9,4 5.3,0.47,0.11,2.2,0.048,16,89,0.99182,3.54,0.88,13.6,7 9.3,0.655,0.26,2,0.096,5,35,0.99738,3.25,0.42,9.6,5 8.8,0.42,0.21,2.5,0.092,33,88,0.99823,3.19,0.52,9.2,5 6.1,0.6,0.08,1.8,0.071,14,45,0.99336,3.38,0.54,11,5 7.1,0.66,0,2.4,0.052,6,11,0.99318,3.35,0.66,12.7,7 6.9,0.51,0.23,2,0.072,13,22,0.99438,3.4,0.84,11.2,6 8.3,0.6,0.25,2.2,0.118,9,38,0.99616,3.15,0.53,9.8,5 5.4,0.58,0.08,1.9,0.059,20,31,0.99484,3.5,0.64,10.2,6 7.2,0.45,0.15,2,0.078,10,28,0.99609,3.29,0.51,9.9,6 7.1,0.6,0.01,2.3,0.079,24,37,0.99514,3.4,0.61,10.9,6 8.7,0.765,0.22,2.3,0.064,9,42,0.9963,3.1,0.55,9.4,5 7.5,0.27,0.34,2.3,0.05,4,8,0.9951,3.4,0.64,11,7 7.4,0.29,0.38,1.7,0.062,9,30,0.9968,3.41,0.53,9.5,6 7.7,0.27,0.68,3.5,0.358,5,10,0.9972,3.25,1.08,9.9,7 7.3,0.44,0.2,1.6,0.049,24,64,0.9935,3.38,0.57,11.7,6 8,0.6,0.08,2.6,0.056,3,7,0.99286,3.22,0.37,13,5 6.4,0.57,0.14,3.9,0.07,27,73,0.99669,3.32,0.48,9.2,5 7.7,0.64,0.21,2.2,0.077,32,133,0.9956,3.27,0.45,9.9,5 11.3,0.37,0.5,1.8,0.09,20,47,0.99734,3.15,0.57,10.5,5 15.5,0.645,0.49,4.2,0.095,10,23,1.00315,2.92,0.74,11.1,5 6.8,0.47,0.08,2.2,0.064,18,38,0.99553,3.3,0.65,9.6,6 8,0.77,0.32,2.1,0.079,16,74,0.99656,3.27,0.5,9.8,6 8.4,0.62,0.12,1.8,0.072,38,46,0.99504,3.38,0.89,11.8,6 10.8,0.47,0.43,2.1,0.171,27,66,0.9982,3.17,0.76,10.8,6 6,0.5,0,1.4,0.057,15,26,0.99448,3.36,0.45,9.5,5 7 function(actual,="" predicted)="" {="" mean(abs(actual="" -="" predicted))="" }="" submit="" file="" in="" lab="" submission="" folder="" lab="" 8="" –="" text="" mining="" use="" r="" and="" present="" all="" your="" answers/explanations/visualizations="" in="" a="" word="" document,="" using="" font="" ‘courier="" new’.="" (part="" 1)="" mining="" a="" single="" document="" find="" an="" article,="" paper,="" or="" any="" single="" document="" with="" a="" good="" amount="" of="" terms="" and="" mine="" it.="" 1.="" find="" a="" document="" of="" around="" 400="" words,="" copy="" and="" paste="" the="" text="" into="" notepad,="" save="" as="" .txt="" file,="" place="" in="" your="" working="" directory="" for="" easy="" import="" 2.="" import="" the="" document="" into="" r="" 3.="" clean="" the="" document="" for="" numbers,="" punctuation,="" stopwords,="" whitespace,="" and="" any="" other="" items="" you="" deem="" insignificant="" 4.="" create="" a="" wordcloud="" and="" note="" the="" most="" frequent="" term="" 5.="" using="" the="" lexicon="" of="" positive="" and="" negative="" terms,="" get="" a="" sentiment="" score="" for="" your="" document.="" (part="" 2)="" find="" an="" interesting="" application="" of="" text="" mining="" summarize="" in="" one="" or="" two="" sentences.="" submit="" file="" in="" lab="" submission="" folder="" fixed="" acidity,volatile="" acidity,citric="" acid,residual="" sugar,chlorides,free="" sulfur="" dioxide,total="" sulfur="" dioxide,density,ph,sulphates,alcohol,quality="" 6.5,0.9,0,1.6,0.052,9,17,0.99467,3.5,0.63,10.9,6="" 9.1,0.22,0.24,2.1,0.078,1,28,0.999,3.41,0.87,10.3,6="" 6.9,0.52,0.25,2.6,0.081,10,37,0.99685,3.46,0.5,11,5="" 7.3,0.59,0.26,2,0.08,17,104,0.99584,3.28,0.52,9.9,5="" 12.5,0.28,0.54,2.3,0.082,12,29,0.9997,3.11,1.36,9.8,7="" 5.4,0.74,0.09,1.7,0.089,16,26,0.99402,3.67,0.56,11.6,6="" 10.4,0.28,0.54,2.7,0.105,5,19,0.9988,3.25,0.63,9.5,5="" 7.9,0.4,0.3,1.8,0.157,2,45,0.99727,3.31,0.91,9.5,6="" 7.3,0.39,0.31,2.4,0.074,9,46,0.9962,3.41,0.54,9.4,6="" 9.5,0.37,0.52,2,0.088,12,51,0.99613,3.29,0.58,11.1,6="" 6.8,0.69,0,5.6,0.124,21,58,0.9997,3.46,0.72,10.2,5="" 8.2,0.28,0.6,3,0.104,10,22,0.99828,3.39,0.68,10.6,5="" 6.1,0.34,0.25,1.8,0.084,4,28,0.99464,3.36,0.44,10.1,5="" 6.9,0.45,0.11,2.4,0.043,6,12,0.99354,3.3,0.65,11.4,6="" 7.1,0.43,0.17,1.8,0.082,27,51,0.99634,3.49,0.64,10.4,5="" 10,0.31,0.47,2.6,0.085,14,33,0.99965,3.36,0.8,10.5,7="" 7.3,0.51,0.18,2.1,0.07,12,28,0.99768,3.52,0.73,9.5,6="" 11.5,0.59,0.59,2.6,0.087,13,49,0.9988,3.18,0.65,11,6="" 12,0.28,0.49,1.9,0.074,10,21,0.9976,2.98,0.66,9.9,7="" 8.2,0.35,0.33,2.4,0.076,11,47,0.99599,3.27,0.81,11,6="" 7.7,0.58,0.1,1.8,0.102,28,109,0.99565,3.08,0.49,9.8,6="" 7.6,1.58,0,2.1,0.137,5,9,0.99476,3.5,0.4,10.9,3="" 9.1,0.3,0.34,2,0.064,12,25,0.99516,3.26,0.84,11.7,7="" 7.2,0.62,0.01,2.3,0.065,8,46,0.99332,3.32,0.51,11.8,6="" 7,0.55,0.13,2.2,0.075,15,35,0.9959,3.36,0.59,9.7,6="" 9.3,0.4,0.49,2.5,0.085,38,142,0.9978,3.22,0.55,9.4,5="" 6.2,0.52,0.08,4.4,0.071,11,32,0.99646,3.56,0.63,11.6,6="" 8.9,0.59,0.5,2,0.337,27,81,0.9964,3.04,1.61,9.5,6="" 7.1,0.47,0,2.2,0.067,7,14,0.99517,3.4,0.58,10.9,4="" 5.3,0.47,0.11,2.2,0.048,16,89,0.99182,3.54,0.88,13.6,7="" 9.3,0.655,0.26,2,0.096,5,35,0.99738,3.25,0.42,9.6,5="" 8.8,0.42,0.21,2.5,0.092,33,88,0.99823,3.19,0.52,9.2,5="" 6.1,0.6,0.08,1.8,0.071,14,45,0.99336,3.38,0.54,11,5="" 7.1,0.66,0,2.4,0.052,6,11,0.99318,3.35,0.66,12.7,7="" 6.9,0.51,0.23,2,0.072,13,22,0.99438,3.4,0.84,11.2,6="" 8.3,0.6,0.25,2.2,0.118,9,38,0.99616,3.15,0.53,9.8,5="" 5.4,0.58,0.08,1.9,0.059,20,31,0.99484,3.5,0.64,10.2,6="" 7.2,0.45,0.15,2,0.078,10,28,0.99609,3.29,0.51,9.9,6="" 7.1,0.6,0.01,2.3,0.079,24,37,0.99514,3.4,0.61,10.9,6="" 8.7,0.765,0.22,2.3,0.064,9,42,0.9963,3.1,0.55,9.4,5="" 7.5,0.27,0.34,2.3,0.05,4,8,0.9951,3.4,0.64,11,7="" 7.4,0.29,0.38,1.7,0.062,9,30,0.9968,3.41,0.53,9.5,6="" 7.7,0.27,0.68,3.5,0.358,5,10,0.9972,3.25,1.08,9.9,7="" 7.3,0.44,0.2,1.6,0.049,24,64,0.9935,3.38,0.57,11.7,6="" 8,0.6,0.08,2.6,0.056,3,7,0.99286,3.22,0.37,13,5="" 6.4,0.57,0.14,3.9,0.07,27,73,0.99669,3.32,0.48,9.2,5="" 7.7,0.64,0.21,2.2,0.077,32,133,0.9956,3.27,0.45,9.9,5="" 11.3,0.37,0.5,1.8,0.09,20,47,0.99734,3.15,0.57,10.5,5="" 15.5,0.645,0.49,4.2,0.095,10,23,1.00315,2.92,0.74,11.1,5="" 6.8,0.47,0.08,2.2,0.064,18,38,0.99553,3.3,0.65,9.6,6="" 8,0.77,0.32,2.1,0.079,16,74,0.99656,3.27,0.5,9.8,6="" 8.4,0.62,0.12,1.8,0.072,38,46,0.99504,3.38,0.89,11.8,6="" 10.8,0.47,0.43,2.1,0.171,27,66,0.9982,3.17,0.76,10.8,6="" 6,0.5,0,1.4,0.057,15,26,0.99448,3.36,0.45,9.5,5="">
Dec 13, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here