Uploading source code for chapter 13 (ML)

This commit is contained in:
muassif
2021-08-11 17:30:39 +04:00
committed by GitHub
parent ab204b305a
commit 4159ea8b58
10 changed files with 404 additions and 0 deletions
@@ -0,0 +1,25 @@
#iris_data_analysis.py
from pandas import read_csv
from matplotlib import pyplot
from pandas.plotting import scatter_matrix
data_file = "iris/iris.data"
iris_names = ['sepal-length', 'sepal-width', 'petal-length', 'petal-width', 'class']
df = read_csv(data_file, names=iris_names)
print(df.shape)
print(df.head(20))
print(df.describe())
print(df.groupby('class').size())
# box and whisker plots
df.plot(kind='box', subplots=True, layout=(2,2), sharex=False, sharey=False)
pyplot.show()
# check the histograms
df.hist()
pyplot.show()
# scatter plot matrix
scatter_matrix(df)
pyplot.show()