![]() ![]() train_sizes : array-like of shape (n_ticks,) Relative or absolute numbers of training examples that will be used to generate the learning curve. scoring : str or callable, default=None A str (see model evaluation documentation) or a scorer callable object / function with signature ``scorer(estimator, X, y)``. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. n_jobs : int or None, default=None Number of jobs to run in parallel. ![]() Refer :ref:`User Guide ` for the various cross-validators that can be used here. ![]() If the estimator is not a classifier or if ``y`` is neither binary nor multiclass, :class:`KFold` is used. For integer/None inputs, if ``y`` is binary or multiclass, :class:`StratifiedKFold` used. :term:`CV splitter`, - An iterable yielding (train, test) splits as arrays of indices. Possible inputs for cv are: - None, to use the default 5-fold cross-validation, - integer, to specify the number of folds. cv : int, cross-validation generator or an iterable, default=None Determines the cross-validation splitting strategy. ylim : tuple of shape (2,), default=None Defines minimum and maximum y-values plotted, e.g. axes : array-like of shape (3,), default=None Axes to use for plotting the curves. ![]() y : array-like of shape (n_samples) or (n_samples, n_features) Target relative to ``X`` for classification or regression None for unsupervised learning. X : array-like of shape (n_samples, n_features) Training vector, where ``n_samples`` is the number of samples and ``n_features`` is the number of features. Parameters - estimator : estimator instance An estimator instance implementing `fit` and `predict` methods which will be cloned for each validation. linspace ( 0.1, 1.0, 5 ), ): """ Generate 3 plots: the test and training learning curve, the training samples vs fit times curve, the fit times vs score curve. Import numpy as np import matplotlib.pyplot as plt from sklearn.naive_bayes import GaussianNB from sklearn.svm import SVC from sklearn.datasets import load_digits from sklearn.model_selection import learning_curve from sklearn.model_selection import ShuffleSplit def plot_learning_curve ( estimator, title, X, y, axes = None, ylim = None, cv = None, n_jobs = None, scoring = None, train_sizes = np. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |