Python Machine Learning Snippets is my ongoing pet project where I try out different machine learning models. This project contains various machine learning examples as Jupyter notebooks with scikit-learn, statsmodel, numpy and other libraries.
Note: This is an ongoing project and far away from complete.
All the required Python packages can be installed with pipenv
.
pip install --user pipenv
Install all the required packages
$ pipenv install --dev
Note: To run the tests, export the notebooks or more details see BUILD.md
You can start jupyter-lab
to play around with the Juypter notebooks.
pipenv run jupyter-lab
Check which packages have changed.
pipenv update --outdated
This will upgrade everything.
pipenv update
The following machine learning snippets are available as Jupyter Notebook.
- Text classification with naive bayes (scikit-learn)
- Classification with logistic regression (scikit-learn)
- Classification with ridge regression (scikit-learn)
- Classification with stochastic gradient descent (SGD) (scikit-learn)
- Classification with SVM (scikit-learn)
- Classification with k-NN (scikit-learn)
- Classification with decision trees (scikit-learn)
- Classification with random forest (scikit-learn)
- Classification with extra-trees (scikit-learn)
- Classification with bagging (scikit-learn)
- Classification with AdaBoost (boosting) (scikit-learn)
- Classification with gradient boosting (xgboost)
- Classification with a neural network (tensorflow / keras)
- Linear regression with sklearn (OLS) (scikit-learn)
- Linear regression with statsmodels (OLS) (statsmodels)
- Lasso Regression (scikit-learn)
- Ridge Regression (scikit-learn)
- Regression with stochastic gradient descent (scikit-learn)
- Regression with SVM (scikit-learn)
- Regression with k-NN (scikit-learn)
- Regression with decision tree (scikit-learn)
- Regression with random forest (scikit-learn)
- Regression with extra-trees (scikit-learn)
- Regression with bagging (scikit-learn)
- Regression with AdaBoost (boosting) (scikit-learn)
- Regression with gradient boosting (xgboost)
- Regression with a neural network (tensorflow / keras)
- Text clustering basics (scikit-learn)
- Clustering basics and model evaluation (scikit-learn)
- K-means (scikit-learn)
- Agglomerative Clustering (Hierarchical Clustering) (scikit-learn)
- Hierarchical Clustering (SciPy)
- Gaussian Mixture Model (scikit-learn)
- PCA with SVD (scikit-learn)
- PCA with Eigenvector and Correlation Matrix (numpy)
- Hyperparameter optimization with GridSearch (scikit-learn)
- Classification with AutoML (auto-sklearn)
- Regression with AutoML (auto-sklearn)
- Anomaly detection with an Autoencoder (tensorflow / keras)
- Pre-trained model ResNet (tensorflow / keras)
- Example style transfer with a neural net (tensorflow / keras)