Skip to content

Commit

Permalink
Merge branch 'dev' into postmodeling_revision_202
Browse files Browse the repository at this point in the history
  • Loading branch information
kasunamare committed Jan 8, 2024
2 parents 35955dd + 0e98dc4 commit ecd63e4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/triage/component/architect/feature_group_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ def prefix_subsetter(config_item, table, features):
"Return features matching a given prefix"
return [feature for feature in features if feature.startswith(config_item)]


def metric_subsetter(config_item, table, features):
"Return features that implements the given metric"
# The metric is represented at the end of the feature name
return [feature for feature in features if feature.endswith("_"+config_item)]


def interval_subsetter(config_item, table, features):
"Return features that use data from a specific time interval"

search_str = f"_{config_item}_"
return [feature for feature in features if search_str in feature]


def all_subsetter(config_item, table, features):
return features

Expand All @@ -47,6 +61,8 @@ class FeatureGroupCreator:
subsetters = {
"tables": table_subsetter,
"prefix": prefix_subsetter,
"metric": metric_subsetter,
"interval": interval_subsetter,
"all": all_subsetter
}

Expand Down

0 comments on commit ecd63e4

Please sign in to comment.