RSTUDIO DATA MINING

alperjohnny

  

Task 1.

Classification — Use income.csv file to conduct the classification task. Target variable: income. Predictors: all other variables in the file. Partition the data one training sample (the first 50% rows based on the order of row index) and two testing samples (the next following 25% rows as test1 and the rest 25% as test2). Build classification model on training sample and evaluate it on two testing samples. Evaluation metrics that need to be generated: overall accuracy, recall (TPR), precision, and f-measure for each of the two classes: >50k and <=50k.

1. Choose one of the following models: ksvm (support vector machine), C5.0 (decision tree), NB (naïve Bayes), KNN (k-nearest neighbors) and glm (logistic regression) to build and evaluate models. 

2. Show the resulting evaluation metrics.

Task 2.

Clustering — Use unemp.csv file to conduct Hierarchical clustering task. Remove the state column and use all of the remaining columns for distance calculation in the clustering task. 

1. Use hierachical to generate clustering results for this data set. 

2. Check the plot of the family of clusters.

3. Select k (i.e. the number of clusters) and determine the cluster id.

4. Check the State name and the Cluster ID.

 5. Choose a different k value and repeat steps 3 and 4 above.

    • 8 years ago
    • 50
    Answer(0)