Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Homemade Machine Learning in Python

DZone 's Guide to

Homemade Machine Learning in Python

When it comes to Jupyter Notebook demos, libraries such as Matplotlib and Plotly are being used for data visualizations.

· AI Zone ·
Free Resource

I’ve recently launched Homemade Machine Learning repository that contains examples of popular Machine Learning algorithms and approaches (like linear/logistic regressions, K-Means clustering, neural networks) implemented in Python with mathematics behind them being explained. Each algorithm has an interactive Jupyter Notebook demo that allows you to play with training data and algorithms configurations and immediately see the results, charts, and predictions right in your browser. In most cases, the explanations are based on this great Machine Learning course by Andrew Ng.

The purpose of the repository was not to implement Machine Learning algorithms by using 3rd-party library “one-liners” but rather to practice implementing these algorithms from scratch and get a better understanding of the mathematics behind each algorithm. That’s why all algorithms implementations are called “homemade.”

The main Python libraries that are used there are NumPy and Pandas. These two are used for efficient matrix operations and for loading/parsing CSV datasets. When it comes to Jupyter Notebook demos, libraries such as Matplotlib and Plotly are being used for data visualizations.

Currently, the following topics have been covered:

Regression: Linear Regression

In regression problems, we do real value predictions. Basically, we try to draw a line/plane/n-dimensional plane along the training examples.

Usage examples: stock price forecast, sales analysis, dependency of any number, etc.

Classification: Logistic Regression

In classification problems, we split input examples by certain characteristic.

Usage examples: spam-filters, language detection, finding similar documents, handwritten letters recognition, etc.

Clustering: K-Means Algorithm

In clustering problems, we split the training examples by unknown characteristics. The algorithm itself decides what characteristic to use for splitting.

Usage examples: market segmentation, social networks analysis, organize computing clusters, astronomical data analysis, image compression, etc.

Neural Networks: Multilayer Perceptron (MLP)

The neural network itself isn’t an algorithm, but rather a framework for many different Machine Learning algorithms to work together and process complex data inputs.

Usage examples: as a substitute of all other algorithms in general, image recognition, voice recognition, image processing (applying a specific style), language translation, etc.

Anomaly Detection: Gaussian Distribution

Anomaly detection (also outlier detection) is the identification of rare items, events or observations which raise suspicions by differing significantly from the majority of the data.

Usage examples: intrusion detection, fraud detection, system health monitoring, removing anomalous data from the dataset etc.

I hope you’ll find the repository useful. Either by playing with demos or by reading the math sections or by simply exploring the source code. Happy coding!

Topics:
artifical intelligence ,python ,jupyter notebook ,machine learning algorithms ,clustering ,k-means algorithm ,neural networks

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}