Supervised usecases

class previsionio.supervised.Supervised(**usecase_info)

Bases: previsionio.usecase_version.ClassicUsecaseVersion

A supervised usecase.

classmethod from_id(_id: str) → previsionio.supervised.Supervised

Get a supervised usecase from the platform by its unique id.

Parameters:
  • _id (str) – Unique id of the usecase to retrieve
  • version (int, optional) – Specific version of the usecase to retrieve (default: 1)
Returns:

Fetched usecase

Return type:

Supervised

Raises:

PrevisionException – Invalid problem type or any error while fetching data from the platform or parsing result

new_version(description: str = None, dataset: Union[previsionio.dataset.Dataset, Tuple[previsionio.dataset.Dataset, previsionio.dataset.DatasetImages]] = None, column_config: previsionio.usecase_config.ColumnConfig = None, metric: enum.Enum = None, holdout_dataset: previsionio.dataset.Dataset = None, training_config: previsionio.usecase_config.TrainingConfig = None, **fit_params)

Start a supervised usecase training to create a new version of the usecase (on the platform): the training configs are copied from the current version and then overridden for the given parameters.

Parameters:
  • description (str, optional) – additional description of the version
  • dataset (Dataset, DatasetImages, optional) – Reference to the dataset object to use for as training dataset
  • column_config (ColumnConfig, optional) – Column configuration for the usecase (see the documentation of the ColumnConfig resource for more details on each possible column types)
  • metric (metrics.Enum, optional) – Specific metric to use for the usecase (default: None)
  • holdout_dataset (Dataset, optional) – Reference to a dataset object to use as a holdout dataset (default: None)
  • training_config (TrainingConfig) – Specific training configuration (see the documentation of the TrainingConfig resource for more details on all the parameters)
Returns:

Newly created supervised usecase object (new version)

Return type:

Supervised

class previsionio.timeseries.TimeSeries(**usecase_info)

Bases: previsionio.usecase_version.ClassicUsecaseVersion

A TimeSeries usecase.

metric_type

alias of previsionio.metrics.Regression

model_class

alias of previsionio.model.RegressionModel

new_version(description: str = None, dataset: previsionio.dataset.Dataset = None, column_config: previsionio.usecase_config.ColumnConfig = None, time_window: previsionio.timeseries.TimeWindow = None, metric: previsionio.metrics.Regression = None, holdout_dataset: previsionio.dataset.Dataset = None, training_config: previsionio.usecase_config.TrainingConfig = <previsionio.usecase_config.TrainingConfig object>)

Start a time series usecase training to create a new version of the usecase (on the platform): the training configs are copied from the current version and then overridden for the given parameters.

Parameters:
  • description (str, optional) – additional description of the version
  • dataset (Dataset, DatasetImages, optional) – Reference to the dataset object to use for as training dataset
  • column_config (ColumnConfig, optional) – Column configuration for the usecase (see the documentation of the ColumnConfig resource for more details on each possible column types)
  • ( (time_window) – class: .TimeWindow, optional): a time window object for representing either feature derivation window periods or forecast window periods
  • metric (metrics.Regression, optional) – Specific metric to use for the usecase (default: None)
  • holdout_dataset (Dataset, optional) – Reference to a dataset object to use as a holdout dataset (default: None)
  • training_config (TrainingConfig, optional) – Specific training configuration (see the documentation of the TrainingConfig resource for more details on all the parameters)
Returns:

Newly created text similarity usecase version object (new version)

Return type:

TimeSeries

class previsionio.timeseries.TimeWindow(derivation_start: int, derivation_end: int, forecast_start: int, forecast_end: int)

Bases: previsionio.usecase_config.UsecaseConfig

A time window object for representing either feature derivation window periods or forecast window periods

exception previsionio.timeseries.TimeWindowException

Bases: Exception