veloxml.base package

Submodules

veloxml.base.classification_base module

class veloxml.base.classification_base.ClassificationBase(model)[source]

Bases: EstimatorBase

Base class for classification models.

This class provides a foundation for classification models, extending EstimatorBase. It defines common functionality for fitting a model to training data and making predictions, including probability-based predictions.

model

The underlying classification model instance.

Type:

object

fit(X, Y)[source]

Trains the model using the given input data and target values.

predict(X)[source]

Predicts class labels based on the given input data.

predict_proba(X, Y)[source]

Predicts class probabilities for the given input data.

Initializes the classification base class with a given model.

Parameters:

model (object) – The classification model instance to be used.

__init__(model)[source]

Initializes the classification base class with a given model.

Parameters:

model (object) – The classification model instance to be used.

fit(X, Y)[source]

Trains the classification model using the given input data and target values.

Parameters:
  • X (array-like) – The input features used for training.

  • Y (array-like) – The target class labels corresponding to X.

Returns:

The instance itself after fitting the model.

Return type:

ClassificationBase

predict(X)[source]

Predicts class labels based on the given input data.

Parameters:

X (array-like) – The input features for making predictions.

Returns:

The predicted class labels.

Return type:

array-like

predict_proba(X, Y)[source]

Predicts class probabilities for the given input data.

Parameters:
  • X (array-like) – The input features for making probability predictions.

  • Y (array-like) – The target class labels (this argument may not be necessary, depending on the implementation of the underlying model).

Returns:

The predicted class probabilities.

Return type:

array-like

veloxml.base.estimator_base module

class veloxml.base.estimator_base.EstimatorBase(model)[source]

Bases: ABC

Abstract base class for all estimators.

This class defines a common interface for all estimators, enforcing the implementation of fit and predict methods in derived classes.

model

The underlying model instance used for estimation.

Type:

object

fit(X, Y)[source]

Abstract method for training the model with input data X and target values Y. Must be implemented in subclasses.

predict(X)[source]

Abstract method for making predictions based on input data X. Must be implemented in subclasses.

Initializes the estimator with a given model.

Parameters:

model (object) – The model instance to be used for estimation.

__init__(model)[source]

Initializes the estimator with a given model.

Parameters:

model (object) – The model instance to be used for estimation.

abstractmethod fit(X, Y)[source]

Trains the model using the given input data and target values.

Parameters:
  • X (array-like) – The input features used for training.

  • Y (array-like) – The target values corresponding to X.

Raises:

NotImplementedError – This method must be implemented in a subclass.

abstractmethod predict(X)[source]

Predicts target values based on the given input data.

Parameters:

X (array-like) – The input features for making predictions.

Returns:

The predicted target values.

Return type:

array-like

Raises:

NotImplementedError – This method must be implemented in a subclass.

veloxml.base.regression_base module

class veloxml.base.regression_base.RegressionBase(model)[source]

Bases: EstimatorBase

Base class for regression models.

This class provides a foundation for regression models, extending EstimatorBase. It defines common functionality for fitting a model to training data and making predictions.

model

The underlying regression model instance.

Type:

object

fit(X, Y)[source]

Trains the model using the given input data and target values.

predict(X)[source]

Predicts target values based on the given input data.

Initializes the regression base class with a given model.

Parameters:

model (object) – The regression model instance to be used.

__init__(model)[source]

Initializes the regression base class with a given model.

Parameters:

model (object) – The regression model instance to be used.

fit(X, Y)[source]

Trains the regression model using the given input data and target values.

Parameters:
  • X (array-like) – The input features used for training.

  • Y (array-like) – The target values corresponding to X.

Returns:

The instance itself after fitting the model.

Return type:

RegressionBase

predict(X)[source]

Predicts target values based on the given input data.

Parameters:

X (array-like) – The input features for making predictions.

Returns:

The predicted target values.

Return type:

array-like

veloxml.base.unsupervised_base module

class veloxml.base.unsupervised_base.UnsupervisedEstimatorBase(model)[source]

Bases: EstimatorBase

Base class for unsupervised learning models.

This class provides a foundation for unsupervised learning models, extending EstimatorBase. It defines common functionality such as fitting the model, making predictions, and transforming data.

model

The underlying unsupervised learning model instance.

Type:

object

fit(X, Y=None)[source]

Trains the model using the given input data.

predict(X, Y=None)[source]

Predicts cluster labels or other outputs depending on the model type.

transform(X)[source]

Transforms the input data into a different representation (e.g., dimensionality reduction).

fit_predict(X)[source]

Fits the model to the data and returns predictions.

fit_transform(X)[source]

Fits the model to the data and transforms it.

Initializes the unsupervised learning base class with a given model.

Parameters:

model (object) – The unsupervised learning model instance to be used.

__init__(model)[source]

Initializes the unsupervised learning base class with a given model.

Parameters:

model (object) – The unsupervised learning model instance to be used.

fit(X, Y=None)[source]

Trains the unsupervised learning model using the given input data.

Parameters:
  • X (array-like) – The input features used for training.

  • Y (array-like, optional) – Unused parameter included for compatibility.

Returns:

The instance itself after fitting the model.

Return type:

UnsupervisedEstimatorBase

fit_predict(X)[source]

Fits the model to the data and then returns predictions.

This is commonly used in clustering models.

Parameters:

X (array-like) – The input data.

Returns:

The predicted labels or other outputs after fitting the model.

Return type:

array-like

fit_transform(X)[source]

Fits the model to the data and then transforms it.

This is commonly used in dimensionality reduction techniques.

Parameters:

X (array-like) – The input data.

Returns:

The transformed representation of the input data.

Return type:

array-like

predict(X, Y=None)[source]

Predicts outputs based on the given input data.

In clustering models, this typically returns cluster labels.

Parameters:
  • X (array-like) – The input features for making predictions.

  • Y (array-like, optional) – Unused parameter included for compatibility.

Returns:

The predicted labels or other outputs.

Return type:

array-like

transform(X)[source]

Transforms the input data into a different representation.

Used in dimensionality reduction and feature extraction techniques.

Parameters:

X (array-like) – The input data to transform.

Returns:

The transformed representation of the input data.

Return type:

array-like

Module contents