开始使用免费开始使用

Correlated variables

In this exercise, you will inspect the dataset with respect to correlated variables. It is important to remove them before applying a binary classifier, especially in the case of logistic regression. When two or more variables are highly correlated you should remove all except for one.

First, we will use the corrplot() function in the corrplot package to visualize the correlations. In the correlation plot, blue represents a positive correlation and red a negative correlation. A darker color indicates a higher correlation. Finally, you will remove the highly correlated variables from the data set.

本练习是课程的一部分

Predictive Analytics using Networked Data in R

查看课程

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Remove the Future column from studentnetworkdata 
no_future <- ___

# Load the corrplot package
library(___)

# Generate the correlation matrix
M <- ___(no_future)

# Plot the correlations
___(M, method = "circle")
编辑并运行代码