机器学习:中英双语指南
2026/8/3 20:35:49 · 更新于 2026/8/3 20:38:24
一份涵盖学习范式、任务类型、算法家族与生产系统的四层架构双语指南,系统梳理了监督/无监督/强化学习的边界、分类回归指标匹配逻辑及工程化部署要点。
机器学习:中英双语指南
Validation status / 复核结论: The original explanation was broadly correct and well structured. This edition corrects several boundary cases, sharpens algorithm-selection guidance, and distinguishes learning paradigms, task types, model families, and deployment requirements.
原说明整体正确、结构完整。本修订版进一步纠正边界问题,并明确区分学习范式、任务类型、模型家族及生产部署条件。
1. The most important distinction / 最重要的概念区分
Machine learning should not be organized as one flat list. Four different layers are involved:
机器学习不能被理解成一个平铺的算法清单,而应分成四个层次:
- Learning paradigm / 学习范式 — how the model receives feedback.
- Task type / 任务类型 — what output the model must produce.
- Algorithm or model family / 算法或模型家族 — how the relationship is learned.
- Operational system / 生产系统 — how the model is evaluated, deployed, monitored, and used.
The basic pipeline is:
Business question → Learning paradigm → Task → Algorithm → Evaluation → Deployment → Monitoring
业务问题 → 学习范式 → 任务类型 → 算法选择 → 评估 → 部署 → 监控
Examples:
- Supervised learning / 监督学习 is a learning paradigm.
- Classification / 分类 is a task.
- Random forest / 随机森林 is an algorithm family.
- F1, calibration, latency, and drift monitoring / F1、概率校准、延迟和漂移监控 are evaluation and operational concerns.
One algorithm can solve several tasks. Random forests support classification and regression. Neural networks can support classification, regression, generation, representation learning, and reinforcement learning.
同一算法可以解决多种任务。例如随机森林可以分类,也可以回归;神经网络可以用于分类、回归、生成、表示学习及强化学习。
2. Learning paradigms / 学习范式
| Paradigm 学习范式 | Feedback/data 数据与反馈 | Main purpose 主要目的 | Typical uses 典型用途 |
|---|---|---|---|
| Supervised learning 监督学习 | Labeled examples 有标签样本 | Learn input-to-target mapping 学习输入到目标的映射 | Classification, regression, ranking 分类、回归、排序 |
| Unsupervised learning 无监督学习 | Unlabeled data 无标签数据 | Discover structure or representations 发现结构或表示 | Clustering, dimensionality reduction 聚类、降维 |
| Semi-supervised learning 半监督学习 | Few labels plus many unlabeled examples 少量标签和大量无标签数据 | Improve a supervised task with unlabeled data 利用无标签数据改善监督任务 | Image, text, medical classification 图像、文本、医疗分类 |
| Self-supervised learning 自监督学习 | Targets generated from raw data 从原始数据构造训练目标 | Learn reusable representations 学习可复用表示 | LLM and vision pretraining 大语言模型及视觉预训练 |
| Reinforcement learning 强化学习 | Rewards from interaction 交互产生的奖励 | Learn sequential decisions 学习连续决策 | Control, games, scheduling 控制、游戏、调度 |
| Active learning 主动学习 | Model requests selected labels 模型选择需要人工标注的样本 | Reduce labeling cost 降低标注成本 | Expert document or image review 专业文档或影像标注 |
| Online learning 在线学习 | Data arrives continuously 数据持续到达 | Adapt incrementally 持续更新与适应 | Fraud, recommendation, streaming 欺诈、推荐、数据流 |
| Transfer learning 迁移学习 | Knowledge from a pretrained model 使用预训练知识 | Adapt to a related task 迁移到相关任务 | NLP, vision, speech NLP、视觉、语音 |
| Federated learning 联邦学习 | Training remains distributed 训练数据保持分散 | Learn without centralizing raw data 不集中原始数据完成训练 | Mobile, healthcare, cross-organization 手机、医疗、跨机构 |
These categories can overlap. A system may use self-supervised pretraining, supervised fine-tuning, active labeling, and online monitoring in the same lifecycle.
这些范式并非互斥。一个系统可以先进行自监督预训练,再做监督微调,同时采用主动标注,并在部署后进行在线监控。
3. Supervised learning / 监督学习
Supervised data contain input features (X) and known targets (y):
监督学习数据包含特征 (X) 和已知目标 (y):
[ f(X) \rightarrow y ]
3.1 Classification / 分类
Classification predicts discrete categories or class probabilities.
分类用于预测离散类别或类别概率。
| Form 类型 | Example 示例 |
|---|---|
| Binary classification 二分类 | Win/not win; fraud/not fraud 中标/未中标;欺诈/非欺诈 |
| Multiclass classification 多分类 | Cat, dog, or bird 猫、狗或鸟 |
| Multilabel classification 多标签分类 | One contract covers IT, cyber, and logistics 一份合同同时涉及IT、网络安全及物流 |
| Ordinal classification 序数分类 | Low, medium, high risk 低、中、高风险 |
Common algorithms / 常用算法
| Algorithm 算法 | Strong use cases 适用场景 | Conditions for effective training 有效训练条件 | Main limitations 主要局限 |
|---|---|---|---|
| Logistic regression 逻辑回归 | Explainable binary or multiclass business models 可解释业务分类 | Appropriate encoding; limited severe multicollinearity; linear decision structure in transformed feature space 正确编码;控制严重共线性;变换后的特征空间近似线性 | Misses complex interactions without feature engineering 无法自动学习复杂交互 |
| Decision tree 决策树 | Human-readable rules, mixed nonlinear effects 可读规则、混合非线性关系 | Control depth, leaf size, and pruning 控制深度、叶节点样本量及剪枝 | Unstable and easily overfits 不稳定且容易过拟合 |
| Random forest 随机森林 | Robust tabular baseline, nonlinear interactions 稳健的表格基线、非线性交互 | Enough diverse samples; tune depth, leaf size, and number of trees 足够且多样的数据;调节深度、叶节点及树数 | Larger and less directly interpretable than one tree 模型较大、解释性弱于单树 |
| Gradient-boosted trees 梯度提升树 | Often top-performing on structured/tabular data 结构化表格数据常表现优秀 | Validation, early stopping, careful learning rate/depth tuning 验证集、早停、谨慎调整学习率和深度 | Sensitive to tuning and leakage 对调参及数据泄漏敏感 |
| XGBoost/LightGBM/CatBoost | Large or complex tabular datasets 大型或复杂表格数据 | Clean split; correct missing/categorical handling; class imbalance strategy 正确拆分;处理缺失值和类别变量;处理类别不平衡 | Not normally the first choice for raw images, audio, or long text 通常不是原始图像、音频或长文本的首选 |
| Support Vector Machine (SVM) 支持向量机 | Medium-sized high-dimensional data, text features 中等规模高维数据、文本特征 | Scale features; tune kernel and regularization 特征缩放;选择核函数和正则化 | Kernel SVM scales poorly to very large datasets 核SVM不适合超大数据 |
| K-nearest neighbors (KNN) K近邻 | Small datasets and similarity-based decisions 小数据及相似案例判断 | Meaningful distance; feature scaling; manageable dimensionality 距离具有意义;特征缩放;维度不能过高 | Slow inference and curse of dimensionality 推理慢、受维度灾难影响 |
| Naive Bayes 朴素贝叶斯 | Spam, document and token-count classification 垃圾邮件、文档和词频分类 | Distributional assumptions roughly useful; informative token statistics 分布假设具有一定合理性;词项统计有区分度 | Independence assumption is often unrealistic 独立性假设通常不完全成立 |
| Neural networks 神经网络 | Images, speech, text, complex high-dimensional data 图像、语音、文本和复杂高维数据 | Large data or suitable pretrained model; compute; regularization; careful validation 大数据或合适预训练模型;算力;正则化;严格验证 | Cost, tuning complexity, limited transparency 成本高、调参复杂、透明度有限 |
Classification metrics / 分类指标
| Metric 指标 | Meaning 含义 | Best used when 适用情况 |
|---|---|---|
| Accuracy 准确率 | Fraction of all predictions correct 总体预测正确比例 | Classes and error costs are reasonably balanced 类别及错误成本较均衡 |
| Precision 精确率 | Of predicted positives, how many are correct 预测为正的样本中多少为真 | False positives are costly 误报成本高 |
| Recall/Sensitivity 召回率/敏感度 | Of actual positives, how many are found 真实正类中发现多少 | False negatives are costly 漏报成本高 |
| Specificity 特异度 | Of actual negatives, how many are rejected correctly 真实负类中正确排除多少 | Negative-class control matters 需要控制负类误判 |
| F1 score | Harmonic balance of precision and recall 精确率与召回率的调和平衡 | Imbalanced classes and both errors matter 类别不平衡且两种错误均重要 |
| ROC-AUC | Ranking ability across thresholds 跨阈值的整体排序能力 | General discrimination comparison 一般区分能力比较 |
| PR-AUC | Precision-recall performance across thresholds 跨阈值精确率—召回率表现 | Positive class is rare 正类稀少 |
| Log loss | Quality and confidence of predicted probabilities 概率预测的质量与置信度 | Probability quality matters 需要可靠概率 |
| Brier score | Mean squared error of probabilities 概率的均方误差 | Calibration and risk decisions 概率校准及风险决策 |
For a contract-win model, precision matters when bids are expensive and resources must be concentrated; recall matters when missing a viable opportunity is costly. If the model reports “70% chance of winning,” probability calibration must also be tested.
对于合同中标模型,如果投标成本高、资源需要集中,Precision更重要;如果漏掉可行机会的代价高,Recall更重要。如果模型输出“70%中标概率”,还必须检验概率校准。
3.2 Regression / 回归
Regression predicts a continuous number, such as cost, demand, duration, or contract value.
回归预测连续数值,例如成本、需求量、工期或合同金额。
| Algorithm 算法 | Best use 适用场景 | Effective conditions 有效条件 | Limitation 局限 |
|---|---|---|---|
| Linear regression 线性回归 | Explainable linear effects 可解释线性关系 | Approximate linearity; controlled multicollinearity; residual diagnostics 近似线性;控制共线性;检查残差 | Weak on complex nonlinear structure 不擅长复杂非线性结构 |
| Ridge 岭回归 | Many correlated predictors 多个相关特征 | Standardize features; tune L2 penalty 特征标准化;调节L2惩罚 | Retains most predictors 通常保留多数特征 |
| Lasso | Sparse model and feature selection 稀疏模型及特征选择 | Standardize; tune L1 penalty 特征标准化;调节L1惩罚 | Can select arbitrarily among correlated features 可能在相关特征间任意选择 |
| Elastic Net 弹性网络 | High-dimensional correlated predictors 高维相关特征 | Tune L1/L2 mixture 调节L1/L2组合 | More tuning complexity 调参更复杂 |
| Tree ensembles 树集成 | Nonlinear tabular prediction 非线性表格预测 | Sufficient examples; validation and leakage control 足够样本;严格验证和防泄漏 | Poor extrapolation beyond observed range 通常不擅长超出训练范围外推 |
| Support Vector Regression | Medium-sized nonlinear regression 中型非线性回归 | Scale features/target; tune kernel 特征及目标缩放;调节核函数 | Poor scaling to large data 大数据扩展性差 |
| Neural-network regression | Complex, high-dimensional inputs 复杂高维输入 | Large data/pretraining; regularization; stable targets 大数据/预训练;正则化;目标稳定 | High cost and lower interpretability 成本高且解释性低 |
| Quantile regression 分位数回归 | Prediction intervals and asymmetric risk 预测区间及非对称风险 | Enough data at relevant quantiles; evaluate coverage 相关分位数有足够数据;评估覆盖率 | Multiple quantiles may require extra constraints 多分位数可能需要额外约束 |
Common metrics include MAE, MSE, RMSE, (R^2), MAPE, and pinball loss. MAPE becomes unstable when actual values are zero or close to zero. (R^2) alone does not prove accuracy, causality, or operational usefulness.
常见指标包括MAE、MSE、RMSE、(R^2)、MAPE及Pinball Loss。真实值为零或接近零时,MAPE会失真;单独的(R^2)不能证明模型准确、具有因果性或具备业务价值。
3.3 Ranking / 排序学习
Ranking predicts relative order rather than a standalone category. It is useful for contract-opportunity prioritization, search, recommendations, candidate retrieval, and risk triage.
排序学习预测对象的相对顺序,而不是单独类别。适用于合同机会优先级、搜索、推荐、候选对象检索及风险排序。
Common models include RankNet, LambdaRank, LambdaMART, pairwise ranking, and boosted-tree ranking. Training requires query/user/task groups and relevance or preference labels. Evaluate with NDCG, MAP, or MRR. Historical click data require correction for exposure and position bias.
常用模型包括RankNet、LambdaRank、LambdaMART、成对排序及提升树排序。训练需要查询、用户或任务分组,以及相关性或偏好标签。通常使用NDCG、MAP或MRR评估;历史点击数据还要控制曝光偏差和位置偏差。
3.4 Time-series forecasting / 时间序列预测
Time order must be preserved. Typical applications include budget execution, expenditure, inventory, demand, staffing, and server-load forecasts.
时间顺序必须保留。典型应用包括预算执行、支出、库存、需求、人员及服务器负载预测。
| Model 模型 | Appropriate use 适用情况 | Conditions 条件 |
|---|---|---|
| Naive/seasonal naive 朴素/季节朴素 | Mandatory baseline 必须建立的基线 | Persistence or seasonality exists 存在持续性或季节性 |
| Exponential smoothing 指数平滑 | Level, trend, seasonal components 水平、趋势及季节成分 | Patterns are reasonably stable 模式相对稳定 |
| ARIMA/SARIMA | Linear autocorrelation and seasonality 线性自相关及季节性 | Stationarity assumptions handled; residuals checked 处理平稳性并检查残差 |
| Prophet | Interpretable trend, multiple seasonalities, holidays 可解释趋势、多季节性及节假日 | Useful structure and enough history; must beat baselines 结构合适且历史足够;必须与基线比较 |
| Gradient boosting 梯度提升 | Many external predictors and engineered lags 多个外部变量及滞后特征 | Leakage-free lag/rolling/calendar features 无泄漏的滞后、滚动及日历特征 |
| LSTM/GRU/Transformers | Large multi-series or complex sequence settings 大规模多序列或复杂序列 | Enough independent sequences, compute, and careful backtesting 足够独立序列、算力及严格回测 |
Use walk-forward or rolling-origin validation. A random row split usually leaks temporal information. Every feature must be available at the actual forecast time. More complex deep models do not automatically beat seasonal baselines or boosted trees.
应使用Walk-forward或Rolling-origin验证。随机拆分行通常造成时间泄漏。所有特征必须在真实预测时点可获得。复杂深度模型不会自动优于季节基线或提升树。
3.5 Other supervised tasks / 其他监督任务
- Survival analysis / 生存分析: predicts time to an event while handling censored observations; examples include equipment failure, attrition, and project delay. Models include Cox regression and random survival forests.
- Structured prediction / 结构化预测: produces sequences or structured outputs, such as named entities, translations, speech transcripts, image segmentation, or document fields. Models include CRFs, transformers, and U-Net-style architectures.
- Count modeling / 计数建模: predicts event counts with Poisson, negative-binomial, or related models when ordinary regression assumptions are unsuitable.
4. Unsupervised learning / 无监督学习
Unsupervised learning discovers structure without human-provided targets. Results generally require stronger domain interpretation because there is no definitive label-based accuracy score.
无监督学习在没有人工目标标签的情况下发现结构。由于不存在天然的标签准确率,结果通常更依赖领域解释。
4.1 Clustering / 聚类
| Algorithm 算法 | Best fit 最适合情况 | Required conditions 关键条件 | Limitation 局限 |
|---|---|---|---|
| K-means | Roughly compact, similar-scale clusters 近似紧凑且尺度相近的群组 | Numeric scaling; choose K; manage outliers 数值缩放;选择K;处理异常值 | Poor for irregular shapes, unequal density, categorical data 不适合不规则形状、密度差异或类别数据 |
| Hierarchical clustering 层次聚类 | Smaller datasets and hierarchy 小型数据及层级关系 | Meaningful distance/linkage; scaling 合理距离和连接方法;缩放 | Expensive at large scale 大数据计算昂贵 |
| DBSCAN | Irregular clusters with noise 含噪声的不规则群组 | Meaningful neighborhood radius; comparable density 合理邻域半径;密度较接近 | Difficult with varying density or high dimension 密度差异或高维数据困难 |
| HDBSCAN | Variable-density structure and noise 密度变化及噪声 | Meaningful local density; sufficient samples 合理局部密度;样本足够 | More complex interpretation 解释较复杂 |
| Gaussian mixture 高斯混合 | Overlapping probabilistic clusters 重叠的概率群组 | Distributional approximation and component selection 分布近似合理并选择成分数 | Sensitive to initialization and outliers 对初始化和异常值敏感 |
| K-modes/K-prototypes | Categorical or mixed data 类别型或混合数据 | Suitable dissimilarity and feature weighting 合理差异度与特征权重 | Requires cluster count and careful weighting 需要预设群数并谨慎加权 |
Silhouette, Davies–Bouldin, and Calinski–Harabasz scores assess geometric properties, not whether the clusters are real business segments. Validate stability, interpretability, reproducibility, and downstream usefulness.
Silhouette、Davies–Bouldin及Calinski–Harabasz衡量的是几何结构,不能证明群组是真实业务分群。还必须验证稳定性、可解释性、可重复性及下游价值。
4.2 Dimensionality reduction / 降维
| Method 方法 | Use 用途 | Important caution 重要注意事项 |
|---|---|---|
| PCA | Linear compression and decorrelation 线性压缩及去相关 | Scale when units differ; components may be hard to interpret 单位不同时需缩放;主成分解释较难 |
| Truncated SVD | Sparse text matrices 稀疏文本矩阵 | Often used without centering 通常不中心化 |
| t-SNE | Local-neighborhood visualization 局部邻域可视化 | Distances and cluster sizes in the plot are not globally reliable 图中全局距离和群组大小不一定可靠 |
| UMAP | Visualization and nonlinear embeddings 可视化和非线性嵌入 | Results depend on neighbors, distance, and random seed 结果依赖邻居数、距离及随机种子 |
| Autoencoder 自动编码器 | Nonlinear compression 非线性压缩 | Needs enough data and validation of representation usefulness 需要足够数据并验证表示是否有用 |
4.3 Anomaly detection / 异常检测
Anomaly detection is a task, not exclusively an unsupervised paradigm. It may be:
异常检测是一种任务,并不专属于无监督学习。它可以是:
- supervised, when reliable anomaly labels exist;
- semi-supervised or one-class, when mostly normal examples are available;
- unsupervised, when labels do not exist.
| Method 方法 | Suitable use 适用情况 | Requirement 要求 |
|---|---|---|
| Z-score/IQR | Simple univariate screening 简单单变量筛查 | Stable, understood distribution 稳定且可理解的分布 |
| Isolation Forest | Tabular anomalies 表格异常 | Rare anomalies separable by random partition 异常稀少且易被随机分割隔离 |
| One-Class SVM | Boundary of normal cases 正常样本边界 | Scaled data and manageable size 缩放后的中小规模数据 |
| Local Outlier Factor | Local-density anomalies 局部密度异常 | Meaningful neighborhoods 合理邻域定义 |
| Autoencoder | Complex images/sequences/patterns 复杂图像、序列及模式 | Abundant representative normal data 大量且有代表性的正常数据 |
An unusual record is not automatically fraud, error, or wrongdoing. The model flags deviation; investigation establishes meaning.
异常记录并不自动等于欺诈、错误或违规。模型只负责发现偏离,业务调查才能确定含义。
4.4 Association rules and topic discovery / 关联规则与主题发现
Association-rule methods such as Apriori and FP-Growth identify frequent co-occurrence. Key measures are support, confidence, and lift:
Apriori、FP-Growth等关联规则方法识别高频共现。关键指标包括支持度、置信度和提升度:
[ Support(A\rightarrow B)=P(A\cap B) ]
[ Confidence(A\rightarrow B)=P(B|A) ]
[ Lift(A\rightarrow B)=\frac{P(B|A)}{P(B)} ]
Association is not causation. High-confidence rules can simply reflect a very common item.
关联不等于因果。高置信度规则可能只是因为某项目本身非常常见。
Topic discovery methods include LDA, NMF, BERTopic, and embedding-plus-clustering pipelines. Good tokenization, sufficient documents, multilingual support, stable topics, and expert interpretation are required.
主题发现可采用LDA、NMF、BERTopic或“嵌入+聚类”。需要良好分词、足够文档、多语言支持、稳定主题及专家解释。
5. Semi-supervised and self-supervised learning / 半监督与自监督学习
Semi-supervised learning / 半监督学习
Use it when labels are expensive but unlabeled data are abundant and come from a distribution similar to deployment data. Methods include pseudo-labeling, self-training, label propagation, consistency regularization, FixMatch, and MixMatch.
当标签昂贵、无标签数据丰富且与部署数据分布相近时,可使用半监督学习。常用方法包括伪标签、自训练、标签传播、一致性正则化、FixMatch及MixMatch。
Success requires:
- A representative labeled seed set / 有代表性的初始标签集。
- A fully human-labeled holdout test set / 完全由人工标注的独立测试集。
- Confidence thresholds and class-balance checks / 置信度阈值与类别平衡检查。
- Monitoring for confirmation bias / 监控确认偏差。
- Similarity between unlabeled and deployment distributions / 无标签数据与部署数据分布相似。
Self-supervised learning / 自监督学习
Self-supervised learning creates targets from raw data: next-token prediction, masked-token reconstruction, contrastive learning, masked-image reconstruction, or speech-segment prediction. It powers much of modern LLM, vision, and speech pretraining.
自监督学习从原始数据自动构造训练目标,例如下一Token预测、遮挡Token重建、对比学习、遮挡图像重建或语音片段预测,是现代LLM、视觉及语音预训练的重要基础。
Effective pretraining requires broad, representative, cleaned data; a suitable objective; sufficient model capacity and compute; deduplication; and privacy, copyright, bias, and safety controls. The pretrained representation still needs task-specific evaluation and often prompting, retrieval, adapters, or fine-tuning.
有效预训练需要广泛、代表性强且经过清理的数据,合适的训练目标,足够的模型容量与算力,数据去重,以及隐私、版权、偏见和安全控制。预训练后仍需进行具体任务评估,并可能配合提示、检索、适配器或微调。
6. Reinforcement learning / 强化学习
Reinforcement learning learns a policy through interaction. It is most appropriate when actions affect future states and rewards—not merely when a labeled prediction is needed.
强化学习通过与环境交互学习策略。只有当行动会影响未来状态和奖励时才特别适合;如果只需要有标签预测,通常无需强化学习。
Core concepts are agent, environment, state, action, reward, policy, value, exploration, and exploitation. The objective is commonly a discounted return:
核心概念包括智能体、环境、状态、动作、奖励、策略、价值、探索和利用。目标通常是最大化折扣累计回报:
[ G_t=\sum_{k=0}^{\infty}\gamma^k r_{t+k+1} ]
| Algorithm family 算法家族 | Appropriate scenario 适用场景 |
|---|---|
| Multi-armed/contextual bandits 多臂/上下文老虎机 | Repeated selection with limited state effects 重复选择且行动对长期状态影响有限 |
| Q-learning/SARSA | Small discrete state-action spaces 小型离散状态—动作空间 |
| DQN | High-dimensional state, discrete actions 高维状态、离散动作 |
| Policy gradients/Actor–Critic | Stochastic or continuous policies 随机或连续策略 |
| PPO | General policy optimization, including some LLM post-training 通用策略优化及部分LLM后训练 |
| SAC | Continuous control 连续控制 |
| Model-based RL | Planning with a known or learned dynamics model 使用已知或学习到的动力学模型进行规划 |
| Offline RL | Learning from fixed historical trajectories 从固定历史轨迹学习 |
Effective RL needs a well-defined state/action/reward system, adequate exploration or representative offline coverage, safe experimentation or a realistic simulator, reliable reward attribution, and guardrails against reward hacking. In high-stakes domains, off-policy evaluation, uncertainty analysis, and human oversight are essential.
有效强化学习需要清晰定义状态、动作和奖励,需要充分探索或有代表性的离线覆盖,需要安全试验环境或逼真模拟器,并需要可靠的奖励归因及防止奖励投机。在高风险领域,还必须进行离线策略评估、不确定性分析及人工监督。
学习地图
阶段一:核心分层与范式认知
- 理解机器学习四层架构(范式 → 任务 → 算法 → 系统)
- 明确监督、无监督、自监督与强化学习的数据流边界
- 区分分类、回归、排序与时间序列预测的任务特征
阶段二:经典算法选型与基线构建
- 掌握可解释基线模型(逻辑回归、线性回归、决策树)
- 引入树集成方法(随机森林、XGBoost/LightGBM)处理表格数据
- 评估神经网络在大高维或非结构化数据中的适用场景
- 学习模型容量与可解释性的权衡原则
阶段三:指标对齐与验证策略
- 根据业务成本选择评估指标(Precision/Recall、F1、ROC-AUC、PR-AUC)
- 构建正确的验证管线(Walk-forward时序验证、分层抽样)
- 实施概率校准(Calibration)、Brier Score及漂移监控
阶段四:高级范式与工程化部署
- 实践半监督/自监督预训练与微调流水线
- 应用聚类(K-means/DBSCAN)与异常检测工作流
- 制定生产清单:延迟要求、特征版本控制、ML CI/CD及在线监控策略
动手实践——分步指南
- 配置Python环境,安装 scikit-learn、pandas、matplotlib 和 xgboost。
- 加载结构化数据集(如 sklearn diabetes/breast_cancer),完成分层训练集/测试集划分。
- 训练逻辑回归或线性回归基线模型,记录 MAE/RMSE 或 Accuracy/F1 指标。
- 切换至梯度提升模型(XGBoost/LightGBM),调节深度与学习率,使用交叉验证对比验证集表现。
- 评估概率校准效果,绘制 ROC 曲线与 Precision-Recall 曲线,分析类别不平衡场景下的阈值选择。
- 实践无监督任务:对同一数据应用 PCA 或 K-means,使用 matplotlib 可视化聚类分布与降维结构。
- 模拟生产监控:保存模型输出与特征分布,编写脚本计算 PSI 或相关性以检测数据漂移。
- 撰写算法选型文档:将业务目标映射至范式 → 任务 → 基线 → 集成 → 部署约束。
三大推荐资源
- 1Machine Learning Specialization
Andrew Ng's foundational course covering ML paradigms, algorithms, and evaluation in a structured, beginner-friendly format.
https://www.coursera.org/specializations/machine-learning-introduction
- 2scikit-learn Documentation
The official reference for implementation of classification, regression, clustering, and evaluation metrics with clear examples and API guidance.
https://scikit-learn.org/stable/
- 3Hands-On Machine Learning with Scikit-Learn, Keras & TensorFlow
A widely used practical guide that bridges theory and production-ready code with step-by-step machine learning projects.
https://www.oreilly.com/library/view/hands-on-machine-learning/9781098125974/
链接由 AI 推荐——使用前建议快速核实。