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.
Python Reference (opens in a new tab)
Constructors
constructor()
Signature
new LearningCurveDisplay(opts?: object): LearningCurveDisplay;
Parameters
Name | Type | Description |
---|---|---|
opts? | object | - |
opts.score_name? | string | The name of the score used in learning\_curve . It will be used to decorate the y-axis. If undefined , the generic name "Score" will be used. |
opts.test_scores? | ArrayLike [] | Scores on test set. |
opts.train_scores? | ArrayLike [] | Scores on training sets. |
opts.train_sizes? | ArrayLike | Numbers of training examples that has been used to generate the learning curve. |
Returns
Defined in: generated/model_selection/LearningCurveDisplay.ts:25 (opens in a new tab)
Properties
_isDisposed
boolean
=false
Defined in: generated/model_selection/LearningCurveDisplay.ts:23 (opens in a new tab)
_isInitialized
boolean
=false
Defined in: generated/model_selection/LearningCurveDisplay.ts:22 (opens in a new tab)
_py
PythonBridge
Defined in: generated/model_selection/LearningCurveDisplay.ts:21 (opens in a new tab)
id
string
Defined in: generated/model_selection/LearningCurveDisplay.ts:18 (opens in a new tab)
opts
any
Defined in: generated/model_selection/LearningCurveDisplay.ts:19 (opens in a new tab)
Accessors
ax_
Axes with the learning curve.
Signature
ax_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/model_selection/LearningCurveDisplay.ts:423 (opens in a new tab)
errorbar_
When the std\_display\_style
is "errorbar"
, this is a list of matplotlib.container.ErrorbarContainer
objects. If another style is used, errorbar\_
is undefined
.
Signature
errorbar_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/model_selection/LearningCurveDisplay.ts:477 (opens in a new tab)
figure_
Figure containing the learning curve.
Signature
figure_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/model_selection/LearningCurveDisplay.ts:450 (opens in a new tab)
fill_between_
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
.
Signature
fill_between_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/model_selection/LearningCurveDisplay.ts:531 (opens in a new tab)
lines_
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
.
Signature
lines_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/model_selection/LearningCurveDisplay.ts:504 (opens in a new tab)
py
Signature
py(): PythonBridge;
Returns
PythonBridge
Defined in: generated/model_selection/LearningCurveDisplay.ts:50 (opens in a new tab)
Signature
py(pythonBridge: PythonBridge): void;
Parameters
Name | Type |
---|---|
pythonBridge | PythonBridge |
Returns
void
Defined in: generated/model_selection/LearningCurveDisplay.ts:54 (opens in a new tab)
Methods
dispose()
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
Signature
dispose(): Promise<void>;
Returns
Promise
<void
>
Defined in: generated/model_selection/LearningCurveDisplay.ts:117 (opens in a new tab)
from_estimator()
Create a learning curve display from an estimator.
Signature
from_estimator(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.X? | ArrayLike [] | Training data, where n\_samples is the number of samples and n\_features is the number of features. |
opts.ax? | any | Axes object to plot on. If undefined , a new figure and axes is created. |
opts.cv? | number | Determines 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? | any | Additional keyword arguments passed to the plt.errorbar used to draw mean score and standard deviation score. |
opts.estimator? | any | An object of that type which is cloned for each validation. |
opts.exploit_incremental_learning? | boolean | If the estimator supports incremental learning, this will be used to speed up fitting for different training set sizes. Default Value false |
opts.fill_between_kw? | any | Additional keyword arguments passed to the plt.fill\_between used to draw the score standard deviation. |
opts.fit_params? | any | Parameters to pass to the fit method of the estimator. |
opts.groups? | ArrayLike | Group 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? | any | Additional keyword arguments passed to the plt.plot used to draw the mean score. |
opts.log_scale? | boolean | Whether or not to use a logarithmic scale for the x-axis. Default Value false |
opts.n_jobs? | number | Number 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 (opens in a new tab) context. \-1 means using all processors. See Glossary for more details. |
opts.negate_score? | boolean | Whether or not to negate the scores obtained through learning\_curve . This is particularly useful when using the error denoted by neg\_\* in scikit-learn . Default Value false |
opts.pre_dispatch? | string | number | Number 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’. Default Value 'all' |
opts.random_state? | number | Used when shuffle is true . Pass an int for reproducible output across multiple function calls. See Glossary. |
opts.score_name? | string | The name of the score used to decorate the y-axis of the plot. If undefined , the generic "Score" name will be used. |
opts.score_type? | "both" | "test" | "train" | The type of score to plot. Can be one of "test" , "train" , or "both" . Default Value 'test' |
opts.scoring? | string | A 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? | boolean | Whether to shuffle training data before taking prefixes of it based ontrain\_sizes . Default Value false |
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. Default Value 'fill_between' |
opts.train_sizes? | ArrayLike | 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. |
opts.verbose? | number | Controls the verbosity: the higher, the more messages. Default Value 0 |
opts.y? | ArrayLike | Target relative to X for classification or regression; undefined for unsupervised learning. |
Returns
Promise
<any
>
Defined in: generated/model_selection/LearningCurveDisplay.ts:134 (opens in a new tab)
init()
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Signature
init(py: PythonBridge): Promise<void>;
Parameters
Name | Type |
---|---|
py | PythonBridge |
Returns
Promise
<void
>
Defined in: generated/model_selection/LearningCurveDisplay.ts:63 (opens in a new tab)
plot()
Plot visualization.
Signature
plot(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.ax? | any | Axes object to plot on. If undefined , a new figure and axes is created. |
opts.errorbar_kw? | any | Additional keyword arguments passed to the plt.errorbar used to draw mean score and standard deviation score. |
opts.fill_between_kw? | any | Additional keyword arguments passed to the plt.fill\_between used to draw the score standard deviation. |
opts.line_kw? | any | Additional keyword arguments passed to the plt.plot used to draw the mean score. |
opts.log_scale? | boolean | Whether or not to use a logarithmic scale for the x-axis. Default Value false |
opts.negate_score? | boolean | Whether or not to negate the scores obtained through learning\_curve . This is particularly useful when using the error denoted by neg\_\* in scikit-learn . Default Value false |
opts.score_name? | string | The name of the score used to decorate the y-axis of the plot. If undefined , the generic name “Score” will be used. |
opts.score_type? | "both" | "test" | "train" | The type of score to plot. Can be one of "test" , "train" , or "both" . Default Value 'test' |
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. Default Value 'fill_between' |
Returns
Promise
<any
>
Defined in: generated/model_selection/LearningCurveDisplay.ts:332 (opens in a new tab)