@classmethod
def fit(kls, model, nsample=(4 * 1024), vmin=(- 5), vmax=0, nb=100):
    X = model.sample(nsample)
    sc = model.score(X)
    confidence_levels = (1 - numpy.logspace(vmin, vmax, num=nb))
    sc_cl = numpy.percentile(sc, (100.0 - (confidence_levels * 100.0)))
    confidence_table = numpy.array([sc_cl, confidence_levels])
    return kls(model, confidence_table)
@classmethod
def fit(kls, model, nsample=(4 * 1024), vmin=(- 5), vmax=0, nb=100):
    X = model.sample(nsample)
    sc = model.score(X)
    confidence_levels = (1 - numpy.logspace(vmin, vmax, num=nb))
    sc_cl = numpy.percentile(sc, (100.0 - (confidence_levels * 100.0)))
    confidence_table = numpy.array([sc_cl, confidence_levels])
    return kls(model, confidence_table)