
scikit-learn: machine learning in Python — scikit-learn 1.6.1 …
Preprocessing. Feature extraction and normalization. Applications: Transforming input data such as text for use with machine learning algorithms. Algorithms: Preprocessing, feature extraction, and more...
top_k_accuracy_score — scikit-learn 1.6.1 documentation
top_k_accuracy_score# sklearn.metrics. top_k_accuracy_score (y_true, y_score, *, k = 2, normalize = True, sample_weight = None, labels = None) [source] # Top-k Accuracy classification score. This metric computes the number of times where the correct label is among the top k labels predicted (ranked by predicted scores). Note that the multilabel case isn’t covered here.
Examples — scikit-learn 1.6.1 documentation
Examples#. This is the gallery of examples that showcase how scikit-learn can be used. Some examples demonstrate the use of the API in general and some demonstrate specific applications in tutorial form. Also check out our user guide for more detailed illustrations.
accuracy_score — scikit-learn 1.6.1 documentation
accuracy_score# sklearn.metrics. accuracy_score (y_true, y_pred, *, normalize = True, sample_weight = None) [source] # Accuracy classification score. In multilabel classification, this function computes subset accuracy: the set of labels predicted for a sample must exactly match the corresponding set of labels in y_true.. Read more in the User Guide.. Parameters
User Guide — scikit-learn 1.6.1 documentation
Supervised learning- Linear Models- Ordinary Least Squares, Ridge regression and classification, Lasso, Multi-task Lasso, Elastic-Net, Multi-task Elastic-Net, Least Angle Regression, LARS Lasso, Or...
normalize — scikit-learn 1.6.1 documentation
normalize# sklearn.preprocessing. normalize (X, norm = 'l2', *, axis = 1, copy = True, return_norm = False) [source] # Scale input vectors individually to unit norm (vector length). Read more in the User Guide.. Parameters: X {array-like, sparse matrix} of shape (n_samples, n_features). The data to normalize, element by element. scipy.sparse matrices should be …
OneHotEncoder — scikit-learn 1.6.1 documentation
drop {‘first’, ‘if_binary’} or an array-like of shape (n_features,), default=None. Specifies a methodology to use to drop one of the categories per feature. This is useful in situations where perfectly collinear features cause problems, such as when feeding the resulting data into an unregularized linear regression model.
SVR — scikit-learn 1.6.1 documentation
SVR# class sklearn.svm. SVR (*, kernel = 'rbf', degree = 3, gamma = 'scale', coef0 = 0.0, tol = 0.001, C = 1.0, epsilon = 0.1, shrinking = True, cache_size = 200, verbose = False, max_iter =-1) [source] #. Epsilon-Support Vector Regression. The free parameters in the model are C and epsilon. The implementation is based on libsvm. The fit time complexity is more than quadratic with the number ...
cross_val_score — scikit-learn 1.6.1 documentation
n_jobs int, default=None. Number of jobs to run in parallel. Training the estimator and computing the score are parallelized over the cross-validation splits. None means 1 unless in a joblib.parallel_backend context.-1 means using all processors. See Glossary for more details.. verbose int, default=0. The verbosity level.
Support Vector Regression (SVR) using linear and non-linear kernels
Toy example of 1D regression using linear, polynomial and RBF kernels. Generate sample data: Fit regression model: Look at the results: Total running time of the script:(0 minutes 0.409 seconds) La...