Last active
October 31, 2025 16:51
-
-
Save ntkathole/0d241ba46111f0fca2fe57fffa2d458a to your computer and use it in GitHub Desktop.
Updated transaction_prediction_service service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from feast import FeatureService | |
| # Get all feature views | |
| print("Retrieving feature views from registry...") | |
| customer_demographics_fv = fs_banking.get_feature_view("customer_demographics_fv") | |
| customer_behavioral_profile = fs_banking.get_feature_view("customer_behavioral_profile") | |
| transaction_7d_aggregations = fs_banking.get_feature_view("transaction_7d_aggregations") | |
| transaction_30d_aggregations = fs_banking.get_feature_view("transaction_30d_aggregations") | |
| transaction_90d_patterns = fs_banking.get_feature_view("transaction_90d_patterns") | |
| customer_transaction_interaction = fs_banking.get_feature_view("customer_transaction_interaction") | |
| transaction_details = fs_banking.get_feature_view("transaction_details") | |
| atm_usage_30d = fs_banking.get_feature_view("atm_usage_30d") | |
| customer_atm_interaction = fs_banking.get_feature_view("customer_atm_interaction") | |
| # Get your new feature view | |
| customer_high_value_txns = fs_banking.get_feature_view("customer_high_value_txns") | |
| print("✓ Retrieved all feature views") | |
| # Create updated service with all feature views explicitly listed | |
| transaction_prediction_service = FeatureService( | |
| name="transaction_prediction_service", | |
| features=[ | |
| # Original feature views | |
| customer_demographics_fv, | |
| customer_behavioral_profile, | |
| transaction_7d_aggregations, | |
| transaction_30d_aggregations, | |
| transaction_90d_patterns, | |
| customer_transaction_interaction, | |
| transaction_details, | |
| atm_usage_30d, | |
| customer_atm_interaction, | |
| # NEW: Your high-value transaction feature | |
| customer_high_value_txns, | |
| ], | |
| tags={ | |
| "team": "risk_fraud", | |
| "owner": "[email protected]", | |
| "use_case": "fraud_detection_v2", | |
| "model_type": "classification", | |
| "target": "is_fraud", | |
| "business_impact": "critical", | |
| "sla": "real_time", | |
| }, | |
| description="Enhanced fraud detection with high-value transaction indicators" | |
| ) | |
| # Apply the updated service | |
| print("Applying updated service...") | |
| fs_banking.apply([transaction_prediction_service]) | |
| print("✓ Service updated successfully!") | |
| fs_banking.refresh_registry() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment