estimators

class EstimatorWrapper[source]

This is a wrapper class that can be inherited to conform any estimator to the fit/predict interface

fit(X, y, **kwargs)[source]

Train the estimator

Parameters:
  • X – features

  • y – ground truth labels

  • kwargs (optional) – kwargs for use in training

predict(X, **kwargs)[source]

Get predictions from the estimator

Parameters:
  • X – features

  • kwargs (optional) – kwargs for use in predicting

class PyTorchEstimatorWrapper(estimator, optimizer_generator, loss_fn, fit_fn=None, predict_fn=None)[source]
__init__(estimator, optimizer_generator, loss_fn, fit_fn=None, predict_fn=None)[source]

Create a wrapper for a PyTorch estimator

Parameters:
  • estimator – PyTorch estimator instance

  • optimizer_generator – generator function for the optimizer

  • loss_fn – loss function

  • fit_fn (optional) – custom fit function to be called instead of default one

  • predict_fn (optional) – custom predict function to be called instead of default one

Returns:

self

fit(X, y, **kwargs)[source]

Train the estimator

Parameters:
  • X – features

  • y – ground truth labels

  • kwargs (optional) – kwargs for use in training

Returns:

self

predict(X, **kwargs)[source]

Get predictions from the estimator

Parameters:
  • X – features

  • kwargs (optional) – kwargs for use in predicting

Returns:

self

class SciKitLearnEstimatorWrapper(estimator)[source]
__init__(estimator)[source]

Create a wrapper for a Scikit-Learn estimator

Parameters:

estimator – Scikit-Learn estimator instance

Returns:

self

fit(X, y, **kwargs)[source]

Train the estimator

Parameters:
  • X – features

  • y – ground truth labels

  • kwargs (optional) – kwargs for use in training

Returns:

self

predict(X, **kwargs)[source]

Get predictions from the estimator

Parameters:
  • X – features

  • kwargs (optional) – kwargs for use in predicting

Returns:

self

class TensorFlowEstimatorWrapper(estimator)[source]
__init__(estimator)[source]

Create a wrapper for a TensorFlow estimator

Parameters:

estimator – TensorFlow estimator instance

Returns:

self

fit(X, y, **kwargs)[source]

Train the estimator

Parameters:
  • X – features

  • y – ground truth labels

  • kwargs (optional) – kwargs for use in training

Returns:

self

predict(X, **kwargs)[source]

Get predictions from the estimator

Parameters:
  • X – features

  • kwargs (optional) – kwargs for use in predicting

Returns:

self