Correlation in Machine Learning

Correlation is an indication about the changes between two variables . It can help in predicting one quantity from another. The value of one variable increase then the value of the other variable also increases is called Positive Correlation while the value of one variable increase then the value of the other variable decreases is called Negative Correlation . Sometimes there is No Correlation between variables when the value of one variable increase or decrease then the value of the other variable(s) doesn't increase or decreases.
Correlation in Machine Learning
You can plot correlation matrix to show which variable is having a high or low correlation in respect to another variable.
from numpy.random import randn from matplotlib import pyplot var1 = 10 * randn(1000) + 100 var2 = var1 + (5* randn(1000)) + 50 pyplot.scatter(var1, var2) pyplot.show()
Above code will generate a scatter plot of the two variables (var1, var2) and there is a relationship between the two variables of increasing trend.
scatter plot of correlation