In this repository, a linear regression model is built with numpy, matplotlib and pandas to classify four features of Iris Plants. The attribute information is as below:
- sepal length in cm
- sepal width in cm
- petal length in cm
- petal width in cm
- class: -- Iris Setosa -- Iris Versicolour -- Iris Virginica
Two of classes are chosen to be classified: Iris_setosa and Iris_versicolor
Numpy, Matplotlib andPandas
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
- Load the database
df = pd.read_csv('iris.data', header=None)
- extract data of four features
- Divide the database to train and test data with 1 or -1 label
- Calculate the accuracy percentage before the nodel is trained
- Train the model with function PercentCorrect
- Calculate the accuracy percentage after the nodel is trained
This is still under construction. More features will be presented in the near feature.
1.Accuracy: train 100%, test 96%
2.Learning curve
http://archive.ics.uci.edu/ml/datasets/Iris
Note that the kit is still under construction. Pull requests are welcome. For major changes, please contact me via the mail [email protected]