Logo de Machine Learning Foundations

Machine Learning Foundations

Communauté
Tibsfox
machine-learning-foundations

Supervised and unsupervised learning, bias-variance tradeoff, cross-validation, decision trees, ensemble methods, neural network fundamentals, and the practitioner's workflow from problem framing through deployment. Covers classification, regression, clustering, dimensionality reduction, regularization, hyperparameter tuning, and evaluation metrics. Use when building predictive models, selecting algorithms, or understanding the machine learning pipeline.

Présentation

ÉditeurTibsfox
Dépôtgsd-skill-creator
Nom de la compétencemachine-learning-foundations
Étoiles
70
Forks
9
Fichiers inclus
Instructions uniquement
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont en simple Markdown, et non en code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Tout dans les instructions

    Tout ce dont le modèle a besoin se trouve dans les instructions : aucun fichier supplémentaire à synchroniser.

  • Open source

    Publiée par Tibsfox sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Machine Learning Foundations dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Collez l’URL du dossier de la compétence indiquée ci-dessous, puis confirmez.
    https://github.com/Tibsfox/gsd-skill-creator/tree/main/examples/skills/data-science/machine-learning-foundations
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter → Via URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Tibsfox/gsd-skill-creator.git /tmp/gsd-skill-creator
mkdir -p .claude/skills
cp -r /tmp/gsd-skill-creator/examples/skills/data-science/machine-learning-foundations .claude/skills/machine-learning-foundations
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Machine Learning Foundations dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Machine Learning Foundations dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, Machine Learning Foundations n’est pas lié au modèle pour lequel cette compétence a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

Machine Learning Foundations

Machine learning is the practice of building systems that learn patterns from data and use those patterns to make predictions or decisions on new data. Where statistical modeling (the inference culture) asks "what is the relationship between X and Y?", machine learning (the prediction culture) asks "given X, what is the best prediction of Y?" This skill covers the foundational concepts, algorithms, and workflow of machine learning from the practitioner's perspective.

Agent affinity: breiman (algorithm selection, ensemble methods), tukey (feature engineering, EDA)

Concept IDs: data-correlation, data-distributions, data-measures-of-spread, data-hypothesis-testing

The ML Workflow

StageGoalKey operations
1. Problem framingDefine the task preciselyClassification vs. regression vs. clustering; define target variable and success metric
2. Data collectionAssemble training dataSources, sampling, labeling; ensure data represents the deployment population
3. Feature engineeringCreate informative inputsDomain-driven features, transformations, encoding categoricals
4. Train/test splitPrevent overfitting evaluationHold out 20-30% for testing; never touch test set during development
5. Model selectionChoose algorithm familyBased on data size, interpretability needs, problem structure
6. TrainingFit model parametersOptimization (gradient descent, tree splitting, etc.)
7. ValidationTune hyperparametersk-fold cross-validation on training set only
8. EvaluationAssess on held-out test setMetrics appropriate to the problem (accuracy, F1, RMSE, etc.)
9. InterpretationUnderstand what the model learnedFeature importance, partial dependence, SHAP values
10. DeploymentPut the model in productionMonitoring, drift detection, retraining schedule

Supervised Learning

Classification

The task: given features X, predict a categorical label y.

Key algorithms:

AlgorithmStrengthsWeaknessesWhen to use
Logistic regressionInterpretable, fast, probabilisticLinear decision boundaryBaseline; when interpretability matters
k-Nearest NeighborsNon-parametric, no training phaseSlow at prediction, curse of dimensionalitySmall datasets, low dimensionality
Decision treeInterpretable, handles mixed typesOverfits easily, unstableWhen interpretability is paramount; as building block for ensembles
Random forestRobust, handles high dimensionsLess interpretable than single treeDefault for tabular data
Gradient boostingState-of-the-art tabular performanceProne to overfitting without tuningCompetition-grade tabular prediction
SVMEffective in high dimensionsSlow on large datasets, kernel choiceText classification, small-medium datasets
Neural networkLearns complex patterns, scales to huge dataRequires large data, expensive, black boxImages, text, sequences, very large datasets

Regression

The task: given features X, predict a continuous value y.

Same algorithms apply (linear regression, k-NN regression, decision tree regression, random forest regression, gradient boosting regression, neural network regression). The loss function changes from cross-entropy to squared error (or absolute error, Huber loss, etc.).

Evaluation Metrics

Classification:

MetricFormula / DefinitionWhen to use
AccuracyCorrect / TotalBalanced classes only
PrecisionTP / (TP + FP)Cost of false positives is high (spam detection)
RecallTP / (TP + FN)Cost of false negatives is high (cancer screening)
F1 score2 * Precision * Recall / (Precision + Recall)Need balance between precision and recall
ROC-AUCArea under ROC curveRanking quality across thresholds
Log lossNegative log-likelihood of predicted probabilitiesWhen calibrated probabilities matter

Regression:

MetricFormula / DefinitionWhen to use
MSEMean of (y - y_hat)^2Default; penalizes large errors
RMSEsqrt(MSE)Same scale as y; more interpretable
MAEMean ofy - y_hat
R-squared1 - (SS_res / SS_tot)Proportion of variance explained
MAPEMean ofy - y_hat

The Bias-Variance Tradeoff

The expected prediction error decomposes into three components:

Error = Bias^2 + Variance + Irreducible noise

  • Bias: Error from oversimplifying the model. A linear model fit to a quadratic relationship has high bias (underfitting).
  • Variance: Error from model sensitivity to training data. A deep decision tree memorizes the training set and varies wildly across samples (overfitting).
  • Irreducible noise: Inherent randomness in the data. No model can reduce this.

The tradeoff: Increasing model complexity reduces bias but increases variance. Decreasing complexity reduces variance but increases bias. The optimal model balances both.

Regularization controls this tradeoff by penalizing complexity:

MethodPenaltyEffect
Ridge (L2)Sum of beta_j^2Shrinks coefficients toward zero; keeps all predictors
Lasso (L1)Sum ofbeta_j
Elastic netAlpha * L1 + (1 - Alpha) * L2Combines ridge and lasso benefits
Tree depth limitMax depth, min samples per leafPrevents tree from memorizing noise
DropoutRandomly zero out neurons during trainingPrevents neural network co-adaptation
Early stoppingStop training when validation error increasesUniversal; works for any iterative algorithm

Cross-Validation

Cross-validation estimates out-of-sample performance using only the training data.

k-Fold Cross-Validation

  1. Split training data into k equal folds (k = 5 or 10 is standard).
  2. For each fold i: train on all folds except i, evaluate on fold i.
  3. Average performance across all k evaluations.
  4. Use this average to select hyperparameters.

Critical Rules

  • Never use test data for any decision during training. The test set is opened exactly once, at the very end.
  • Stratified k-fold for classification. Preserve class proportions in each fold.
  • Group k-fold for grouped data. If observations belong to groups (e.g., multiple images from the same patient), all observations from a group must be in the same fold.
  • Time series split for temporal data. Training set always precedes validation set in time. No random shuffling.

Decision Trees

How They Work

A decision tree recursively partitions the feature space by choosing splits that maximize information gain (classification) or minimize mean squared error (regression).

Splitting criteria for classification:

  • Gini impurity: G = 1 - sum(p_k^2). Measures probability of misclassification.
  • Entropy: H = -sum(p_k * log(p_k)). Information-theoretic measure of impurity.
  • In practice: Gini and entropy produce nearly identical trees. Gini is slightly faster to compute.

Controlling complexity:

ParameterEffect
Max depthLimits tree height; primary regularization lever
Min samples splitMinimum observations to attempt a split
Min samples leafMinimum observations in a terminal node
Max featuresNumber of features considered at each split (critical for random forests)

Why Single Trees Overfit

A fully grown tree achieves 100% training accuracy by creating one leaf per observation. This is pure memorization. The tree's variance is enormous -- small changes in training data produce completely different trees. This instability is why ensemble methods exist.

Ensemble Methods

Bagging (Bootstrap Aggregating)

Train multiple models on bootstrap samples (random samples with replacement) and average their predictions. Reduces variance without increasing bias.

Random forest = bagging + random feature subsets at each split. The feature randomization decorrelates the trees, making the average more effective. Random forests are the default algorithm for tabular data because they work well out of the box with minimal tuning.

Boosting

Train models sequentially, with each new model correcting the errors of the previous ensemble:

  • AdaBoost: Reweights misclassified observations. Simple but sensitive to outliers.
  • Gradient boosting: Fits each new tree to the residuals (negative gradient of the loss function). More general and powerful.
  • XGBoost / LightGBM / CatBoost: Optimized gradient boosting implementations with regularization, parallel training, and categorical handling. State-of-the-art for tabular data competitions.

Bagging vs. Boosting

PropertyBagging (Random Forest)Boosting (Gradient Boosting)
ReducesVarianceBias (primarily) + variance
TrainingParallel (fast)Sequential (slower)
Overfitting riskLowHigher without tuning
Tuning effortMinimalSignificant (learning rate, depth, iterations)
Default choiceYes, for most tabular problemsWhen you need maximum performance and will tune

Unsupervised Learning

Clustering

Grouping observations without labels.

AlgorithmAssumptionStrengthsWeaknesses
k-MeansSpherical, equal-size clustersFast, scalableMust specify k; sensitive to initialization
DBSCANDensity-based clustersFinds arbitrary shapes, handles noiseSensitive to epsilon and min_samples parameters
HierarchicalNested cluster structureDendrogram visualization, no k neededO(n^2) or worse; not for large datasets
Gaussian MixtureElliptical clustersSoft assignments (probabilities)Must specify k; can converge to local optima

Choosing k: Elbow method (plot inertia vs. k), silhouette scores, domain knowledge. There is no universally correct k -- clustering is exploratory, not definitive.

Dimensionality Reduction

MethodLinear?PreservesUse when
PCAYesGlobal varianceHigh-dimensional data, preprocessing for modeling
t-SNENoLocal neighbor structure2D/3D visualization of high-dimensional data
UMAPNoLocal + some global structureFaster than t-SNE, better global structure

Neural Networks Introduction

Architecture

A neural network is a composition of linear transformations and non-linear activations:

output = f_L(W_L * f_{L-1}(W_{L-1} * ... f_1(W_1 * x + b_1) ... + b_{L-1}) + b_L)

  • Input layer: Feature vector x.
  • Hidden layers: Each applies a linear transformation (W * x + b) followed by an activation function (ReLU, sigmoid, tanh).
  • Output layer: Sigmoid for binary classification, softmax for multiclass, linear for regression.

Training

  • Loss function: Cross-entropy (classification), MSE (regression).
  • Optimization: Stochastic gradient descent (SGD) and variants (Adam, RMSProp).
  • Backpropagation: Chain rule applied to compute gradients through the network.
  • Batch size: Mini-batches (32-256) balance noise and computation.
  • Learning rate: Most important hyperparameter. Too high -> divergence. Too low -> slow convergence.

When to Use Neural Networks

Neural networks excel when data is large (>100K samples), structured (images, text, sequences), and the relationship is highly non-linear. For tabular data with <10K samples, gradient boosting typically wins. Neural networks are not magic -- they are function approximators that need sufficient data to justify their complexity.

Common Mistakes

MistakeWhy it failsFix
Data leakageFuture information in training featuresAudit every feature for temporal leakage
Not holding out a test setReported performance is overly optimisticSplit before any modeling decisions
Using accuracy on imbalanced data95% accuracy is trivial when 95% of data is one classUse F1, precision-recall, or balanced accuracy
Tuning on the test setTest performance becomes optimisticTune on validation/CV only; test set opened once
Feature scaling mismatchFit scaler on full data, including testFit scaler on training data only, transform test with same scaler
Ignoring class imbalanceModel predicts majority class for everythingOversampling (SMOTE), class weights, or threshold adjustment

Cross-References

  • breiman agent: Algorithm selection, random forests, and the "two cultures" perspective on prediction vs. inference.
  • tukey agent: Exploratory analysis and feature engineering that precede model training.
  • cairo agent: Communicating model results through visualization -- feature importance plots, partial dependence, calibration curves.
  • statistical-modeling skill: The inference-focused counterpart to this prediction-focused skill.
  • data-wrangling skill: Data preparation pipeline that produces training-ready features.
  • ethics-governance skill: Algorithmic bias, fairness metrics, and responsible deployment of ML models.

References

  • Breiman, L. (2001). "Random Forests." Machine Learning, 45(1), 5-32.
  • Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning. 2nd edition. Springer.
  • James, G., Witten, D., Hastie, T., & Tibshirani, R. (2021). An Introduction to Statistical Learning. 2nd edition. Springer.
  • Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
  • Chen, T. & Guestrin, C. (2016). "XGBoost: A Scalable Tree Boosting System." Proceedings of KDD, 785-794.

Foire aux questions

À quoi sert la compétence IA Machine Learning Foundations ?

Supervised and unsupervised learning, bias-variance tradeoff, cross-validation, decision trees, ensemble methods, neural network fundamentals, and the practitioner's workflow from problem framing through deployment. Covers classification, regression, clustering, dimensionality reduction, regularization, hyperparameter tuning, and evaluation metrics. Use when building predictive models, selecting algorithms, or understanding the machine learning pipeline.

Pourquoi utiliser Machine Learning Foundations sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Machine Learning Foundations se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Machine Learning Foundations dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/Tibsfox/gsd-skill-creator/tree/main/examples/skills/data-science/machine-learning-foundations. TypingMind lit le fichier SKILL.md et l’installe sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Machine Learning Foundations ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Machine Learning Foundations ?

Autant que vous le souhaitez. Tant qu’un modèle prend en charge les compétences, vous pouvez utiliser Machine Learning Foundations avec lui : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Machine Learning Foundations est-elle gratuite ?

Cette compétence est publiée sur GitHub par Tibsfox. Consultez le dépôt pour connaître les conditions de licence. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, modèles de documents ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇