RelFMTabularPredictor
relationalai.semantics.reasoners.predictive
RelFMTabularPredictor( *, database: str, schema: str, context: b.Concept, label_column: str, task_type: str, validation: Optional[b.Concept] = None, eval_metric: Optional[str] = None, test_batch_size: Optional[int] = None, stream_logs: bool = True, dataset_alias: Optional[str] = None, device: Literal["cpu", "cuda"] = "cpu", n_estimators: int = 8, random_state: Optional[int] = 42, sample_size: Optional[int] = None, sampling_strategy: str = "stratified", clamp_min: Optional[int] = 0, clamp_max: Optional[int] = 100, regression_output: Literal["point", "distribution"] = "point", quantile_levels: Optional[List[float]] = None, norm_methods: Optional[Union[str, List[str]]] = None)Classification/regression flat-table RelFM — see RelFMTabular.
Parameters
(databasestr) - Snowflake database to save predictions in.
(schemastr) - Snowflake schema to save predictions in.
(contextConcept) - Labeled split, used directly as in-context examples (RelFM has no training step). Must be identified by a single natural-key property and carrylabel_columnamong its own properties.
(label_columnstr) - Name of the label property oncontext/validation.
(task_typestr) - One of"binary_classification","multiclass_classification", or"regression".
(validationConcept, default:None) - Optional labeled validation split. Does not need to be the same Concept ascontext— only needs the same feature columns.
(eval_metricstr, default:None) - Evaluation metric compatible with the chosentask_type.
(test_batch_sizeint|None, default:None)
(stream_logsint|None, default:None)
(dataset_aliasint|None, default:None)
(deviceint|None, default:None)
(n_estimatorsint|None, default:None)
(random_stateint|None, default:42) - SeeRelFMTabular.
(sample_sizeint|None, default:42) - SeeRelFMTabular.
(sampling_strategyint|None, default:42) - SeeRelFMTabular.
(quantile_levelsint|None, default:42) - SeeRelFMTabular.
(norm_methodsint|None, default:42) - SeeRelFMTabular.
(clamp_minint, default:0) - Min percentile clamp for regression predictions. Default is0.
(clamp_maxint, default:100) - Max percentile clamp for regression predictions. Default is100.
(regression_outputstr, default:“point”) -"point"(default) or"distribution".
Examples
relfm_tabular = RelFMTabularPredictor( database="MYDB", schema="MYSCHEMA", context=Customer, label_column="lifetime_value", task_type="regression", eval_metric="rmse",)Customer.predictions = relfm_tabular.predictions(domain=TestCustomer)Methods
.predictions()
RelFMTabularPredictor.predictions(domain: b.Concept) -> b.RelationshipGenerate predictions for every row of an unlabeled domain Concept.
Parameters:
(domainConcept) - Unlabeled Concept to predict for — identified by a single natural-key property, carrying the same feature columns ascontext(nolabel_column).
Returns:
Relationship- A prediction relationship:{domain} -> prediction, to be assigned to a field for downstream querying.