Predictors¶
Single predictors¶
Extreme Learning Machine¶
Also known as single-hidden-layer version of Extreme Learning Machine. Weights for neurons in the hidden layer are chosen randomly.
-
class
pyridge.neural.
ELM
(classification: bool = True, logging: bool = True)[source]¶ Neural Ridge classifier, also known as Extreme Learning Machine. It works as a single hidden layer neural network where neuron’s weights are chosen randomly.
-
fit
(train_data, train_target, parameter)[source]¶ Use some train (data and target) and parameter to fit the classifier and construct the rules.
- Parameters
train_data (numpy.array) – data with features.
train_target (numpy.array) – targets in j codification.
parameter (dict) –
-
PCA ELM¶
PCA LDA ELM¶
Sobol ELM¶
Parallel Layer ELM¶
Kernel ELM¶
Kernel version of Extreme Learning Machine.
-
class
pyridge.kernel.
KernelELM
(classification: bool = True, logging: bool = True)[source]¶ Kernel ELM classifier.
Artificial Neural Network¶
-
class
pyridge.neural.nn.
NeuralNetwork
(classification: bool = True, logging: bool = True)[source]¶ Simple Neural Network with one hidden layer.
-
backpropagation
(penalty=None)[source]¶ Adjust the weights after the prediction using all data.
- Parameters
penalty – for NC.
-
fit
(train_data, train_target, parameter)[source]¶ Train the neural network with gradient descent.
- Parameters
train_data – numpy.array with data (instances and features).
train_target – numpy.array with the target to predict.
parameter (dict) – keys - max_iter: number of iterations for training. - neurons: number of neurons in the hidden layer. - learning_rate: step to add in each iteration.
-
get_dE_dW
(grad_output, hidden_layer, grad_hidden, data)[source]¶ Compute de derivate of the Error respect to the weights.
- Parameters
grad_output –
hidden_layer –
grad_hidden –
data –
- Returns
-
initial
(train_data, train_target, parameter)[source]¶ Instance parameters and initial layer.
- Parameters
train_data –
train_target –
parameter –
- Returns
-
Neural Network Ensembles¶
AdaBoost ELM¶
AdaBoost meta-algorithm with ELM as base learner.
-
class
pyridge.neural.
AdaBoostELM
(classification: bool = True)[source]¶ AdaBoost meta-algorithm applied to Neural ELM.
-
adaboost_weight
(h_matrix, f_pred, s)[source]¶ - Parameters
h_matrix –
f_pred –
s –
- Returns
error vector
-
fit
(train_data, train_target, parameter)[source]¶ Add array of weights and call super.
- Parameters
train_data –
train_target –
parameter –
- Returns
-
fit_step
(h_matrix, s: int, y_mu=None)[source]¶ Each step of the fit process.
- Parameters
h_matrix –
s (int) – element of the ensemble.
y_mu –
- Returns
-
get_indicator
(test_data)[source]¶ Once instanced, classifier can predict test target from test data, using some mathematical rules. Valid for other ensembles.
- Parameters
test_data (numpy.array) – array like.
- Returns
f(X) vector.
-
positiveness
¶ alias of
builtins.float
-
Bagging ELM¶
Bagging implementation with ELM as base learner.
-
class
pyridge.neural.
BaggingELM
(classification: bool = True, logging: bool = True)[source]¶ Bagging implementation for Neural Extreme Learning Machine.
-
fit
(train_data, train_target, parameter)[source]¶ Use some train (data and target) and parameter to fit the classifier and construct the rules.
- Parameters
train_data (numpy.array) – data with features.
train_target (numpy.array) – targets in j codification.
parameter (dict) –
-
Boosting Ridge ELM¶
Boosting Ridge with ELM as base learner.
-
class
pyridge.neural.
BoostingRidgeELM
(classification: bool = True, logging: bool = True)[source]¶ Boosting Ridge ensemble applied to Neural ELM.
-
fit
(train_data, train_target, parameter)[source]¶ Use some train (data and target) and parameter to fit the classifier and construct the rules.
- Parameters
train_data (numpy.array) – data with features.
train_target (numpy.array) – targets in j codification.
parameter (dict) –
-
AdaBoost Negative Correlation ELM¶
Xin Yao et al. implementation of Negative Correlation and Adaboost.
Diverse ELM¶
Ensemble proposed by Perales et al (2018).
Regularized Ensemble ELM (REELM)¶
Ensemble proposed by Perales et al (2019).
Negative Correlation Ensembles¶
Negative Correlation ELM¶
Ensemble proposed by Perales et al (2020).
-
class
pyridge.negcor.nc_elm.
NegativeCorrelationELM
(classification: bool = True, logging: bool = True)[source]¶ Iterative Negative Correlation with Sherman-Morrison, updated.
Negative Correlation Neural Network¶
-
class
pyridge.negcor.nc_nn.
NegativeCorrelationNN
(classification: bool = True, logging: bool = True)[source]¶ Negative Correlation for Artificial Neural Networks.
It does not inherit from NeuralNetwork because it uses a list for store several of these predictors.
-
fit
(train_data, train_target, parameter)[source]¶ Train several neural networks and update them with a negative correlation penalty.
- Parameters
train_data – numpy.array with data (instances and features).
train_target – numpy.array with the target to predict.
parameter (dict) – keys - max_iter: number of iterations for training. - hidden_neurons: number of neurons in the hidden layer. - learning_rate: step to add in each iteration. - lambda_: coefficient for negative correlation penalty.
-