pyreal.utils.model_utils.load_model_from_weights#

pyreal.utils.model_utils.load_model_from_weights(weights, model_type, includes_intercept=True)[source]#

Generates an sklearn model from a list of weights

Parameters:
  • weights (array_like) – Ordered list of model weights. Can be a list/numpy array, in which feature

  • model_type (string) – Base model type. One of: linear_regression and logistic_regression

  • includes_intercept – Boolean True if first element of weights is the intercept, False otherwise If False, intercept defaults to 0

Returns:

sklearn model

The loaded model with given weights