Feature Predict
- class ds_capability.FeaturePredict(property_manager: Any, intent_model: Any, default_save: bool | None = None, reset_templates: bool | None = None, template_path: str | None = None, template_module: str | None = None, template_source_handler: str | None = None, template_persist_handler: str | None = None, align_connectors: bool | None = None)
- class ds_capability.intent.feature_predict_intent.FeaturePredictIntent(property_manager: ~ds_capability.managers.feature_predict_property_manager.FeaturePredictPropertyManager, default_save_intent: bool = None, default_intent_level: [<class 'str'>, <class 'int'>, <class 'float'>] = None, order_next_available: bool = None, default_replace_intent: bool = None)
- label_predict(canonical: ~pyarrow.lib.Table, model_name: str, *, id_header: str = None, save_intent: bool = None, intent_level: [<class 'int'>, <class 'str'>] = None, intent_order: int = None, replace_intent: bool = None, remove_duplicates: bool = None)
Retrieves a trained model and applies it to the canonical, returning the canonical with prediction labels. This assumes a trained model with a predict function. if an
id_headername is given, that column will be removed from the feature and reapplied with the predictions.- Parameters:
canonical – the model canonical
model_name – a unique name for the model
id_header – (optional) the name of a header that is not a feature that uniquely identifies each row
save_intent – (optional) if the intent contract should be saved to the property manager
intent_level – (optional) the level name that groups intent by a reference name
intent_order – (optional) the order in which each intent should run. - If None: default’s to -1 - if -1: added to a level above any current instance of the intent section, level 0 if not found - if int: added to the level specified, overwriting any that already exist
replace_intent – (optional) if the intent method exists at the level, or default level - True - replaces the current intent method with the new - False - leaves it untouched, disregarding the new intent
remove_duplicates – (optional) removes any duplicate intent in any level that is identical
- Returns:
the canonical with a prediction.