module sklapi.sklearn_base_learner#

Inheritance diagram of mlinsights.sklapi.sklearn_base_learner

Short summary#

module mlinsights.sklapi.sklearn_base_learner

Implements a learner which follows the same API as every scikit-learn learner.

source on GitHub

Classes#

class

truncated documentation

SkBaseLearner

Pattern of a learner qui suit la même API que scikit-learn.

Methods#

method

truncated documentation

__init__

constructor

decision_function

Output of the model in case of a regressor, matrix with a score for each class and each sample for a classifier. …

fit

Trains a model.

predict

Predicts.

score

Returns the mean accuracy on the given test data and labels.

Documentation#

Implements a learner which follows the same API as every scikit-learn learner.

source on GitHub

class mlinsights.sklapi.sklearn_base_learner.SkBaseLearner(**kwargs)#

Bases: SkBase

Pattern of a learner qui suit la même API que scikit-learn.

source on GitHub

constructor

source on GitHub

__init__(**kwargs)#

constructor

source on GitHub

decision_function(X)#

Output of the model in case of a regressor, matrix with a score for each class and each sample for a classifier.

Parameters:

X – Samples, {array-like, sparse matrix}, shape = (n_samples, n_features)

Returns:

array, shape = (n_samples,.), Returns predicted values.

source on GitHub

fit(X, y=None, sample_weight=None)#

Trains a model.

Parameters:
  • X – features

  • y – targets

  • sample_weight – weight

Returns:

self

source on GitHub

predict(X)#

Predicts.

Parameters:

X – features

Returns:

prédictions

source on GitHub

score(X, y=None, sample_weight=None)#

Returns the mean accuracy on the given test data and labels.

Parameters:
  • X – Training data, numpy array or sparse matrix of shape [n_samples,n_features]

  • y – Target values, numpy array of shape [n_samples, n_targets] (optional)

  • sample_weight – Weight values, numpy array of shape [n_samples, n_targets] (optional)

Returns:

score : float, Mean accuracy of self.predict(X) wrt. y.

source on GitHub