201 Fit function calculates the cumulative distribution with numpy percentile.
203 :param x: Input distribution
204 :param y: Will not be used in this transformation
206 self.
io.debug(
"Fitting CDF")
207 y_ = np.linspace(0, 100, 2 * self.
n_bins)
208 x_ = pd.Series(np.percentile(x, list(y_)))
211 vc = x_.value_counts()
215 for i, xi
in enumerate(vc):
218 nex_val = vc.index[i + 1]
220 nex_val = vc.index[i] + 0.01
221 fill = np.linspace(vc.index[i], nex_val, xi)
222 x_[x_ == vc.index[i]] = fill
223 self.
spline = InterpolatedUnivariateSpline(x_, y_)