module sklapi.sklearn_base

Inheritance diagram of mlinsights.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.

source on GitHub

Classes

class

truncated documentation

SkBase

Pattern of a learner or a transform which follows the API of scikit-learn.

Static Methods

staticmethod

truncated documentation

compare_params

Compares two sets of parameters.

Methods

method

truncated documentation

__eq__

Compares two objects, more precisely, compares the parameters which define the object.

__init__

Stores the parameters, see SkLearnParameters, it keeps a copy of the parameters to easily implements …

__repr__

usual

fit

Trains a model.

get_params

Returns the parameters which define the objet, all are needed to clone the object.

set_params

Udpates parameters which define the object, all needed to clone the object.

test_equality

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.

source on GitHub

class mlinsights.sklapi.sklearn_base.SkBase(**kwargs)[source]

Bases: object

Pattern of a learner or a transform which follows the API of scikit-learn.

source on GitHub

Stores the parameters, see SkLearnParameters, it keeps a copy of the parameters to easily implements method get_params and clones a model.

source on GitHub

__eq__(o)[source]

Compares two objects, more precisely, compares the parameters which define the object.

source on GitHub

__hash__ = None
__init__(**kwargs)[source]

Stores the parameters, see SkLearnParameters, it keeps a copy of the parameters to easily implements method get_params and clones a model.

source on GitHub

__repr__()[source]

usual

source on GitHub

static compare_params(p1, p2, exc=True)[source]

Compares two sets of parameters.

Parameters
  • p1 – dictionary

  • p2 – dictionary

  • exc – raises an exception if error is met

Returns

boolean

source on GitHub

fit(X, y=None, sample_weight=None)[source]

Trains a model.

Parameters
  • X – features

  • y – target

  • sample_weight – weight

Returns

self

source on GitHub

get_params(deep=True)[source]

Returns the parameters which define the objet, all are needed to clone the object.

Parameters

deep – unused here

Returns

dict

source on GitHub

set_params(**values)[source]

Udpates parameters which define the object, all needed to clone the object.

Parameters

values – values

Returns

dictionary

source on GitHub

test_equality(o, exc=True)[source]

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

source on GitHub