Plotter

lazygrid.plotter

lazygrid.plotter.plot_boxplots(scores: List, labels: List[str], file_name: str, title: str, output_dir: str = './figures') → dict

Generate and save boxplots.

Parameters:
  • scores – List of scores to compare
  • labels – Name / identifier of each score list
  • file_name – Output file name
  • title – Figure title
  • output_dir – Output directory
Returns:

boxplot object

Return type:

Boxplot

lazygrid.plotter.plot_learning_curve(estimator, title, X, y, axes=None, ylim=None, cv=None, n_jobs=None, train_sizes=array([0.1, 0.325, 0.55, 0.775, 1. ]))

Generate 3 plots: the test and training learning curve, the training samples vs fit times curve, the fit times vs score curve.

Parameters:
  • estimator (object type that implements the "fit" and "predict" methods) – An object of that type which is cloned for each validation.
  • title (string) – Title for the chart.
  • X (array-like, shape (n_samples, n_features)) – Training vector, where n_samples is the number of samples and n_features is the number of features.
  • y (array-like, shape (n_samples) or (n_samples, n_features), optional) – Target relative to X for classification or regression; None for unsupervised learning.
  • axes (array of 3 axes, optional (default=None)) – Axes to use for plotting the curves.
  • ylim (tuple, shape (ymin, ymax), optional) – Defines minimum and maximum yvalues plotted.
  • cv (int, cross-validation generator or an iterable, optional) –

    Determines the cross-validation splitting strategy. Possible inputs for cv are:

    • None, to use the default 5-fold cross-validation,
    • integer, to specify the number of folds.
    • CV splitter,
    • An iterable yielding (train, test) splits as arrays of indices.

    For integer/None inputs, if y is binary or multiclass, StratifiedKFold used. If the estimator is not a classifier or if y is neither binary nor multiclass, KFold is used.

    Refer User Guide for the various cross-validators that can be used here.

  • n_jobs (int or None, optional (default=None)) – Number of jobs to run in parallel. None means 1 unless in a joblib.parallel_backend context. -1 means using all processors. See Glossary for more details.
  • train_sizes (array-like, shape (n_ticks,), dtype float or int) – Relative or absolute numbers of training examples that will be used to generate the learning curve. If the dtype is float, it is regarded as a fraction of the maximum size of the training set (that is determined by the selected validation method), i.e. it has to be within (0, 1]. Otherwise it is interpreted as absolute sizes of the training sets. Note that for classification the number of samples usually have to be big enough to contain at least one sample from each class. (default: np.linspace(0.1, 1.0, 5))