Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created June 24, 2024 21:38
Show Gist options
  • Save quantra-go-algo/134f005e7732d3bc83356823c926be20 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/134f005e7732d3bc83356823c926be20 to your computer and use it in GitHub Desktop.
# Set the minimum number of trials as a threshold number to accept an input feature as a selected feature
def get_tail_items(pmf, significance_level=0.05):
# Set total to zero
total = 0
# Create a loop based on the probability mass function
for i, x in enumerate(pmf):
# Increment the total variable with the probability “x” of i
total += x
# If total is higher than the significance level
if total >= significance_level:
# Break the code
break
# Return i
return i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment