Computers and Technology

To complete this problem, you will need to read and follow an example. In following the example, you can simply cut and paste the commands, however, the intended goals of this problem is to learn and understand how and why this decision is working and used. The steps for this problem are as follows:
1. Read Chapter 8 of the Larose text, "What Is a Decision Tree?"
2. Complete the R Zone exercise found on pages 180 and 181 of the reading.
3. Copy and Paste the R Zone decision tree you generate in R into a Word document.
4. Include an explanation of what this decision tree is telling you.

The steps to complete this assignment are outlined here. These are provided to guide you through the problem. Note that in practice, you would be expected to know how to perform your own analysis, so making notes as you perform the exercise will be helpful in your use of these methods.

1. Open R.
2. Open the notepad file Module4_Problem1.txt (found in DAT 520 Data files folder).
a. This text file contains the text commands listed in the R Zone example. The commands have the extraneous characters removed from PDF copy pasting as well as points to the proper csv file for this assignment. If you choose to perform the assignment independent of these instructions, please see the problem notes below for additional details.
3. Each step begins with a # which is a comment identifier in R. Note: the first couple of instructions is to identify the file path and to then read in the file. You can copy all lines including the # if you want the Recommend execution will ignore the # line. Paste it into your R console and hit return. The command set should complete fine. If you encounter an error, please review the problem notes found below. Continue working through the file until all commands have been run from the example assignment and you have produced your tree.
4. Right-click on the tree image produced and copy it as a bitmap (image) into Word.
5. Write your explanation of what this tree is telling you.
6. Save the file. You will continue to use this file to add the results of Problem 2 and Problem 3 as well.

Problem 1 Notes:
If you are running R locally on your desktop, you can download the clemtraining data zip file and extract it to your local computer. Use the R file. choose() command to navigate to your file in R and R will display the exact path you need for the file=
The data set for this exercise is called Clem3Training. zip and unpacks to become Clem3Training. csv. Itis provided in the DAT 520 Data files folder in Course Information on Blackboard.
# Get the proper file path for CLEM3Training. csv
file. choose()

When you complete the R commands make sure to save your new file for use in Problem 2
#write file for problem 2 write. csv(dat, file="c:/dat520/CLEM3TrainingP2.csv ")

-Word is on the VDI and you can right-click on an image in R, copy it as a bitmap, and paste it into Word. Then save that document to your SNHU drive or use Dropbox. Alterna±vely, when you are finished with the assignment you could post it directly From the VDI into Blackboard.
-Note: There is a possible problem with copying the commands right out oF the PDF of the Larose chapter. Some people have this problem and some do not. You may see an error like this:

Error: unexpected input in "carTit <- rpart(income"

It is the tilde character that R chokes on iF you are getting that error. To fix this error, use this:

car´it <- rpart(income ~ age. z + educa±on. num. z + capital. gain. z + capital. loss. z +
hours. per. week. z + race + sex + workclass + marital. status, data = dat, method = "class")

Copy and pasting that command into R From here works. It is the ~ character causing the problem. This thread explains a little more about the issue with R tides.

-You can open Blackboard on the Virtual Desktop to download the .zip file and unpack it so that you can import Clem3Training. csv into R using the read. csv command in the VDI directly.
-Instructions For R are Found in the Decision Tree reading beginning on page 180 in the R Zone step-by-step directions.

Note that you may have to install the correct R modules in order to do the exercise, like you had to do with "expm" to complete the exponentiation exercise. Get good at installing and invoking packages in R. It is a common task that needs to become second nature. Additionally, here are R directions For inputting data, in case you get stuck trying to get the data set into R to play with it: How to Input Data Into R. Keep this info handy for future use. Test it out on some data that you have, so that you can easily get data into R anytime you need to.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:00, EinsteinBro
Kyle wants to access his school’s home page. how can he do this?
Answers: 1
image
Computers and Technology, 22.06.2019 19:50, rosyposy43
Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called. write a constructor for the above class that initialized both variables to zero. write a tostring to display both the tank and speed when the car is printed. modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter. write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.
Answers: 1
image
Computers and Technology, 22.06.2019 22:00, noeminm105
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag. e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
image
Computers and Technology, 22.06.2019 23:50, Crull5999
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
Do you know the correct answer?
To complete this problem, you will need to read and follow an example. In following the example, you...

Questions in other subjects: