Python, NumPy and Matplotlib implementation from scratch of machine learning algorithms used for classification.
The training set with N elements is defined as D={(X1, y1), . . ., (XN, yN)}, where X is a vector and y={0, 1} is one-hot encoded.
Sample code at the end of each file.
The Neural_Network_Derivatives.pdf document contains calculation of the derivatives used in code, except for the logistic regression that uses Yaoliang Yu lecture notes - see reference.
autoencoder: Autoencoder with sigmoid activation function in 2nd and 4th layers.
cnn: Flexible architecture of Convolutional Neural Network, with sigmoid and relu activation functions. Setup the number of layers:
- Convolution layer.
- Pooling layer.
- Full connected layer.
Note: code translated from Matlab to Python. Original code in https://github.com/ClodoaldoLima/Convolutional-Neural-Networks---Matlab
ensemble: Implementation of three ensemble methods of neural networks:
- Ensemble learing via negative correlation.
- Ensemble Learning Using Decorrelated Neural Networks.
- Creating Diversity In Ensembles Using Artiflcial Data (DECORATE).
mixture of experts: Two setups of mixture of experts for time series:
- Linear models for experts and gating with softmax output.
- Linear models for experts and gating with normalized gaussian output.
neuralnets: Single Layer Perceptron (SLP) and Multi Layer Perceptron (MLP).
optimization: first and second order methods used in machine learning backpropagation. Methods available:
- Gradient Descent.
- Bisection.
- Newton.
- Modified Newton.
- Levenberg-Marquardt.
- Quasi-Newton Methods.
- One Step Secant.
- Conjugate Gradient Methods.
regression: implementation of three setups of regression for classification:
- Linear regression.
- Linear regression with regularization.
- Logistic regression.
svm: implementation of three models of Support Vector Machines for binary and multi-class classification.
- Traditional Support Vector Machines (SVM).
- Least Squares Support Vector Machines (LSSVM).
- Twin Support Vector Machines (TWSVM).
Kernel types:
- Linear
- Polynomial
- Radial Base Function (RBF)
- Exponential Radial Base Function (ERBF)
- Hyperbolic tangent (tanh)
- Linear splines
I would like to acknowledge professor Clodoaldo A. Moraes Lima for his guidance and support during the machine learning course at Universidade de Sao Paulo.