machinelens.core package#

Subpackages#

Submodules#

machinelens.core.model_interface module#

Core model interface module for the MachineLens library.

class machinelens.core.model_interface.ModelInterface(model: BaseEstimator, X_train: DataFrame | Series | None = None, X_test: DataFrame | Series | None = None, y_train: ndarray | Series | None = None, y_test: ndarray | Series | None = None, y_pred: ndarray | Series | None = None)[source]#

Bases: object

Encapsulate model data and provide validation utilities.

This class standardizes how the MachineLens library interacts with scikit-learn compatible models. It wraps a fitted estimator alongside its training/test splits and predictions, automatically validating inputs and classifying the model’s task type and algorithm family.

model#

The wrapped scikit-learn estimator.

Type:

BaseEstimator

X_train#

Training feature matrix.

Type:

PandasLike or None

X_test#

Test feature matrix.

Type:

PandasLike or None

y_train#

Training target values.

Type:

ArrayLike or None

y_test#

Test target values (ground truth).

Type:

ArrayLike or None

y_pred#

Model predictions on the test set.

Type:

ArrayLike or None

problem_type#

Detected problem type: "classification", "regression", "clustering", or "unknown".

Type:

str

results#

Dictionary with model metadata and analysis results.

Type:

ModelResults

problem_type: str#
results: Dict[str, str | Dict[str, Any]]#

Module contents#

Core model wrapping interface subpackage for MachineLens.

class machinelens.core.ModelInterface(model: BaseEstimator, X_train: DataFrame | Series | None = None, X_test: DataFrame | Series | None = None, y_train: ndarray | Series | None = None, y_test: ndarray | Series | None = None, y_pred: ndarray | Series | None = None)[source]#

Bases: object

Encapsulate model data and provide validation utilities.

This class standardizes how the MachineLens library interacts with scikit-learn compatible models. It wraps a fitted estimator alongside its training/test splits and predictions, automatically validating inputs and classifying the model’s task type and algorithm family.

model#

The wrapped scikit-learn estimator.

Type:

BaseEstimator

X_train#

Training feature matrix.

Type:

PandasLike or None

X_test#

Test feature matrix.

Type:

PandasLike or None

y_train#

Training target values.

Type:

ArrayLike or None

y_test#

Test target values (ground truth).

Type:

ArrayLike or None

y_pred#

Model predictions on the test set.

Type:

ArrayLike or None

problem_type#

Detected problem type: "classification", "regression", "clustering", or "unknown".

Type:

str

results#

Dictionary with model metadata and analysis results.

Type:

ModelResults

problem_type: str#
results: Dict[str, str | Dict[str, Any]]#