Skip to main content

Tabular Classification

Tabular classification algorithms are used to predict the category of a given input based on tabular data. They are used in a variety of applications, such as credit scoring, fraud detection, and customer segmentation.

Currently, the TrueState platform supports XGBoost, a popular gradient boosting algorithm, for tabular classification tasks.

Below is an example of how to train a tabular classification model and apply it to a dataset.

from truestate.jobs.ml.tabular.classification import TrainTabularClassifier, ApplyTabularClassifier

train_model = TrainTabularClassifier(
name="model_train",
description="Train a tabular classifier",
input_dataset="train_dataset",
output_model="my_model",
input_feature_column_names=["feature1", "feature2"],
output_target_column_name="target",
)

apply_model = ApplyTabularClassifier(
name="model_apply",
description="Apply a tabular classifier",
input_model="my_model",
input_dataset="test_dataset",
output_dataset="predictions",
input_feature_column_names=["feature1", "feature2"],
output_target_column_name="predictions",
)

my_workflow = Workflow(
name="example_workflow",
description="Product recommendation workflow",
jobs=[
train_model,
apply_model
],
)

my_workflow.sync()