Skip to content

Linear classifier using logistic regression with only 2 features for MNIST Database.

Notifications You must be signed in to change notification settings

Luisrosario2604/Pattern-recognition-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pattern recognition (Part 1/4)

👨‍🎓 This project was carried out during my master's degree in computer vision at URJC - Madrid

The objective of this project is to construct a linear classifier using logistic regression.

The goal is to separate MNIST images representing the numbers 3 and 7.

To do so, only two features (extracted from the images or obtained by feature engineering) will be constructed.

These two single features will then be used to train the classifier.

Goals

  • Construct a linear classifier with only 2 features
  • Find the features that will best separate the two types of images
  • Have model score (accuracy) >= 0.9

Requirements

  • Python 3.9+

  • matplotlib ~= 3.3.4

  • numpy ~= 1.21.3

  • pandas ~= 1.4.2

  • scikit_learn ~= 1.1.1

How to install all the requirements :

pip3 install -r requirements.txt

Usage

Execute only from project directory

python ./src/main.py

Structure

.
├── datasets
│        ├── 1000_siete.csv
│        ├── 1000_tres.csv
│        └── reto1_X.csv
├── imgs
│        ├── Figure_1.png
│        ├── Figure_2.png
│        └── Figure_3.png
├── model
│        └── trained_model.sav
├── predictions
│        └── Reto1_Ypred.csv
├── README.md
├── requirements.txt
├── Reto1_2021.pdf
└── src
    └── main.py

Examples

These are some examples of the MNIST database

MNIST

These are the 2 features selected

2 features

These are some results of the model (score = 0.9525)

Result

Authors

About

Linear classifier using logistic regression with only 2 features for MNIST Database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages