def fit(self, values, bins):
assert self.cdf is None<EOL>assert self.bin_edges is None<EOL>assert len(values) > <NUM_LIT:0><EOL>(hist, self.bin_edges) = numpy.histogram(values, bins=bins)<EOL>self.cdf = numpy.ones(len(hist) + <NUM_LIT:3>) * numpy.nan<EOL>self.cdf[<NUM_LIT:0>] = <NUM_LIT:0.0><EOL>self.cdf[<NUM_LIT:1>] = <NUM_LIT:0.0><EOL>self.cdf[-<NUM_LIT:1>] = <NUM_LIT><EOL>numpy.cumsum(hist * <NUM_LIT> / numpy.sum(hist), out=self.cdf[<NUM_LIT:2>:-<NUM_LIT:1>])<EOL>assert not numpy.isnan(self.cdf).any()<EOL>
Fit the transform using the given values (in our case ic50s).

Parameters
----------
values : ic50 values
bins : bins for the cumulative distribution function
    Anything that can be passed to numpy.histogram's "bins" argument
    can be used here.