Skip to content

Python implementations of standard ML algorithms for classification, models evaluation and preprocessing.

License

Notifications You must be signed in to change notification settings

francescocartelli/machine-learning-put-together

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine Learning Put Together

Python implementations of standard ML algorithms for classification, models evaluation and preprocessing.

Prerequirements

The following packages are used in this project:


Getting Started

From the repo root directory:

  • Get the modules required by launching:
pip install -r ./requirements.txt 
  • Launch one example:
python3 -m examples.iris.iris_gaussian_example

Folder Structure

.  
├── examples                                 # All examples are here  
|   ├── iris                                 # Iris dataset examples
|   |   └── data
|   |
│   └── wines                                # Wines dataset examples
|       └── data
|
├── images                                   # Repo images
|
└── src                                      # Source code directory
    ├── classifiers                          # Classifiers
    │   
    ├── graphs                               # Graphs
    │ 
    ├── measuring_predictions                # Prediction exaluation
    │  
    ├── plotting                             # Plotting
    │  
    ├── preprocessing                        # Preprocessing
    │  
    └── utils.py  

Graphs

Useful tools to automate training and evalutation on multiple classifiers, preprocessing techinques and results elaboration.
Graphs allow to display the internal structure of their nodes with display method.
See the a complete iris example here.


Classifiers

  • Gaussian classifiers:
    • Multivariate Gaussian classifier
    • Naive Bayes Gaussian classifier
    • Tied Covariance Gaussian classifier
  • Logistic Regression
  • Support Vector Machine
    • Linear SVM
    • Quadratic Kernel SVM
    • Radial Basis Kernel SVM
  • Gaussian Mixture Model

Usage

Training data is in the form of a matrix NxM (each row is an attribute, each column is a training sample). Labels are in the form of a numpy vector.

Invoke the classifier "train" method for training the model and setting the learning parameters. Invoke the classifier "transform" method with the evaluation data set as parameter to compute the evaluation score
(in the the form of log-likelihood, log-likelihood-ratio or others) for the models.

Use the returned evaluation score to compute the prediction.


Examples

Available here, divided by dataset:

Dataset at https://archive.ics.uci.edu/ml/datasets/iris.

  • Gaussian classifiers examples: Standard and graphs application of Gaussian classifiers.
  • Gaussian Mixture Model examples: Standard and graphs application of GMM classifiers.
  • Logistic Regression examples: Standard and graphs application of logistic regression classifiers (2 classes split).
  • Support Vector Machine examples: Standard and graphs application of SVM classifier (2 classes split).
  • Wines graph examples: Model ensable for all the models (MVG, SVM Poly, SVM RBF and GMM) recalibrated by Logistic Regression with graph application.

Author

About

Python implementations of standard ML algorithms for classification, models evaluation and preprocessing.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages