Build a simple logistic regression model from scratch and test it with a binary classification task. The key idea is to generalize the linear regression result to a classification model by finding a link function
One way to do so is to find a smooth and well-shaped function that maps
Three functions that are required to build:
- A predict function (Applying sigmoid)
- A cost function (To evaluate the result of the predict function)
- A gradient descent alogrithm (To improve the weight)
Iris dataset: https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html
Achieved an accuracy of 1.0
The model works well on a simple binary classification task. It is sensible to test on a more complicatd dataset and extend it to a multi-class classificaiton model. More features such as regularisation and feature scaling can be added.
- Python 3.9
- NumPy
- Pandas
- Scikit-learn
- Matplotlib
- Jupyter Notebook