DocumentationClassesLearningCurveDisplay

Class: LearningCurveDisplay

Learning Curve visualization.

It is recommended to use from_estimator to create a LearningCurveDisplay instance. All parameters are stored as attributes.

Read more in the User Guide for general information about the visualization API and detailed documentation regarding the learning curve visualization.

Python Reference

Constructors

new LearningCurveDisplay()

new LearningCurveDisplay(opts?): LearningCurveDisplay

Parameters

ParameterTypeDescription
opts?object-
opts.score_name?stringThe name of the score used in learning_curve. It will override the name inferred from the scoring parameter. If score is undefined, we use "Score" if negate_score is false and "Negative score" otherwise. If scoring is a string or a callable, we infer the name. We replace _ by spaces and capitalize the first letter. We remove neg_ and replace it by "Negative" if negate_score is false or just remove it otherwise.
opts.test_scores?ArrayLike[]Scores on test set.
opts.train_scores?ArrayLike[]Scores on training sets.
opts.train_sizes?ArrayLikeNumbers of training examples that has been used to generate the learning curve.

Returns LearningCurveDisplay

Defined in generated/model_selection/LearningCurveDisplay.ts:25

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/model_selection/LearningCurveDisplay.ts:23
_isInitializedbooleanfalsegenerated/model_selection/LearningCurveDisplay.ts:22
_pyPythonBridgeundefinedgenerated/model_selection/LearningCurveDisplay.ts:21
idstringundefinedgenerated/model_selection/LearningCurveDisplay.ts:18
optsanyundefinedgenerated/model_selection/LearningCurveDisplay.ts:19

Accessors

ax_

Get Signature

get ax_(): Promise<any>

Axes with the learning curve.

Returns Promise<any>

Defined in generated/model_selection/LearningCurveDisplay.ts:360


errorbar_

Get Signature

get errorbar_(): Promise<any>

When the std_display_style is "errorbar", this is a list of matplotlib.container.ErrorbarContainer objects. If another style is used, errorbar_ is undefined.

Returns Promise<any>

Defined in generated/model_selection/LearningCurveDisplay.ts:414


figure_

Get Signature

get figure_(): Promise<any>

Figure containing the learning curve.

Returns Promise<any>

Defined in generated/model_selection/LearningCurveDisplay.ts:387


fill_between_

Get Signature

get fill_between_(): Promise<any>

When the std_display_style is "fill_between", this is a list of matplotlib.collections.PolyCollection objects. If another style is used, fill_between_ is undefined.

Returns Promise<any>

Defined in generated/model_selection/LearningCurveDisplay.ts:468


lines_

Get Signature

get lines_(): Promise<any>

When the std_display_style is "fill_between", this is a list of matplotlib.lines.Line2D objects corresponding to the mean train and test scores. If another style is used, line_ is undefined.

Returns Promise<any>

Defined in generated/model_selection/LearningCurveDisplay.ts:441


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/model_selection/LearningCurveDisplay.ts:50

Methods

dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Returns Promise<void>

Defined in generated/model_selection/LearningCurveDisplay.ts:106


from_estimator()

from_estimator(opts): Promise<any>

Create a learning curve display from an estimator.

Read more in the User Guide for general information about the visualization API and detailed documentation regarding the learning curve visualization.

Parameters

ParameterTypeDescription
optsobject-
opts.ax?anyAxes object to plot on. If undefined, a new figure and axes is created.
opts.cv?numberDetermines the cross-validation splitting strategy. Possible inputs for cv are:
opts.error_score?"raise"Value to assign to the score if an error occurs in estimator fitting. If set to ‘raise’, the error is raised. If a numeric value is given, FitFailedWarning is raised.
opts.errorbar_kw?anyAdditional keyword arguments passed to the plt.errorbar used to draw mean score and standard deviation score.
opts.estimator?anyAn object of that type which is cloned for each validation.
opts.exploit_incremental_learning?booleanIf the estimator supports incremental learning, this will be used to speed up fitting for different training set sizes.
opts.fill_between_kw?anyAdditional keyword arguments passed to the plt.fill_between used to draw the score standard deviation.
opts.fit_params?anyParameters to pass to the fit method of the estimator.
opts.groups?ArrayLikeGroup labels for the samples used while splitting the dataset into train/test set. Only used in conjunction with a “Group” cv instance (e.g., GroupKFold).
opts.line_kw?anyAdditional keyword arguments passed to the plt.plot used to draw the mean score.
opts.n_jobs?numberNumber of jobs to run in parallel. Training the estimator and computing the score are parallelized over the different training and test sets. undefined means 1 unless in a joblib.parallel_backend context. \-1 means using all processors. See Glossary for more details.
opts.negate_score?booleanWhether or not to negate the scores obtained through learning_curve. This is particularly useful when using the error denoted by neg_\* in scikit-learn.
opts.pre_dispatch?string | numberNumber of predispatched jobs for parallel execution (default is all). The option can reduce the allocated memory. The str can be an expression like ‘2*n_jobs’.
opts.random_state?numberUsed when shuffle is true. Pass an int for reproducible output across multiple function calls. See Glossary.
opts.score_name?stringThe name of the score used to decorate the y-axis of the plot. It will override the name inferred from the scoring parameter. If score is undefined, we use "Score" if negate_score is false and "Negative score" otherwise. If scoring is a string or a callable, we infer the name. We replace _ by spaces and capitalize the first letter. We remove neg_ and replace it by "Negative" if negate_score is false or just remove it otherwise.
opts.score_type?"both" | "test" | "train"The type of score to plot. Can be one of "test", "train", or "both".
opts.scoring?stringA string (see The scoring parameter: defining model evaluation rules) or a scorer callable object / function with signature scorer(estimator, X, y) (see Defining your scoring strategy from metric functions).
opts.shuffle?booleanWhether to shuffle training data before taking prefixes of it based ontrain_sizes.
opts.std_display_style?"errorbar" | "fill_between"The style used to display the score standard deviation around the mean score. If undefined, no representation of the standard deviation is displayed.
opts.train_sizes?ArrayLikeRelative 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.
opts.verbose?numberControls the verbosity: the higher, the more messages.
opts.X?ArrayLike[]Training data, where n_samples is the number of samples and n_features is the number of features.
opts.y?ArrayLikeTarget relative to X for classification or regression; undefined for unsupervised learning.

Returns Promise<any>

Defined in generated/model_selection/LearningCurveDisplay.ts:125


init()

init(py): Promise<void>

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/model_selection/LearningCurveDisplay.ts:63


plot()

plot(opts): Promise<any>

Plot visualization.

Parameters

ParameterTypeDescription
optsobject-
opts.ax?anyAxes object to plot on. If undefined, a new figure and axes is created.
opts.errorbar_kw?anyAdditional keyword arguments passed to the plt.errorbar used to draw mean score and standard deviation score.
opts.fill_between_kw?anyAdditional keyword arguments passed to the plt.fill_between used to draw the score standard deviation.
opts.line_kw?anyAdditional keyword arguments passed to the plt.plot used to draw the mean score.
opts.negate_score?booleanWhether or not to negate the scores obtained through learning_curve. This is particularly useful when using the error denoted by neg_\* in scikit-learn.
opts.score_name?stringThe name of the score used to decorate the y-axis of the plot. It will override the name inferred from the scoring parameter. If score is undefined, we use "Score" if negate_score is false and "Negative score" otherwise. If scoring is a string or a callable, we infer the name. We replace _ by spaces and capitalize the first letter. We remove neg_ and replace it by "Negative" if negate_score is false or just remove it otherwise.
opts.score_type?"both" | "test" | "train"The type of score to plot. Can be one of "test", "train", or "both".
opts.std_display_style?"errorbar" | "fill_between"The style used to display the score standard deviation around the mean score. If undefined, no standard deviation representation is displayed.

Returns Promise<any>

Defined in generated/model_selection/LearningCurveDisplay.ts:285