English 中文(简体)
Python Correlation
  • 时间:2024-11-03

Python - Correlation


Previous Page Next Page  

Correlation refers to some statistical relationships involving dependence between two data sets. Simple examples of dependent phenomena include the correlation between the physical appearance of parents and their offspring, and the correlation between the price for a product and its suppped quantity.

We take example of the iris data set available in seaborn python pbrary. In it we try to estabpsh the correlation between the length and the width of the sepals and petals of three species of iris flower. Based on the correlation found, a strong model could be created which easily distinguishes one species from another.

import matplotpb.pyplot as plt
import seaborn as sns
df = sns.load_dataset( iris )

 
#without regression
sns.pairplot(df, kind="scatter")
plt.show()

Its output is as follows −

corelation.png Advertisements