ModelTask
ModelTask
Examples
```python
# Binary classification (fraud detection)
fraud_model = fdl.Model.from_data(
name=’fraud_detector’,
source=fraud_data,
spec=model_spec,
task=fdl.ModelTask.BINARY_CLASSIFICATION,
task_params=fdl.ModelTaskParams(
binary_classification_threshold=0.5
)
)
# Multiclass classification (sentiment analysis)
sentiment_model = fdl.Model.from_data(
name=’sentiment_analyzer’,
source=sentiment_data,
spec=model_spec,
task=fdl.ModelTask.MULTICLASS_CLASSIFICATION,
task_params=fdl.ModelTaskParams(
target_class_order=[‘negative’, ‘neutral’, ‘positive’]
)
)
# Regression (price prediction)
price_model = fdl.Model.from_data(
name=’price_predictor’,
source=price_data,
spec=model_spec,
task=fdl.ModelTask.REGRESSION
)
# Ranking (recommendation system)
ranking_model = fdl.Model.from_data(
name=’recommender’,
source=ranking_data,
spec=model_spec,
task=fdl.ModelTask.RANKING,
task_params=fdl.ModelTaskParams(
group_by=’user_id’,
top_k=10
)
)
# LLM (language model)
llm_model = fdl.Model.from_data(
name=’chatbot’,
source=conversation_data,
spec=model_spec,
task=fdl.ModelTask.LLM
## )BINARY_CLASSIFICATION = 'binary_classification'
MULTICLASS_CLASSIFICATION = 'multiclass_classification'
REGRESSION = 'regression'
RANKING = 'ranking'
LLM = 'llm'
NOT_SET = 'not_set'
is_classification()
Returns
is_regression()
Returns
Last updated
Was this helpful?