module 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.
Classes#
class |
truncated documentation |
---|---|
Pattern of a learner qui suit la même API que scikit-learn. |
Methods#
method |
truncated documentation |
---|---|
constructor |
|
Output of the model in case of a regressor, matrix with a score for each class and each sample for a classifier. … |
|
Trains a model. |
|
Predicts. |
|
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.
- class mlinsights.sklapi.sklearn_base_learner.SkBaseLearner(**kwargs)#
Bases:
SkBase
Pattern of a learner qui suit la même API que scikit-learn.
constructor
- __init__(**kwargs)#
constructor
- 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.
- fit(X, y=None, sample_weight=None)#
Trains a model.
- Parameters:
X – features
y – targets
sample_weight – weight
- Returns:
self
- predict(X)#
Predicts.
- Parameters:
X – features
- Returns:
prédictions
- 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.