Skip to main content

Posts

Showing posts from December, 2023

Find the correlation matrix using python on Iris Dataset

 Q. Find the correlation matrix Correlation: Correlation is Statistical Measure which finds the extent to which two or more variable related with each other.  or  Correlation is a statistical measure that describes the degree to which two variables change together. correlation is denoted by 'r' Type of Correlations: Positive Correlation(r>0) : If the value of one variable increases then value of another variable also increases Negative Correlation(r<0) :If the value of one variable increases then value of another variable decreases  No Correlation(r=0) :There is no any linear relationship between the  two variables. Program using Python Import Libraries: import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns Read CSV File: Download csv file Iris Dataset  then use pd.read_csv() function df=pd.read_csv('/Iris.csv') df Id SepalLengthCm