Skip to content

Documentation for App and related classes

AnomalyDetectionConfig dataclass

Configuration for Anomaly Detection application

App

The object model represents an Application in the Engine

create_feature_set(name, feature_names, description=None, timeout=DEFAULT_TIMEOUT)

Create a new feature set

Parameters:

Name Type Description Default
name str

name of the feature set. Name must be unique in the Application-scope.

required
feature_names Set[str]

Name of columns used as features

required
description str

description of the feature set. Defaults to None.

None
timeout int

waiting time in seconds. Defaults to DEFAULT_TIMEOUT.

DEFAULT_TIMEOUT

Raises:

Type Description
Exception

description

Returns:

Name Type Description
FeatureSet FeatureSet

the newly created FeatureSet resource

create_model(name, template_id, feature_set_id, dataset_version=LATEST_VERSION, hyperparameters=None, hyperparameter_tuning_method=None, hyperparameter_tuning_config=None, continuous_learning=False, pipeline_configuration_id=None, wait_until_trained=True, timeout=DEFAULT_TIMEOUT * 2)

Train a new model using a specific dataset_version of the dataset

Parameters:

Name Type Description Default
name str

descriptive name of the model

required
template_id str

the ID of the pre-defined model template

required
feature_set_id str

ID of the feature set used to train the model

required
dataset_version int

description. Defaults to LATEST_VERSION.

LATEST_VERSION
continuous_learning bool

description. Defaults to False.

False
pipeline_configuration_id str

description. Defaults to None.

None
wait_until_trained bool

description. Defaults to True.

True
timeout int

description. Defaults to DEFAULT_TIMEOUT*2.

DEFAULT_TIMEOUT * 2

Returns:

Name Type Description
Model Model

the newly created model

delete()

Delete the app.

Warning

All related data (models, feature sets, deployments) of the app will be deleted.

description() property

Description of the app

Returns:

Name Type Description
str str

Description of the app

get_feature_set(id=None, timeout=DEFAULT_TIMEOUT)

Get feature set by ID

Parameters:

Name Type Description Default
id str

ID of the feature set. Defaults to None.

None
timeout int

waiting for the feature set processed time in seconds. Defaults to DEFAULT_TIMEOUT.

DEFAULT_TIMEOUT

Returns:

Name Type Description
FeatureSet FeatureSet

description

Get the recommended feature set of the application

Parameters:

Name Type Description Default
timeout int

time (in seconds) to wait for feature set processed. Defaults to DEFAULT_TIMEOUT.

DEFAULT_TIMEOUT

Raises:

Type Description
RuntimeError

raised if the recommended feature set is not available at the time

Returns:

Type Description
FeatureSet

return Recommended feature set of the application

list_artifacts(type, labels=None)

List all artifacts belong to this application which match the type and the labels

Parameters:

Name Type Description Default
type str

type of the artifact

required
labels Dict[str, str]

labels of the artifacts. Defaults to None.

None

Returns:

Type Description
List[Artifact]

List of artifacts

list_feature_sets()

Get all available feature sets

Returns:

Type Description
List[FeatureSet]

List of FeatureSet resources

list_models()

Get all available models

Returns:

Type Description
List[Model]

List[Model]: list of Model resources

name() property

Name of the app

Returns:

Name Type Description
str str

Name of the app

update(name, description=None)

Update information of the app

Parameters:

Name Type Description Default
name str

updated project name

required
description str

updated project description. Defaults to None.

None

ClassificationConfig dataclass

Configuration for Classification application

negative_class_label: str = None class-attribute

If sub_type is Binary, this must be the value of negative class

positive_class_label: str = None class-attribute

If sub_type is Binary, this must be the value of positive class

sub_type: ClassificationSubType = ClassificationSubType.MULTI_CLASS class-attribute

Sub-type of the classification problem: Binary or Multi-class classification

ClusteringConfig dataclass

Configuration for Clustering application

Example
# create a clustering application
app = project.create_app(
    name='Insurance Customer Segmentation - Test 8',
    dataset_id=dataset.id,
    problem_type=MLProblemType.CLUSTERING,
    problem_type_config=ClusteringConfig(
        feature_set={
            'selected_features': [
                "State",
                "Response",
                "Coverage",
                "Education",
                "EmploymentStatus",
                "Gender",
                "Income",
                "Location Code",
                "Marital Status",
                "Monthly Premium Auto",
                "Months Since Last Claim",
                "Months Since Policy Inception",
                "Number of Open Complaints",
                "Number of Policies",
                "Policy Type",
                "Policy",
                "Renew Offer Type",
                "Sales Channel",
                "Total Claim Amount",
                "Vehicle Class",
                "Vehicle Size",
            ]
        },
        initial_models=[
            {
                'name': 'GMM',
                'template_id': Clusterers.GMM,
                'training_config':{
                    'hyperparameter_tuning_method': HyperparameterTuningMethod.GRID_SEARCH,
                    'hyperparameter_tuning_config': None,
                    'hyperparameters': {
                        'k': {
                            'max_num_clusters': 5,
                            'min_num_clusters': 2
                        }
                    },
                }

            },
            {
                'name': 'K-Means',
                'template_id': Clusterers.KMeans,
                'training_config': {
                    'hyperparameter_tuning_method': None,
                    'hyperparameter_tuning_config': None,
                    'hyperparameters': {},
                }
            }
        ]
    ),
    training_data_proportion=1.0
)

feature_set: dict = None class-attribute

Selected features

initial_models: list = None class-attribute

List of initial models will be trained when the app is created

RegressionConfig dataclass

Configuration for Regression application

SupervisedLearningConfig dataclass

feature_selection: Union[AutoFeatureSelection, ManualFeatureSelection] = field(metadata=config(encoder=feature_selection_encoder), default=None) class-attribute

Configure the features used to train the models

model_selection: Union[AutoModelSelection, List[ManualModelSelection]] = field(metadata=config(encoder=model_selection_encoder), default=None) class-attribute

Configure which models to train

target_column: str class-attribute

The models will be trained to predict a value of the target column

train_test_split: TrainTestSplitConfig = TrainTestSplitConfig() class-attribute

Configure the train/test split

TimeSeriesForecastingConfig dataclass

Configuration for Time-series Forecasting application

get_all_clustering_results(app)

Get all clustering results of the app

Parameters:

Name Type Description Default
app App

The clustering app

required

Returns:

Type Description
List[ClusteringResult]

List[ClusteringResult]: Clustering results

get_clustering_result(app, name)

Get a clustering result of the app by name

Parameters:

Name Type Description Default
app App

The clustering app

required
name str

Name of the result

required

Raises:

Type Description
Exception

Result not found

Returns:

Name Type Description
ClusteringResult ClusteringResult

the clustering result