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)
| 79 | |
| 80 | |
| 81 | def 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 | |
| 98 | def data_safety_checker(list_vote: list, actual_result: float) -> bool: |