class documentation

class SupervisedModelFeatureStore: (source)

View In Hierarchy

Undocumented

Method features_for Loads the features and labels for a model
Method predictions_for Loads the predictions and labels / ground truths for a model
Class Variable labels_estimates_refs Undocumented
Class Variable model Undocumented
Class Variable selected_version Undocumented
Class Variable store Undocumented
def features_for(self, entities: ConvertableToRetrivalJob | RetrivalJob, event_timestamp_column: str | None = None, target_event_timestamp_column: str | None = None) -> SupervisedJob: (source)

Loads the features and labels for a model

```python store = await FileSource.json_at("features-latest.json").feature_store()

data = store.model("titanic")
.with_labels().features_for({"passenger_id": [1, 2, 3]}).to_polars()

print(data.labels.collect(), data.input.collect()) >>> ┌──────────┐ ┌───────┬─────────┬─────────────────────┬──────────────┐ >>> │ survived │ │ is_mr ┆ is_male ┆ constant_filled_age ┆ has_siblings │ >>> │ --- │ │ --- ┆ --- ┆ --- ┆ --- │ >>> │ bool │ │ bool ┆ bool ┆ f64 ┆ bool │ >>> ╞══════════╡ ╞═══════╪═════════╪═════════════════════╪══════════════╡ >>> │ false │ │ true ┆ true ┆ 22.0 ┆ true │ >>> │ true │ │ false ┆ false ┆ 38.0 ┆ true │ >>> │ true │ │ false ┆ false ┆ 26.0 ┆ false │ >>> └──────────┘ └───────┴─────────┴─────────────────────┴──────────────┘ ```

Args:
entities (dict[str, list] | RetrivalJob): A dictionary of entity names to lists of entity values
Returns:
SupervisedJob: A object that will load the features and lables in your desired format
def predictions_for(self, entities: ConvertableToRetrivalJob | RetrivalJob, event_timestamp_column: str | None = None, target_event_timestamp_column: str | None = None) -> RetrivalJob: (source)

Loads the predictions and labels / ground truths for a model

```python entities = {

"trip_id": ["ea6b8d5d-62fd-4664-a112-4889ebfcdf2b", ...], "vendor_id": [2, ...],

} preds = await store.model("taxi")

.with_labels().predictions_for(entities).to_polars()

print(preds.collect()) >>> ┌──────────┬───────────┬────────────────────┬───────────────────────────────────┐ >>> │ duration ┆ vendor_id ┆ predicted_duration ┆ trip_id │ >>> │ --- ┆ --- ┆ --- ┆ --- │ >>> │ i64 ┆ i32 ┆ i64 ┆ str │ >>> ╞══════════╪═══════════╪════════════════════╪═══════════════════════════════════╡ >>> │ 408 ┆ 2 ┆ 500 ┆ ea6b8d5d-62fd-4664-a112-4889ebfc… │ >>> │ 280 ┆ 1 ┆ 292 ┆ 64c4c94f-2a85-406f-86e6-082f1f7a… │ >>> │ 712 ┆ 4 ┆ 689 ┆ 3258461f-6113-4c5e-864b-75a0dee8… │ >>> └──────────┴───────────┴────────────────────┴───────────────────────────────────┘ ```

Args:
entities (dict[str, list] | RetrivalJob): A dictionary of entity names to lists of entity values
Returns:
RetrivalJob: A object that will load the features and lables in your desired format
labels_estimates_refs: set[FeatureReference] = (source)

Undocumented

model: ModelSchema = (source)

Undocumented

selected_version: str | None = (source)

Undocumented

Undocumented