Module for pailab to sklearn

This module defines all necessary objects and functions to use sklearn from within pailab.

class SKLearnModel(*args, **kwargs)

Class to store all sklearn models in pailab’s MLRepo

class SKLearnModelParam(*args, **kwargs)

Interfaces the parameters of the sklearn algorithms

class SKLearnPreprocessingParam(*args, **kwargs)

Interfaces the parameters of the sklearn algorithms

class SKLearnPreprocessor(*args, **kwargs)

Class to store all sklearn preprocessor

add_model(repo, skl_learner, model_name=None, model_param=None, preprocessors=None)

Adds a new sklearn model to a pailab MLRepo

  • repo ([type]) – [description]
  • skl_learner ([type]) – [description]
  • model_name ([type], optional) – Defaults to None. [description]
  • model_param ([type], optional) – Defaults to None. [description]
  • preprocessors (list of strings, optional) – List of used preprocessors
add_preprocessor(repo, skl_preprocessor, preprocessor_name=None, preprocessor_param=None, columns=None, output_columns=None)

Adds a new sklearn preprocessor to a pailab MLRepo

  • repo (MLRepo) – MLRepo to which preprocessor will be added
  • preprocessor (obj) – An object to the sklearn preprocessor class.
  • preprocessor_name (str, optional) – Name of the preprocessor in repo. If None, a default name will be generated. Defaults to None.
  • preprocessor_param (dict, optional) – Dictionary of parameters for the SKLearn preprocessor. Ths elements will be used to overwrite the parameters in the given preprocessor object. Defaults to None.
  • columns (list(str)) – List of string defining the columns the preprocessor will be applied to. If None, all columns are used. Defaults to None.
  • output_columns (list(str)) – List of names for the output columns. If preprocesor has method get_feature_names, this list is not necessary.
eval_sklearn(model, data)

Function to evaluate an sklearn model

  • model ([type]) – [description]
  • data ([type]) – [description]


Return type:



add_model(repo, tensorflow_keras_model, model_name, loss, epochs, batch_size, optimizer='ADAM', optimizer_param={}, tensorboard_log_dir=None, validation_split=0.0)

Adds a new tensorflow-keras model to a pailab MLRepo

:param : param repo (MLRepo): ml repo :param : param tensorflow_keras_model (keras model): the model created with tensorflows keras (not yet compiled) :param : param model_name (str): name of model used in repo :param : param loss (str): lossfunction :param : param epochs (int): number of epochs used :param : param batch_size (int): batch size

eval_keras_tensorflow(model, data)

Function to evaluate a keras-tensorflowmodel

  • model (TensorflowKerasModel) – model to evaluate
  • data (DataSet) – dataset on which model is evaluated

evaluated data

Return type: