Skip to content

Python logistic regression (using a perceptron) classifier to recognize cats.

Notifications You must be signed in to change notification settings

arayajosepablo/math-logistic-regression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Math implementation of logistic regression

Python logistic regression (using a perceptron) classifier to recognize cats.

Perceptron image

Math formulas for logistic regression

Installation

  • pip:
pip3 install -r requirements.txt

or

  • pipenv:
pipenv install

How to run it

If you're not using pipenv

python3 src/logistic_regression.py

If you're using pipenv

pipenv run python src/logistic_regression.py

How to test it with a new image

Add your own image in the folder images, then go to line 243 in src/logistic_regression.py and replace my_image_1.jpg by the name and its extension of the new image, finally run the application again.

Note

Test accuracy is 70% which is OK for a simple model like this. It uses a small dataset, and not tuning actions were performed over the hyperparameters.

Releases

No releases published

Packages

No packages published

Languages