Perform a k-nearest neighbors prediction with all the


Your task is to run k-nearest neighbors algorithm in XLMiner for both prediction and classification tasks describe below, and submit your answer with your XLMiner execution result files attached in your submission. Since the k-nearest neighbor algorithm can be used for both classification and prediction, there are two menus under XLMiner, Classify and Predict.

The file BostonHousing.xls contains information on over 500 census tracts in Boston, where for each tract 14 variable values are recorded. The last column (CAT.MEDV) was derived from MEDV, such that it obtains the value 1 if MEDV>30 and 0 otherwise. Consider the goal of predicting and classifying the median value (MEDV and CAT.MEDV) of a tract, given the information in the first 12 columns (input variables) in the column list. Partition the data into training (60%) and validation sets.

(For description of the column names in BostonHousing.xls, please make reference to Table 2.2 on page 33 of the textbook)

1. Under Predict menu in XLMiner, perform a k-nearest neighbors prediction with all the predictors from column A (CRIM) to column M (LSTAT) (excluding the CAT.MEDV, the CAT.MEDV column is the outcome variable for classification) for both training data set and validation data set, trying values of k from 1 to 15 to predict the value MEDV. What is the best k chosen? What does it mean? Also attach the execution result file including RMSE (Root Mean Square Errors) in your submission. (you can try run prediction with normalizing data and without normalizing data).

2. Under Classify menu in XLMiner, perform k-nearest neighbors classification with all the predictors from column A (CRIM) to column M (LSTAT) (excluding the MEDV, the MEDV column is the outcome variable for prediction) for both training data set and validation data set, and find the best K for validation data set, trying values of k from 1 to 15 to classify CAT.MEDV (make sure to normalize the data). Also attach the execution result file including confusion matrix, lift chart, and ROC chart in your submission.

3. Try different seed numbers for random partition to see if the K values achieved will be different.

Note:

1. The file BostonHousing.xls is posted along with Written Assignment #2B, and description of columns are given in the same data file.

2. The cloud based XLMiner is accessible

3. For the Windows based XLMiner, please check the XLMiner download instruction posted in the Discussion Forum in Blackboard.

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Perform a k-nearest neighbors prediction with all the
Reference No:- TGS02344775

Now Priced at $40 (50% Discount)

Recommended (93%)

Rated (4.5/5)