Module Expr Str ImportFrom alias Import alias identifier Import alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias identifier Import alias FunctionDef arguments args NameParam defaults body Return BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr Num Num keyword NameLoad BinOpMult Num Call AttributeLoad NameLoad attr BinOpAdd Num Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Return CompareLt Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad BinOpDiv Num BinOpAdd Num Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad decorator_list Assign NameStore Dict Str Str NameLoad NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad For NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore BinOpPow Num NameLoad Assign NameStore Call SubscriptLoad NameLoad Index AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr
N/A N/A 
Benchmarks of isotonic regression performance.

We generate a synthetic dataset of size 10^n, for n in [min, max], and
examine the time taken to run isotonic regression over the dataset.

The timings are then output to stdout, or visualized on a log-log scale
with matplotlib.

This allows the scaling of the algorithm with the problem size to be
visualized and understood.
 __future__ print_function N/A numpy np N/A gc datetime datetime sklearn.isotonic isotonic_regression sklearn.utils.bench total_seconds N/A matplotlib.pyplot plt N/A argparse generate_perturbed_logarithm_dataset N/A N/A size N/A N/A N/A N/A N/A N/A N/A np random randint -50 50 size n N/A 50.0 N/A N/A np log N/A 1 N/A N/A np arange n N/A generate_logistic_dataset N/A N/A size N/A N/A N/A X N/A N/A np sort N/A N/A N/A np random normal size size N/A N/A N/A N/A N/A np random random size size N/A 1.0 N/A 1.0 N/A N/A np exp N/A X N/A N/A DATASET_GENERATORS N/A perturbed_logarithm logistic generate_perturbed_logarithm_dataset generate_logistic_dataset bench_isotonic_regression N/A N/A Y N/A N/A N/A 
    Runs a single iteration of isotonic regression on the input data,
    and reports the total time taken (in seconds).
     N/A N/A N/A gc collect N/A tstart N/A N/A datetime now N/A N/A isotonic_regression Y N/A delta N/A N/A N/A datetime now tstart N/A N/A total_seconds delta N/A N/A N/A __name__ __main__ N/A N/A parser N/A N/A argparse ArgumentParser description Isotonic Regression benchmark tool N/A N/A N/A parser add_argument --iterations type int required True help Number of iterations to average timings over for each problem size N/A N/A N/A parser add_argument --log_min_problem_size type int required True help Base 10 logarithm of the minimum problem size N/A N/A N/A parser add_argument --log_max_problem_size type int required True help Base 10 logarithm of the maximum problem size N/A N/A N/A parser add_argument --show_plot action store_true help Plot timing output with matplotlib N/A N/A N/A parser add_argument --dataset choices N/A N/A DATASET_GENERATORS keys required True N/A args N/A N/A parser parse_args N/A timings N/A N/A exponent N/A range N/A args log_min_problem_size N/A args log_max_problem_size N/A N/A n N/A 10 exponent N/A Y N/A N/A DATASET_GENERATORS N/A N/A args dataset n N/A time_per_iteration N/A N/A bench_isotonic_regression Y N/A i N/A range N/A args iterations N/A timing N/A n N/A N/A np mean time_per_iteration N/A N/A N/A timings append timing N/A N/A N/A args show_plot N/A N/A N/A print n N/A N/A np mean time_per_iteration N/A N/A args show_plot N/A N/A N/A N/A plt plot N/A zip timings N/A N/A N/A plt title Average time taken running isotonic regression N/A N/A N/A plt xlabel Number of observations N/A N/A N/A plt ylabel Time (s) N/A N/A N/A plt axis tight N/A N/A N/A plt loglog N/A N/A N/A plt show