minvime package

Submodules

minvime.estimator_classification module

Estimator Functions for estimating model performance requirements from business criteria

minvime.estimator_classification.calculate_auc(fprates, tprates)[source]

Calculate the AUC of given ROC curve (defined by vectors of FPR and TPR)

minvime.estimator_classification.calculate_peak_roi(fprates, tprates, tp, fp, tn, fn, num_pos, num_neg)[source]

Calculate the maximal ROI for a given ROC curve (defined by vectors of FPR and TPR)

minvime.estimator_classification.estimate_binary_model_requirements(tp, fp, tn, fn, cases, baserate, minroi=0)[source]

Determine the minimal performance characteristics of a binary classification model

Parameters
  • tp (float, required) – The benefit of a True Positive Prediction

  • fp (float, required) – The cost of a False Positive Prediction

  • tn (float, required) – The benefit of a True Negative Prediction

  • fn (float, required) – The cost of a False Negative Prediction

  • cases (integer, required) – The number of events/cases that occur within the period of analysis.

  • baserate (float, required) – The rate at which the event being predicted occurs

  • minroi (float, optional) – The minimum required ROI for the model, defaults to 0.0

*Returns a tuple containing min_auc, min_precision, min_recall, fprates tprs

minvime.estimator_classification.estimate_intervention_requirements(cases, baserate, cost, payoff, payback, succrate, backfire)[source]
minvime.estimator_classification.generate_roc_auc(fprates, alpha, beta)[source]
minvime.estimator_classification.nth_triangle(n)[source]
minvime.estimator_classification.simplicity_estimate(tp, fp, cases, baserate, minroi=0)[source]

minvime.estimator_regression module

Performance Estimator for Regression Models Functions for estimating the required model performance requirements from business criteria

minvime.estimator_regression.calculate_candidate_metrics(dist, candidate)[source]
minvime.estimator_regression.calculate_candidate_roi(dist, candidate, pred_value, under_pred, under_pred_unit, over_pred, over_pred_unit)[source]
minvime.estimator_regression.estimate_model_requirements_proportional(dist, cases, pred_value, under_pred, under_pred_unit, over_pred, over_pred_unit, minroi)[source]

Given a sample of target values and requirements – estimate baseline performance characteristics

minvime.estimator_regression.estimate_model_requirements_thresholded(dist, cases, pred_value, under_pred, under_pred_unit, under_pred_threshold, over_pred, over_pred_unit, over_pred_threshold, minroi)[source]

minvime.generator module

Distribution Generators for use in Performance Estimation for Regression Models

minvime.generator.copy_with_noise(dist, scale)[source]
minvime.generator.extract_distribution_from_sample(filepath)[source]

Extract a sample of target values from a file on the given path

minvime.generator.generate_candidate_predictions(dist)[source]
minvime.generator.generate_min_max_baseline(min, max, sample_size=1000)[source]
minvime.generator.produce_distribution_sample(mean, max, min)[source]

Given some simple parameters we generate a sample of target values. TODO: This needs work

minvime.generator.resample_toward_mean(baseline, mean, threshold)[source]

minvime.minvime module

MinViME is a flask application allowing users to estimate minimal viable models for machine learning projects.

minvime.minvime.about()[source]
minvime.minvime.allowed_file(filename)[source]
minvime.minvime.analyse()[source]

Renders the analysis page. Expects parameters from http session.

minvime.minvime.analyse_intervention()[source]

Renders the intervention analysis page. Expects parameters from http session.

minvime.minvime.analyse_proportional()[source]

Renders the analysis of proportional regression problems page. Expects parameters from http session.

minvime.minvime.analyse_thresholded()[source]

Renders the thresholded regression problem analysis page. Expects parameters from http session.

minvime.minvime.index()[source]
minvime.minvime.intervention()[source]

Renders the intervention page. Expects parameters from http session.

minvime.minvime.main(port=5000, debug=False)[source]

Launch the minvime Flask application.

Parameters
  • port (integer, optional) – The port to launch the app on, defaults to 5000

  • debug (boolean, optional)) – Enable debug mode – print errors to the console, defaults to False

minvime.minvime.payoff_matrix()[source]

Renders the payoff matrix page. Expects parameters from http session.

minvime.minvime.proportional()[source]

Renders the business context specification page for regression problems in which the costs/benefits are proprtional to the size of the error. Expects parameters from http session.

minvime.minvime.showplot()[source]
minvime.minvime.thresholded()[source]

Renders the business context collection page, for problems where the impact is related to a threshold value in the model error. Expects parameters from http session.

Module contents