sega_learn.utils.voting

 
Modules
       
numpy
scipy.stats

 
Classes
       
builtins.object
ForecastRegressor
VotingClassifier
VotingRegressor

 
class ForecastRegressor(builtins.object)
    ForecastRegressor(models, model_weights=None)
 
Implements a forcast voting regressor.
 
Takes a list of fitted models and their weights and returns a weighted average of the predictions.
 
  Methods defined here:
__init__(self, models, model_weights=None)
Initialize the ForecastRegressor object.
 
Args:
    models: list of models to be stacked
    model_weights: list of weights for each model. Default is None.
forecast(self, steps)
Forecast the target variable using the fitted models.
 
Args:
    steps: number of steps to forecast
 
Returns:
    y_pred: predicted target variable
get_params(self)
Get the parameters of the ForecastRegressor object.
 
Returns:
    params: dictionary of parameters
show_models(self, formula=False)
Print the models and their weights.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class VotingClassifier(builtins.object)
    VotingClassifier(estimators, weights=None)
 
Implements a hard voting classifier.
 
Aggregates predictions from multiple fitted classification models based on
majority vote (optionally weighted).
 
  Methods defined here:
__init__(self, estimators, weights=None)
Initialize the VotingClassifier object for hard voting.
 
Args:
    estimators (list): A list of *fitted* classifier objects.
                       Each estimator must have a `predict` method.
    weights (array-like of shape (n_estimators,), optional): Sequence of
        weights (float or int) to weight the occurrences of predicted class
        labels during voting. Uses uniform weights if None. Defaults to None.
get_params(self, deep=True)
Get parameters for this estimator.
 
Args:
    deep (bool, optional): If True, will return the parameters for this
        estimator and contained subobjects that are estimators. (Not fully implemented for deep=True yet).
 
Returns:
    params (dict): Parameter names mapped to their values.
predict(self, X)
Predict class labels for X using hard voting.
 
Args:
    X (array-like of shape (n_samples, n_features)): The input samples.
 
Returns:
    maj (np.ndarray of shape (n_samples,)): Predicted class labels based on majority vote.
show_models(self)
Print the models and their weights.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class VotingRegressor(builtins.object)
    VotingRegressor(models, model_weights=None)
 
Implements a voting regressor.
 
Takes a list of fitted models and their weights and returns a weighted average of the predictions.
 
  Methods defined here:
__init__(self, models, model_weights=None)
Initialize the VotingRegressor object.
 
Args:
    models: list of models to be stacked
    model_weights: list of weights for each model. Default is None.
get_params(self)
Get the parameters of the VotingRegressor object.
 
Returns:
    params: dictionary of parameters
predict(self, X)
Predict the target variable using the fitted models.
 
Args:
    X: input features
 
Returns:
    y_pred: predicted target variable
show_models(self, formula=False)
Print the models and their weights.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object