Overview of scikit-learn callbacks
mainGridSearchCV to provide a high-level overview of the entire composition).repository·main·Indexed 13 days ago
https://github.com/scikit-learn/scikit-learnA Python module for machine learning and data mining built on top of SciPy, providing a wide range of supervised and unsupervised learning algorithms. It includes a callback system for monitoring training processes via regular and auto-propagated callbacks, such as ProgressBar and ScoringMonitor.
GridSearchCV to provide a high-level overview of the entire composition).The sklearn.preprocessing package contains utility functions and transformer classes designed to transform raw feature vectors into representations more suitable for downstream machine learning estimators.
Common use cases include:
The sklearn.metrics module provides functions to measure classification performance, including loss, score, and utility functions.
precision_recall_curve, roc_curve, class_likelihood_ratios, det_curve, confusion_matrix_at_thresholds.balanced_accuracy_score, cohen_kappa_score, confusion_matrix, hinge_loss, matthews_corrcoef, roc_auc_score, top_k_accuracy_score.accuracy_score, classification_report, f1_score, fbeta_score, hamming_loss, jaccard_score, log_loss, multilabel_confusion_matrix, precision_recall_fscore_support, precision_score, recall_score, roc_auc_score, zero_one_loss, d2_log_loss_score.average_precision_score.Most implementations support a sample_weight parameter to allow each sample to provide a weighted contribution to the overall score.
The sklearn.inspection module provides tools to analyze and interpret machine learning models. Instead of relying solely on evaluation metrics, you can use these tools to:
Key sub-modules for inspection include:
partial_dependence: To study the relationship between features and the predicted outcome.permutation_importance: To assess feature importance by measuring how much error increases when a feature's values are shuffled.Version 0.13 introduced several new estimator classes across different modules:
Predictors (Classifiers/Regressors):
dummy.DummyClassifier and dummy.DummyRegressor: Data-independent predictors useful for sanity-checking other estimators.linear_model.PassiveAggressiveClassifier and linear_model.PassiveAggressiveRegressor: Efficient stochastic optimization for linear models.Transformers:
decomposition.FactorAnalysis: Implements classical factor analysis.feature_extraction.FeatureHasher: Implements the "hashing trick" for fast, low-memory feature extraction from string fields.feature_extraction.text.HashingVectorizer: For text documents.pipeline.FeatureUnion: Concatenates results of several other transformers.random_projection.GaussianRandomProjection and random_projection.SparseRandomProjection: Implement Gaussian and sparse random projection matrices.kernel_approximation.Nystroem: Approximates arbitrary kernels.preprocessing.OneHotEncoder: Computes binary encodings of categorical features.ensemble.RandomTreesEmbedding: Creates high-dimensional sparse representations using ensembles of totally random trees.manifold.SpectralEmbedding: Implements "laplacian eigenmaps" for non-linear dimensionality reduction.isotonic.IsotonicRegression: Performs isotonic regression.Functions:
random_projection.johnson_lindenstrauss_min_dim: Related to random projection dimensionality.manifold.spectral_embedding: Function implementation of spectral embedding.For tasks involving data analysis and machine learning that extend beyond scikit-learn's core predictive modeling, consider the following ecosystem tools:
For specialized machine learning applications in specific fields, use these libraries:
sklearn.metrics module provides various loss, score, and utility functions specifically designed to measure the performance of clustering algorithms. Use these metrics to quantify how well your clusters represent the underlying data structure.If your goal is to build recommendation systems, these specialized libraries are available:
Latent Dirichlet Allocation (LDA) is a generative probabilistic model used for topic modeling. It is designed to discover abstract topics from a collection of discrete datasets, such as text corpora.
In the context of a text corpus, LDA assumes a generative process where:
topic_word_prior).doc_topic_prior).The goal is to use the observed words to infer the hidden (latent) topic structure.