cleanup_distribution_outliers(wholesaler_data)
Interpolate values where distribution signals exceed 3 standard deviations from the rolling mean. Interpolation is performed only if distribution is non-zero.
Source code in wt_ml/dataset/region_hacks/us_hacks/distribution_hacks.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
clip_distribution_values(wholesaler_data)
Simple Distribution should not be less than 0 or greater than 1 and Multiple Distribution should not be less than 1.
Source code in wt_ml/dataset/region_hacks/us_hacks/distribution_hacks.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
|
fill_distribution_endpoints(wholesaler_data)
Forward fills simple distribution wherever value exceeds 1. Replaces beginning and end values with their nearest dates for all distribution signals.
Source code in wt_ml/dataset/region_hacks/us_hacks/distribution_hacks.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
impute_distribution_signals_outliers(wholesaler_data)
Impute missing/outlier values in distribution signals for specific brands and dates as mentioned in WIBBLES_TO_PATCH using either mean imputation, forward fill, backward fill, rolling mean or linear interpolation.
Source code in wt_ml/dataset/region_hacks/us_hacks/distribution_hacks.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
impute_zero_distribution_signals(wholesaler_data)
Impute the simple and multiple distribution signals for weeks where sales are greater than 10K but distribution signal values are missing.
Source code in wt_ml/dataset/region_hacks/us_hacks/distribution_hacks.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|