Regression
Module for regression tasks. Regression tasks aim to obtain the equation for a set of data and use that equation in order to predict values.
- class mapyl.regression.LinearRegressor[source]
Linear Regressor instance
- class mapyl.regression.GradientDescent(lr)[source]
Linear Gradient Descent regressor
- Parameter:
lr(float): The learning rate
- class mapyl.regression.SGD[source]
Stochastic Gradient descent instance
- class mapyl.regression.PolyRegressor(degree=2)[source]
Polynomial Regressor instance, uses the degree of the data
Warning
The PolyRegressor instance does a polynomial expansion in order to work, so if there are too many degrees or too many features you can have overflow
- class mapyl.regression.BinLogitRegressor(lr=0.01)[source]
Binary Logistic Regressor instance
- Parameter:
lr(int): float of the learning rate. Defaults to 0.01
- fit(X, y, iters=500)[source]
Fits the instance
- Parameters:
X (ndarray): ndarray of shape (num_samples, num_features) of the input
y (ndarray): ndarray of shape (num_samples,) of the output
iters (int): The number of iterations. Defaults to 500
Returns none
Note
The float returned by predict_prob represents the probability of the supplied instance being 1 or 0, a probability larger than 0.5 means that it belongs to 1 and a probability less than 0.5 means that it belongs to 0.