Created
June 24, 2024 21:39
-
-
Save quantra-go-algo/34e820620d311e184211dc31f404b61a to your computer and use it in GitHub Desktop.
This file contains 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
# select features from n number of trials | |
def choose_features(feature_hits, TRIALS, thresh): | |
# Define the boundaries for the green zone | |
# Define the green zone threshold | |
green_zone_thresh = TRIALS - thresh | |
# Define the blue zone upper threshold | |
blue_zone_upper = green_zone_thresh | |
# Define the blue zone lower threshold | |
blue_zone_lower = thresh | |
# Select the input features as green whenever their hits are higher than the green zone threshold | |
green_zone = [key for key, value in feature_hits.items() if value >= green_zone_thresh] | |
# Select the input features as blue whenever their hits are between the blue zone lower threshold and the blue zone upper threshold | |
blue_zone = [key for key, value in feature_hits.items() if (value >= blue_zone_lower and value < blue_zone_upper)] | |
return green_zone, blue_zone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment