MCPcopy
hub / github.com/TheAlgorithms/Python / interquartile_range_checker

Function interquartile_range_checker

machine_learning/forecasting/run.py:81–95  ·  view source on GitHub ↗

Optional method: interquatile range input : list of total user in float output : low limit of input in float this method can be used to check whether some data is outlier or not >>> interquartile_range_checker([1,2,3,4,5,6,7,8,9,10]) 2.8

(train_user: list)

Source from the content-addressed store, hash-verified

79
80
81def interquartile_range_checker(train_user: list) -> float:
82 """
83 Optional method: interquatile range
84 input : list of total user in float
85 output : low limit of input in float
86 this method can be used to check whether some data is outlier or not
87 >>> interquartile_range_checker([1,2,3,4,5,6,7,8,9,10])
88 2.8
89 """
90 train_user.sort()
91 q1 = np.percentile(train_user, 25)
92 q3 = np.percentile(train_user, 75)
93 iqr = q3 - q1
94 low_lim = q1 - (iqr * 0.1)
95 return float(low_lim)
96
97
98def data_safety_checker(list_vote: list, actual_result: float) -> bool:

Callers

nothing calls this directly

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected