module sklapi.sklearn_base
#
Short summary#
module mlinsights.sklapi.sklearn_base
Implements a learner or a transform which follows the same API as every scikit-learn transform.
Classes#
class |
truncated documentation |
---|---|
Pattern of a learner or a transform which follows the API of scikit-learn. |
Static Methods#
staticmethod |
truncated documentation |
---|---|
Compares two sets of parameters. |
Methods#
method |
truncated documentation |
---|---|
Compares two objects, more precisely, compares the parameters which define the object. |
|
Stores the parameters, see |
|
usual |
|
Trains a model. |
|
Returns the parameters which define the objet, all are needed to clone the object. |
|
Udpates parameters which define the object, all needed to clone the object. |
|
Compares two objects and checks parameters have the same values. |
Documentation#
Implements a learner or a transform which follows the same API as every scikit-learn transform.
- class mlinsights.sklapi.sklearn_base.SkBase(**kwargs)#
Bases:
object
Pattern of a learner or a transform which follows the API of scikit-learn.
Stores the parameters, see
SkLearnParameters
, it keeps a copy of the parameters to easily implements method get_params and clones a model.- __eq__(o)#
Compares two objects, more precisely, compares the parameters which define the object.
- __hash__ = None#
- __init__(**kwargs)#
Stores the parameters, see
SkLearnParameters
, it keeps a copy of the parameters to easily implements method get_params and clones a model.
- __repr__()#
usual
- static compare_params(p1, p2, exc=True)#
Compares two sets of parameters.
- Parameters:
p1 – dictionary
p2 – dictionary
exc – raises an exception if error is met
- Returns:
boolean
- fit(X, y=None, sample_weight=None)#
Trains a model.
- Parameters:
X – features
y – target
sample_weight – weight
- Returns:
self
- get_params(deep=True)#
Returns the parameters which define the objet, all are needed to clone the object.
- Parameters:
deep – unused here
- Returns:
dict
- set_params(**values)#
Udpates parameters which define the object, all needed to clone the object.
- Parameters:
values – values
- Returns:
dictionary
- test_equality(o, exc=True)#
Compares two objects and checks parameters have the same values.
- Parameters:
p1 – dictionary
p2 – dictionary
exc – raises an exception if there is a difference
- Returns:
boolean