Skip to content

Commit

Permalink
fix: move features field inside model_spec for prediction model (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhar-rudder authored Jul 10, 2024
1 parent 4782cd9 commit 0916b5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions samples/py_native/models/profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ models:
column_names:
percentile: percentile_classification_churn_7_days
score: classification_churn_7_days
features:
- name: percentile_classification_churn_7_days
description: description
features:
- name: percentile_classification_churn_7_days
description: description
- name: prediction_regression_model
model_type: prediction_model
model_spec:
Expand All @@ -65,6 +65,6 @@ models:
column_names:
percentile: percentile_regression_days_since_last_seen
score: regression_days_since_last_seen
features:
- name: percentile_regression_days_since_last_seen
description: description
features:
- name: percentile_regression_days_since_last_seen
description: description
6 changes: 5 additions & 1 deletion src/predictions/profiles_mlcorelib/py_native/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
from profiles_rudderstack.material import WhtMaterial
from profiles_rudderstack.logger import Logger
from typing import Tuple
from profiles_rudderstack.schema import EntityKeyBuildSpecSchema
from profiles_rudderstack.schema import (
EntityKeyBuildSpecSchema,
FeatureDetailsBuildSpecSchema,
)

from .warehouse import standardize_ref_name

Expand All @@ -24,6 +27,7 @@ class PredictionModel(BaseModelType):
"properties": {
"occurred_at_col": {"type": "string"},
**EntityKeyBuildSpecSchema["properties"],
**FeatureDetailsBuildSpecSchema["properties"],
"validity_time": {"type": "string"},
"inputs": {"type": "array", "items": {"type": "string"}, "minItems": 1},
"training_model": {"type": "string"},
Expand Down

0 comments on commit 0916b5d

Please sign in to comment.