This guide maps every one of the 27 primary lesson files currently in the official tree. A running Job Match Lab exposes inputs, process, errors, and acceptance so beginners can see how models enter real projects.
The fast path connects framing, fairness, environment, data, regression, classification, clustering, text, time, reward, and deployment. Use the full path to build the running project.
The repository tagline still says 26 lessons, while the current main tree contains 27 non-solution primary lesson READMEs. This guide follows the verifiable tree on 2026-07-20. It is an original bilingual teaching reconstruction, not an official line-by-line translation.
第一册 · 第 1–4 课Volume 1 · Lessons 1–4
先选对问题,再选算法Choose the problem before the algorithm
建立范式、公平与历史边界。
Build boundaries around paradigms, fairness, and history.
本册作品里程碑Portfolio milestone
完成问题卡、范式地图和负责任使用卡。
Complete the problem card, paradigm map, and responsible-use card.
Machine learning infers patterns from historical examples and applies them to new cases. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像根据过去航班延误记录估计新航班风险,而不是把每条天气规则都手写出来。
It is like estimating a new flight’s delay risk from past flights instead of hand-writing every weather rule.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
先定义输入、目标、决策、可接受错误和简单基线;只有规则难以维护且数据能代表问题时才考虑模型。
Define inputs, target, decision, acceptable errors, and a simple baseline first. Use a model only when rules are brittle and data represents the problem.
例子 1 · 规则还是模型Example 1 · Rules or model
输入Input
十条固定禁词Ten fixed banned words
过程Process
写透明规则并统计误报Write a transparent rule and count false positives
结果 / 验收Result / check
规则已足够,不训练模型The rule is sufficient; no model is trained
例子 2 · 岗位优先级Example 2 · Job priority
输入Input
历史岗位、人工优先标签Past jobs and human priority labels
过程Process
先做多数类和打分规则基线Build majority and scoring-rule baselines first
结果 / 验收Result / check
模型必须超过基线且错误可接受The model must beat baselines with acceptable errors
常见误区Common misconception
把“数据很多”当成“应该用机器学习”。大量脏数据只会让错误更稳定。
Treating “lots of data” as proof that ML is appropriate. Large dirty data only makes errors more systematic.
作品任务Portfolio task
为“岗位匹配实验室”写一页问题卡:谁在何时用预测做什么决定,错判各有什么代价。
Write a one-page problem card for the Job Match Lab: who uses the prediction, when, for what decision, and the cost of each error.
验收:Acceptance:一位不了解项目的人能指出目标、基线、禁止用途与放弃模型的条件。A newcomer can identify the target, baseline, prohibited use, and the condition for abandoning ML.
自测:如果模型指标变高,但“机器学习到底适合解决什么问题”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Introduction to machine learning” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: A newcomer can identify the target, baseline, prohibited use, and the condition for abandoning ML. A metric is only one piece of evidence.
ML progress comes from the joint evolution of data, compute, algorithms, and evaluation. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像摄影进步不只因为镜头,还因为胶片、传感器、存储和观看方式一起变化。
Photography advanced not just through lenses, but through film, sensors, storage, and ways of viewing images.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
历史案例用于识别反复出现的模式:能力被夸大、数据偏差被忽略、演示效果被误当成部署可靠性。
History exposes recurring patterns: overstated capability, ignored data bias, and demos mistaken for deployment reliability.
例子 1 · 垃圾邮件过滤Example 1 · Spam filtering
输入Input
带时间戳的邮件Time-stamped email
过程Process
按时间回放旧规则和新模型Replay old rules and a new model over time
结果 / 验收Result / check
概念漂移会让旧方法失效Concept drift breaks old methods
例子 2 · 招聘自动化Example 2 · Hiring automation
输入Input
历史录用记录Historical hiring records
过程Process
检查记录是否继承过去偏见Inspect whether records encode old bias
结果 / 验收Result / check
历史成功不自动等于公平目标Historical success is not automatically a fair target
常见误区Common misconception
把最新算法视作必然更好,忽略数据、指标和部署条件不同。
Assuming the newest algorithm is inherently better while ignoring changes in data, metrics, and deployment.
作品任务Portfolio task
制作一条四节点时间线,每个节点写“当时解决了什么、留下了什么新风险”。
Create a four-node timeline; for each node, state what it solved and what new risk it introduced.
验收:Acceptance:时间线能把算法进步与数据、算力和社会影响联系起来。The timeline connects algorithmic progress with data, compute, and social impact.
自测:如果模型指标变高,但“用历史看清机器学习的能力边界”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “History of machine learning” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: The timeline connects algorithmic progress with data, compute, and social impact. A metric is only one piece of evidence.
Models can carry inequities from data collection and labeling into predictions. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像一把按成年男性手型设计的工具,对其他人“同样使用”也可能并不公平。
A tool designed around one adult male hand may be used equally yet still work unfairly for others.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
按群体和场景拆分误差,记录敏感属性用途,加入申诉、人类复核、隐私和持续监控。
Slice errors by group and context, document sensitive-attribute use, and add appeal, human review, privacy, and monitoring.
例子 1 · 总体准确率陷阱Example 1 · Aggregate accuracy trap
输入Input
总体 92% 的模型A model with 92% overall accuracy
过程Process
按地区拆分召回率Slice recall by region
结果 / 验收Result / check
某小地区只有 55%,平均数掩盖伤害One small region has 55%; the average hid harm
例子 2 · 标签不是事实Example 2 · Labels are not facts
输入Input
主管给的“潜力”评分Manager-rated “potential”
过程Process
审计评分一致性与申诉记录Audit consistency and appeals
结果 / 验收Result / check
标签含主观偏差,不能直接当真值Labels contain subjective bias and are not ground truth
常见误区Common misconception
删除敏感属性就认为模型不会歧视;邮编、学校等代理变量仍可能重建它。
Believing that removing a sensitive field removes discrimination; proxies such as postcode or school can reconstruct it.
作品任务Portfolio task
为岗位分类器写负责任使用卡:受影响人群、关键错误、复核与申诉路径。
Write a responsible-use card for the job classifier: affected groups, critical errors, review, and appeal paths.
验收:Acceptance:至少有一个分组指标、一个禁止自动化决策和一个真实复核入口。It contains at least one sliced metric, one prohibited automated decision, and one real review route.
自测:如果模型指标变高,但“负责任 AI 与公平性不是上线后的装饰”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Building ML solutions with responsible AI” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: It contains at least one sliced metric, one prohibited automated decision, and one real review route. A metric is only one piece of evidence.
Learning paradigms differ primarily in the feedback available to the system. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
有答案练习是监督学习,自由分组材料是无监督学习,试错得分是强化学习。
Exercises with answers resemble supervised learning, free grouping resembles unsupervised learning, and trial-and-reward resembles reinforcement learning.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
先问是否有可靠标签、是否只需发现结构、反馈是否延迟,再选择范式;算法名排在后面。
Ask whether labels are reliable, whether structure discovery is enough, and whether feedback is delayed before choosing a paradigm.
例子 1 · 岗位类别Example 1 · Job categories
输入Input
人工标注的岗位类型Human-labeled job types
过程Process
训练分类器预测新岗位Train a classifier for new jobs
结果 / 验收Result / check
这是监督分类This is supervised classification
例子 2 · 技能群落Example 2 · Skill clusters
输入Input
只有技能向量,无类别Skill vectors without categories
过程Process
聚类后人工解释每组Cluster then interpret groups
结果 / 验收Result / check
这是无监督探索,不是发现真理This is unsupervised exploration, not truth discovery
常见误区Common misconception
把“没有标签”理解为“没有任何人工判断”;特征、距离和簇命名仍含选择。
Treating “unlabeled” as “free of human judgment”; features, distance, and cluster names still encode choices.
作品任务Portfolio task
把五个求职问题分别映射到范式,并为每个写出可获得的反馈。
Map five job-search questions to learning paradigms and state the feedback available for each.
验收:Acceptance:每个映射都能由反馈类型解释,而不是靠关键词猜算法。Each mapping is justified by feedback type rather than algorithm-name guessing.
自测:如果模型指标变高,但“监督、无监督、半监督与强化学习地图”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Techniques of Machine Learning” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Each mapping is justified by feedback type rather than algorithm-name guessing. A metric is only one piece of evidence.
Use one validation protocol to understand continuous prediction and logistic regression.
本册作品里程碑Portfolio milestone
交付可复现回归管线、残差报告和阈值面板。
Deliver a reproducible regression pipeline, residual report, and threshold panel.
05
第 5 课Lesson 5
用 Python 与 scikit-learn 建第一条可复现管线Get started with Python and Scikit-learn for regression models
先回答一个白话问题Start with a plain question
工具环境和数据管线决定实验能否被复现。 这节课不从算法名开始,而是先判断这个能力解决什么决策问题。
The environment and data pipeline determine whether an experiment can be reproduced. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
实验环境像烘焙配方:版本、份量和步骤缺一项,别人烤不出同一结果。
An experiment environment is like a baking recipe: versions, quantities, and steps are all required for reproduction.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
隔离环境、固定随机种子、记录依赖,并把预处理与模型放进同一 Pipeline。
Isolate the environment, fix seeds, record dependencies, and place preprocessing and the model in one Pipeline.
例子 1 · 环境漂移Example 1 · Environment drift
输入Input
两台电脑的依赖版本Dependency versions on two machines
过程Process
重建环境并运行同一 notebookRebuild and run the same notebook
结果 / 验收Result / check
结果差异可定位到版本和种子Differences trace to versions and seeds
例子 2 · 预处理遗漏Example 2 · Lost preprocessing
输入Input
训练时标准化的数据Data standardized during training
过程Process
把标准化放入 Pipeline 再预测Put scaling inside the Pipeline before prediction
结果 / 验收Result / check
线上不会忘记相同步骤Serving cannot omit the same step
常见误区Common misconception
把 notebook 从头跑通当成可复现,却没有清空状态或锁定依赖。
Calling a notebook reproducible without clearing hidden state or pinning dependencies.
Create the environment, requirements, seed, and smoke test, then train a mean-baseline Pipeline.
验收:Acceptance:从空环境按 README 一次完成安装、训练和预测。A clean environment can install, train, and predict by following the README once.
自测:如果模型指标变高,但“用 Python 与 scikit-learn 建第一条可复现管线”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Get started with Python and Scikit-learn for regression models” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: A clean environment can install, train, and predict by following the README once. A metric is only one piece of evidence.
A regression model can only learn from the numeric representation and sample range it receives. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像量体裁衣:尺子单位错了、只量一种身材,再好的裁缝也会做错。
It is like tailoring: wrong units or one body type will defeat even a skilled tailor.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
审计分布、单位、缺失、异常、重复与采样偏差;可视化用于发现问题,不用于挑好看的相关性。
Audit distributions, units, missingness, outliers, duplicates, and sampling bias. Visualize to find problems, not attractive correlations.
例子 1 · 单位混用Example 1 · Mixed units
输入Input
月薪与年薪同列Monthly and annual salaries in one column
过程Process
统一单位并保留原始字段Normalize units and preserve the raw field
结果 / 验收Result / check
分布不再出现假异常The distribution loses fake outliers
例子 2 · 幸存者偏差Example 2 · Survivorship bias
输入Input
只含已投递岗位Only applied-to jobs
过程Process
比较全部收藏与已投递样本Compare all saved and applied jobs
结果 / 验收Result / check
发现数据漏掉被主动放弃的岗位Data omitted jobs deliberately skipped
常见误区Common misconception
删除所有异常值会让数据更“干净”,也可能删掉最值得解释的真实情况。
Removing every outlier may clean the data while deleting the most informative real cases.
作品任务Portfolio task
为岗位薪资数据写数据字典和审计报告,列出三项不能由图表确认的假设。
Write a data dictionary and audit report for salary data, including three assumptions plots cannot confirm.
验收:Acceptance:每列有单位、来源、缺失策略;清洗前后行数和分布可比较。Every column has units, source, and missingness policy; row counts and distributions are comparable before and after cleaning.
自测:如果模型指标变高,但“回归前先准备、观察和质疑数据”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Prepare and visualize data for regression” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Every column has units, source, and missingness policy; row counts and distributions are comparable before and after cleaning. A metric is only one piece of evidence.
Regression estimates a continuous outcome under a defined loss; it does not discover absolute causal laws. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像用不同弯曲程度的尺子贴合散点;越能弯不一定越能预测新点。
It is like fitting rulers with different flexibility to scattered points; more bend does not guarantee better prediction.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
比较线性、多项式、决策树/森林等方法,使用留出集和残差判断偏差与方差。
Compare linear, polynomial, tree, and forest approaches; use holdout data and residuals to assess bias and variance.
例子 1 · 均值基线Example 1 · Mean baseline
输入Input
训练集薪资Training salaries
过程Process
所有样本预测训练中位数Predict the training median for every case
结果 / 验收Result / check
任何复杂模型先超过它Every complex model must beat it
例子 2 · 多项式过拟合Example 2 · Polynomial overfit
输入Input
少量经验—薪资点Few experience-salary points
过程Process
逐步提高次数并看验证误差Raise degree and inspect validation error
结果 / 验收Result / check
训练更好、验证变坏时停止Stop when training improves but validation worsens
常见误区Common misconception
把回归系数写成“经验每增加一年一定涨薪”,忽略混杂因素和样本范围。
Reading a coefficient as “one year of experience causes this raise,” ignoring confounding and sample range.
作品任务Portfolio task
训练三个回归基线,画残差,并为最差的十个预测逐条写原因。
Train three regression baselines, plot residuals, and explain the ten worst predictions.
验收:Acceptance:报告同时给 MAE、基线、残差模式和外推边界。The report includes MAE, baseline, residual pattern, and extrapolation boundary.
自测:如果模型指标变高,但“用四种回归看清关系、误差与过拟合”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Regression four ways” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: The report includes MAE, baseline, residual pattern, and extrapolation boundary. A metric is only one piece of evidence.
Logistic regression maps a linear score to a probability, then uses a threshold for a class decision. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像风险温度计先给连续刻度,是否报警由业务阈值决定。
It is like a risk gauge with a continuous scale; the business threshold decides when to raise an alarm.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
特征缩放、概率校准、阈值和类别权重都会改变实际错误;不要只看默认 0.5。
Scaling, calibration, thresholds, and class weights change real errors; do not rely blindly on 0.5.
例子 1 · 阈值权衡Example 1 · Threshold trade-off
输入Input
岗位匹配概率Job-match probabilities
过程Process
比较 0.3/0.5/0.7 的混淆矩阵Compare confusion matrices at 0.3/0.5/0.7
结果 / 验收Result / check
按漏掉好岗位的代价选阈值Choose based on the cost of missing good jobs
例子 2 · 概率校准Example 2 · Probability calibration
输入Input
100 个约 0.8 的预测100 predictions near 0.8
过程Process
统计实际正例比例Measure observed positives
结果 / 验收Result / check
若只有 50% 则概率不可信If only 50% are positive, probabilities are unreliable
常见误区Common misconception
把 0.51 与 0.99 都写成“正类”,丢失置信差异和复核优先级。
Reducing both 0.51 and 0.99 to “positive,” losing confidence and review priority.
作品任务Portfolio task
做可调阈值面板,展示精确率、召回率和待人工复核数量如何变化。
Build a threshold panel showing changes in precision, recall, and human-review volume.
验收:Acceptance:用户能根据书面错误成本选择阈值,不被单一准确率牵着走。A user can select a threshold from written error costs rather than one accuracy number.
自测:如果模型指标变高,但“逻辑回归为什么名字有回归却常做分类”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Logistic regression to predict categories” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: A user can select a threshold from written error costs rather than one accuracy number. A metric is only one piece of evidence.
A model artifact is only a component; a product still needs validation, preprocessing, an interface, and feedback. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
发动机不是汽车;方向盘、刹车、仪表和维修记录同样决定能否上路。
An engine is not a car; steering, brakes, gauges, and service records also determine roadworthiness.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
Save a Pipeline with preprocessing, define an input schema, reject invalid values, record the model version, and expose uncertainty.
例子 1 · 缺失预处理Example 1 · Missing preprocessing
输入Input
网页原始输入Raw form input
过程Process
与训练 Pipeline 一起预测Predict through the training Pipeline
结果 / 验收Result / check
网页与 notebook 结果一致Web and notebook results match
例子 2 · 越界输入Example 2 · Out-of-range input
输入Input
经验年限 -3Experience of -3 years
过程Process
schema 校验后返回可读错误Schema validation returns a readable error
结果 / 验收Result / check
模型不接收荒谬数值The model never receives absurd values
常见误区Common misconception
页面能显示预测就算部署成功,却没有检查训练与线上特征处理是否一致。
Calling deployment successful because a page shows a prediction, without checking training-serving feature parity.
作品任务Portfolio task
做一个只读演示页:输入岗位特征,显示预测、模型版本、范围和免责声明。
Build a read-only demo: enter job features and show the prediction, model version, scope, and disclaimer.
验收:Acceptance:相同样本在离线测试和网页得到同一结果;无效输入不会调用模型。The same sample gives the same offline and web result; invalid inputs never reach the model.
自测:如果模型指标变高,但“把训练好的模型接进最小 Web 应用”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Build a Web App to use an ML Model” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: The same sample gives the same offline and web result; invalid inputs never reach the model. A metric is only one piece of evidence.
Classification assigns samples to discrete classes; the hard part is often defining the labels. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像邮件分拣:类别边界必须让不同分拣员大致一致。
It is like sorting mail: category boundaries must be consistent across different sorters.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
写标注指南、测标注一致性、分层切分,并用混淆矩阵表达不同错误。
Write labeling guidance, measure agreement, stratify splits, and use a confusion matrix to express different errors.
例子 1 · 模糊标签Example 1 · Ambiguous label
输入Input
“AI 相关岗位”文本Text for “AI-related role”
过程Process
两人独立标注后比较分歧Two people label independently and compare
结果 / 验收Result / check
先修规则再扩数据Fix guidance before expanding data
例子 2 · 类别不均衡Example 2 · Class imbalance
输入Input
90% 非 AI、10% AI90% non-AI, 10% AI
过程Process
多数类基线与分层切分Majority baseline and stratified split
结果 / 验收Result / check
90% 准确率可能毫无价值90% accuracy can be useless
常见误区Common misconception
把现有文件夹名直接当标签,默认历史归档规则正确且一致。
Using existing folder names as labels and assuming historical filing rules are correct and consistent.
作品任务Portfolio task
为岗位类型写标注手册,独立标 50 条并记录分歧类型。
Write a job-type labeling guide, label 50 items independently, and record disagreement types.
验收:Acceptance:另一位标注者能按指南达到约定一致性,无法判断项有明确出口。Another labeler reaches agreed consistency, with a clear route for undecidable cases.
自测:如果模型指标变高,但“分类任务:类别、标签与错误成本”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Introduction to classification” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Another labeler reaches agreed consistency, with a clear route for undecidable cases. A metric is only one piece of evidence.
Classifiers carry different assumptions; comparison requires the same data and validation protocol. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像让几位医生看同一批病例、用同一诊断标准,才有公平比较。
It is like giving several doctors the same cases and diagnostic rules for a fair comparison.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
建立 Pipeline,固定切分和指标,对逻辑回归、树、SVM 等做交叉验证与误差分析。
Build Pipelines, fix splits and metrics, and compare logistic, tree, and SVM approaches with cross-validation and error analysis.
例子 1 · 公平比较Example 1 · Fair comparison
输入Input
同一训练/验证集The same train/validation split
过程Process
每个模型各自 PipelineA Pipeline for each model
结果 / 验收Result / check
结果差来自模型而非预处理遗漏Differences come from models, not missing preprocessing
例子 2 · 小样本波动Example 2 · Small-sample variance
输入Input
一次 82% 对 84%One score of 82% vs 84%
过程Process
多折交叉验证比较分布Compare fold distributions
结果 / 验收Result / check
差异可能不稳定The difference may be unstable
常见误区Common misconception
只跑一次随机切分,0.5% 领先就宣布冠军。
Running one random split and declaring a winner from a 0.5% lead.
作品任务Portfolio task
建立模型比较表:均值、波动、训练时间、推断时间、可解释性和关键错误。
Create a comparison table covering mean, variance, train time, inference time, interpretability, and critical errors.
验收:Acceptance:选择理由能回到项目约束,而不是只写最高分。The choice traces back to project constraints rather than the highest score alone.
自测:如果模型指标变高,但“比较分类器,不靠排行榜选模型”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Cuisine classifiers 1” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: The choice traces back to project constraints rather than the highest score alone. A metric is only one piece of evidence.
Hyperparameter tuning explores capacity within a validation protocol; it is not repeated peeking at the test set. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
测试集像密封期末卷;练习时反复看答案,最后分数就不再可信。
The test set is a sealed final exam; repeated peeking destroys its credibility.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
训练/验证用于选择,测试只用于最后一次估计;搜索空间、预算和随机性要记录。
Use train/validation for selection and test once at the end; record the search space, budget, and randomness.
例子 1 · 深度调参Example 1 · Tree depth tuning
输入Input
深度 2–30Depth 2–30
过程Process
交叉验证选择后锁定Select via CV then lock it
结果 / 验收Result / check
只在最终测试一次Use the test set once
例子 2 · 搜索预算Example 2 · Search budget
输入Input
1000 组参数1,000 parameter sets
过程Process
先用学习曲线缩小范围Narrow the range with learning curves
结果 / 验收Result / check
计算预算有上限且可复现Compute budget is bounded and reproducible
常见误区Common misconception
把测试集分数反馈给下一轮调参,测试集逐渐变成训练数据。
Feeding test scores into the next tuning round until the test set becomes training data.
作品任务Portfolio task
为两个模型写有限搜索计划,并画验证分数随容量变化曲线。
Write a bounded search plan for two models and plot validation score against capacity.
验收:Acceptance:测试集只评估锁定方案一次;搜索范围和选择规则预先写明。The test set evaluates the locked solution once; search range and selection rule are predeclared.
自测:如果模型指标变高,但“继续比较分类器:参数、边界与验证”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Cuisine classifiers 2” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: The test set evaluates the locked solution once; search range and selection rule are predeclared. A metric is only one piece of evidence.
Once a classifier becomes an app, input UX and error feedback change its real value. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像把实验室测量仪交给普通人,刻度、说明和误操作保护决定能否使用。
It is like handing a lab instrument to the public; scales, instructions, and misuse protection determine usability.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
使用模型概率和 top-k,解释输入限制,收集纠正反馈但不自动把反馈当真标签。
Use probabilities and top-k, explain input limits, and collect correction feedback without treating it automatically as ground truth.
例子 1 · Top-k 推荐Example 1 · Top-k recommendation
输入Input
一段混合技能文本Mixed-skill text
过程Process
返回前三类与概率Return top three classes and probabilities
结果 / 验收Result / check
低置信时请求人工确认Ask for confirmation at low confidence
例子 2 · 反馈回路Example 2 · Feedback loop
输入Input
用户点击“分类错了”User clicks “wrong class”
过程Process
保存原输入、预测、纠正和版本Store input, prediction, correction, and version
结果 / 验收Result / check
反馈先审查再入训练集Review feedback before training use
常见误区Common misconception
把用户每次纠正都立即加入训练,恶意或误点会污染数据。
Immediately training on every user correction, allowing mistakes or abuse to poison the data.
作品任务Portfolio task
交付分类演示页、模型卡、错误反馈入口和十条端到端验收样本。
Deliver the classification demo, model card, correction route, and ten end-to-end acceptance cases.
验收:Acceptance:输入、预测、概率、版本和限制清楚;反馈可追溯且不会自动训练。Input, prediction, probability, version, and limits are clear; feedback is traceable and not auto-trained.
自测:如果模型指标变高,但“交付一个分类推荐 Web 应用”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Build a Cuisine Recommender Web App” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Input, prediction, probability, version, and limits are clear; feedback is traceable and not auto-trained. A metric is only one piece of evidence.
Clusters arise from representation, distance, and algorithm choices; they are not natural labels embedded in data. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
按颜色摆水果与按大小摆水果都会得到合理分组,问题决定哪种距离有用。
Grouping fruit by color or by size can both be valid; the question decides which distance matters.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
标准化特征、可视化候选结构、检查异常与高维失真,并用业务问题解释簇。
Scale features, visualize candidate structure, inspect outliers and high-dimensional distortion, and interpret clusters through the business question.
例子 1 · 尺度支配Example 1 · Scale dominance
输入Input
薪资 10000–50000 与布尔远程Salary 10k–50k plus remote boolean
过程Process
比较标准化前后距离Compare distances before and after scaling
结果 / 验收Result / check
未缩放时薪资淹没远程信息Salary overwhelms remote status before scaling
例子 2 · 二维投影Example 2 · 2-D projection
输入Input
50 维技能向量50-D skill vectors
过程Process
用 PCA 投影仅作观察Use PCA projection for inspection only
结果 / 验收Result / check
图上重叠不等于原空间无结构Overlap in the plot does not prove no structure
常见误区Common misconception
二维散点看见三个团就确定 k=3,忽略投影失真和稳定性。
Fixing k=3 from three blobs in a 2-D plot while ignoring projection distortion and stability.
作品任务Portfolio task
用三种表示画同一岗位数据,并写出每种表示放大和丢失了什么。
Visualize the same jobs under three representations and state what each emphasizes and loses.
验收:Acceptance:分组假设能由业务问题、尺度处理和代表样本共同解释。Grouping assumptions are supported by the question, scaling, and representative samples.
自测:如果模型指标变高,但“聚类前先把距离和表示想清楚”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Introduction to clustering” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Grouping assumptions are supported by the question, scaling, and representative samples. A metric is only one piece of evidence.
K-Means alternates nearest-centroid assignment and centroid updates, favoring roughly spherical numeric clusters. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像不断移动几个集合点,让每个人走向最近点,直到大家不再换队。
It is like moving meeting points and reassigning people to the nearest one until assignments stabilize.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
多次初始化、缩放、肘部/轮廓指标和人工解释共同选择 k;检查小簇和不稳定样本。
Use multiple initializations, scaling, elbow/silhouette measures, and human interpretation to choose k; inspect tiny and unstable clusters.
例子 1 · 随机初始化Example 1 · Random initialization
输入Input
同一数据不同 seedSame data with different seeds
过程Process
运行 20 次比较簇稳定性Run 20 times and compare stability
结果 / 验收Result / check
不稳定样本单独标记Flag unstable samples
例子 2 · 质心解释Example 2 · Centroid interpretation
输入Input
每簇平均技能权重Mean skill weights per cluster
过程Process
查看质心与代表岗位Inspect centroid and representative jobs
结果 / 验收Result / check
簇名来自证据而非编号Names come from evidence, not cluster IDs
Calling cluster 0 “low-end” and cluster 1 “high-end,” imposing value on arbitrary IDs.
作品任务Portfolio task
为岗位技能聚类比较 k=2–8,报告稳定性、代表样本和无法解释的簇。
Compare k=2–8 for job-skill clustering and report stability, representatives, and uninterpretable clusters.
验收:Acceptance:选择 k 的理由不只是一张肘部图,且簇名可由样本反驳。The choice of k rests on more than an elbow plot, and cluster names are falsifiable from samples.
自测:如果模型指标变高,但“K-Means:质心、k 与稳定性”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “K-Means clustering” does not, can you claim success? Why?
不能。先核对数据切分、基线、错误类型和使用场景,再用“选择 k 的理由不只是一张肘部图,且簇名可由样本反驳。”这样的可观察结果验收;指标只是证据之一。
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: The choice of k rests on more than an elbow plot, and cluster names are falsifiable from samples. A metric is only one piece of evidence.
NLP turns language tasks into evaluable representation and prediction problems. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像图书馆先分词编目,再按索引查找;索引帮助定位,却不等于完整理解。
It is like tokenizing and cataloging a library before retrieval; the index helps locate but is not full understanding.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
定义文本单位、规范化、词表、特征与标签;语言、领域和时间变化都会影响结果。
Define text units, normalization, vocabulary, features, and labels; language, domain, and time shifts all matter.
例子 1 · 分词差异Example 1 · Tokenization differences
输入Input
“C++/C# 开发”“C++/C# developer”
过程Process
比较空格切分与领域 tokenizerCompare whitespace and domain tokenizers
结果 / 验收Result / check
空格法破坏技能名Whitespace breaks skill names
例子 2 · 领域迁移Example 2 · Domain shift
输入Input
酒店评论训练集Hotel-review training set
过程Process
直接预测招聘文本情感Predict sentiment on job text
结果 / 验收Result / check
词义不同导致性能崩溃Different meanings cause failure
常见误区Common misconception
把“文本转成数字”当成中性步骤,忽略分词和词表会决定哪些差异可见。
Treating text-to-number conversion as neutral while tokenization and vocabulary decide which distinctions are visible.
作品任务Portfolio task
为中英混合岗位文本写预处理契约,并保留三条会被普通分词破坏的样本。
Write a preprocessing contract for mixed Chinese-English job text and keep three adversarial tokenization samples.
验收:Acceptance:同一文本每次得到相同 tokens;技能符号、否定和空文本都有测试。The same text yields the same tokens; skill symbols, negation, and empty text are tested.
自测:如果模型指标变高,但“自然语言处理:文本怎样变成可计算表示”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Introduction to natural language processing” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: The same text yields the same tokens; skill symbols, negation, and empty text are tested. A metric is only one piece of evidence.
Classification, entity extraction, summarization, translation, and generation have different outputs and evaluations. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像文书团队有分拣员、摘录员、翻译员和撰稿员,不能用同一验收表。
A document team has sorters, extractors, translators, and writers; one checklist cannot evaluate all roles.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
先写输入输出 schema 和失败示例,再选择规则、传统 ML 或生成模型。
Write the input/output schema and failure cases before choosing rules, classic ML, or generative models.
例子 1 · 实体抽取Example 1 · Entity extraction
输入Input
岗位描述Job description
过程Process
抽取技能、地点、薪资并保留原文跨度Extract skill, location, salary with source spans
结果 / 验收Result / check
字段可验证且可追溯Fields are verifiable and traceable
例子 2 · 摘要Example 2 · Summarization
输入Input
2000 字职位说明2,000-word posting
过程Process
压缩为职责/要求/待遇Compress into duties/requirements/benefits
结果 / 验收Result / check
不得虚构缺失待遇Missing benefits must not be invented
常见误区Common misconception
看到文本就用大模型生成答案,忽略规则或分类器可能更便宜、更可验证。
Using a generative model for every text task while rules or classifiers may be cheaper and more verifiable.
作品任务Portfolio task
为五类 NLP 需求写输入、输出、自动指标和人工检查,选最简单可行方案。
For five NLP needs, define input, output, automatic metric, and human check, then choose the simplest viable approach.
验收:Acceptance:每个任务的输出结构和关键错误不同,方案选择有成本与风险理由。Each task has distinct output and critical errors, with cost/risk justification for the method.
自测:如果模型指标变高,但“常见 NLP 任务与选择路线”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Common NLP tasks and techniques” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Each task has distinct output and critical errors, with cost/risk justification for the method. A metric is only one piece of evidence.
Translation changes wording and context, while sentiment labels depend on domain and culture. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像把笑话翻译成另一种语言:字面正确也可能失去语气。
It is like translating a joke: literal correctness can still lose tone.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
保留原文与译文,按语言分组评估,检查否定、讽刺与领域词;不要用一次翻译制造伪标签。
Keep source and translation, evaluate by language, inspect negation, sarcasm, and domain terms; do not create pseudo-labels from one translation pass.
例子 1 · 否定翻转Example 1 · Negation flip
输入Input
“并非不推荐”“not unrecommended”
过程Process
检查翻译后否定范围Inspect translated negation scope
结果 / 验收Result / check
情感不能只数正负词Sentiment cannot be word counting
例子 2 · 领域语义Example 2 · Domain sentiment
输入Input
“挑战很大”出现在职位介绍“highly challenging” in a job post
过程Process
与酒店评论中的同词比较Compare with the phrase in hotel reviews
结果 / 验收Result / check
同词在不同领域标签不同The same phrase has different labels by domain
常见误区Common misconception
先自动翻译全部数据再训练,默认翻译噪声不会改变标签分布。
Auto-translating all data before training and assuming translation noise preserves label distribution.
作品任务Portfolio task
建 30 条中英对照压力集,覆盖否定、程度、讽刺和职位领域术语。
Build a 30-item bilingual stress set covering negation, intensity, sarcasm, and job-domain terms.
验收:Acceptance:报告原文与译文分别的错误;至少一个类别显示翻译造成的变化。Errors are reported separately for source and translation, with at least one translation-induced shift identified.
自测:如果模型指标变高,但“翻译与情感分析:语言转换不等于语义不变”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Translation and sentiment analysis with ML” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Errors are reported separately for source and translation, with at least one translation-induced shift identified. A metric is only one piece of evidence.
Text-model ceilings are often set by label quality, duplicates, and data splitting. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像餐厅点评统计,复制粘贴的同一条评论不能既进练习卷又进考试卷。
In review analysis, duplicate text must not appear in both practice and exam sets.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
审计重复、长度、语言、标签分布和同源泄漏;先按实体/时间分组再切分。
Audit duplicates, length, language, label balance, and source leakage; split by entity or time before modeling.
例子 1 · 重复泄漏Example 1 · Duplicate leakage
输入Input
同一岗位被多个聚合站转载The same job reposted by aggregators
过程Process
规范化文本并按来源分组切分Normalize text and split by source group
结果 / 验收Result / check
近重复不会跨训练测试Near-duplicates do not cross train/test
例子 2 · 标签代理Example 2 · Proxy label
输入Input
用星级生成情感标签Stars used as sentiment labels
过程Process
抽查文字与星级冲突Inspect text-star conflicts
结果 / 验收Result / check
标签规则及噪声率被记录Label rule and noise rate are recorded
常见误区Common misconception
随机按行切分文本,近重复内容让测试分数虚高。
Random row splitting lets near-duplicate text inflate test performance.
作品任务Portfolio task
为岗位文本建立数据审计 notebook:重复组、长度、语言、标签和切分检查。
Create a job-text audit notebook for duplicate groups, length, language, labels, and split checks.
验收:Acceptance:训练与测试近重复交集为零;每个删除或合并步骤有数量记录。Train/test near-duplicate overlap is zero, and every deletion or merge has counts.
自测:如果模型指标变高,但“情感项目第一步:先处理数据”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Sentiment analysis with hotel reviews — processing the data” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Train/test near-duplicate overlap is zero, and every deletion or merge has counts. A metric is only one piece of evidence.
Text classification gains value from understanding real errors, not one score. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像批改作文,分数告诉你结果,逐题错因才告诉你如何改课。
Like grading essays: a score reports the outcome, while error reasons show how to improve the lesson.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
建立词袋/TF-IDF 基线,查看混淆矩阵、重要特征与代表错误,再决定是否升级模型。
Build bag-of-words/TF-IDF baselines, inspect confusion matrices, important features, and representative errors before upgrading.
例子 1 · 否定错误Example 1 · Negation error
输入Input
“不要求多年经验”“does not require years of experience”
过程Process
查看模型为何抓住“要求/经验”Inspect why the model focused on “require/experience”
结果 / 验收Result / check
加入否定压力集而非只加数据Add a negation stress set, not just more data
例子 2 · 解释误导Example 2 · Misleading importance
输入Input
公司名成为强特征Company name becomes a strong feature
过程Process
删除公司名后重测Remove company names and retest
结果 / 验收Result / check
发现模型记住来源而非语义The model memorized source, not meaning
常见误区Common misconception
高权重词看起来合理,就把它当因果解释。
Treating plausible high-weight words as causal explanations.
作品任务Portfolio task
训练 TF-IDF + 线性模型,制作 25 条错误卡并按可修复原因分组。
Train a TF-IDF linear model and create 25 error cards grouped by actionable causes.
验收:Acceptance:改进建议来自错误组;重新训练后不仅总分,关键压力集也改善。Improvements derive from error groups, and key stress sets improve alongside the aggregate score.
自测:如果模型指标变高,但“情感项目第二步:训练、解释和分析错误”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Sentiment analysis with hotel reviews” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Improvements derive from error groups, and key stress sets improve alongside the aggregate score. A metric is only one piece of evidence.
Time data has direction from past to future; random splitting leaks future information. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
天气预报不能拿明天温度帮助预测昨天。
A forecast cannot use tomorrow’s temperature to predict yesterday.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
明确频率、时区、趋势、季节性和预测时点;用滚动/扩展窗口回测。
Define frequency, timezone, trend, seasonality, and forecast origin; backtest with rolling or expanding windows.
例子 1 · 随机切分泄漏Example 1 · Random-split leakage
输入Input
两年周度岗位数Two years of weekly job counts
过程Process
比较随机切分与按时间切分Compare random and chronological splits
结果 / 验收Result / check
随机分数虚高Random splitting inflates the score
例子 2 · 朴素预测Example 2 · Naive forecast
输入Input
本周岗位数This week’s job count
过程Process
预测下周等于本周或去年同期Predict next week as this week or same week last year
结果 / 验收Result / check
复杂模型先超过季节基线Complex models must beat seasonal baselines
常见误区Common misconception
把时间戳删掉后随机切分,以为模型就看不到未来。
Dropping timestamps and randomly splitting, as if future information disappears.
作品任务Portfolio task
画周度岗位序列,标缺失周和异常事件,设计三个回测窗口。
Plot weekly job counts, mark missing weeks and events, and design three backtest windows.
验收:Acceptance:预测时点与可用特征清楚;任何特征都不来自未来。Forecast origin and available features are explicit; no feature comes from the future.
自测:如果模型指标变高,但“时间序列:顺序、趋势和未来不能被随机打乱”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Introduction to time series forecasting” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Forecast origin and available features are explicit; no feature comes from the future. A metric is only one piece of evidence.
ARIMA differences trends and combines autoregressive and moving-average structure. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像根据最近几次偏高或偏低的预测,既看历史水平也修正过去误差。
It is like using recent levels while correcting a history of over- and under-prediction.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
检查平稳性、选择 p/d/q、诊断残差,并与朴素基线在同一回测窗口比较。
Check stationarity, choose p/d/q, diagnose residuals, and compare with naive baselines on identical backtests.
例子 1 · 差分Example 1 · Differencing
输入Input
持续上升的岗位数A rising job-count series
过程Process
对相邻值做差后建模Model adjacent differences
结果 / 验收Result / check
趋势被转为变化量Trend becomes change
例子 2 · 残差诊断Example 2 · Residual diagnostics
输入Input
ARIMA 回测误差ARIMA backtest errors
过程Process
检查自相关与时段偏差Check autocorrelation and period bias
结果 / 验收Result / check
有结构残差说明模型漏了信息Structured residuals reveal missing information
常见误区Common misconception
自动搜索得到某组 p/d/q 就停止,未检查残差和业务断点。
Stopping after auto-search returns p/d/q without inspecting residuals or business breaks.
作品任务Portfolio task
对技能需求周序列做 ARIMA 回测,报告参数、残差与朴素基线。
Backtest ARIMA on weekly skill demand and report parameters, residuals, and naive baseline.
验收:Acceptance:模型只在多个窗口稳定优于基线时保留;失效时段有解释。Keep the model only if it consistently beats baselines across windows; explain failure periods.
自测:如果模型指标变高,但“ARIMA:用过去值与过去误差做预测”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Time series forecasting with ARIMA” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Keep the model only if it consistently beats baselines across windows; explain failure periods. A metric is only one piece of evidence.
SVR can fit nonlinear relationships, but time information must be engineered into valid features. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像用可弯曲但受约束的管子穿过数据点,容忍管道内的小误差。
It is like fitting a flexible but constrained tube through points, tolerating small errors inside the tube.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
构造滞后、滚动统计和日历特征,缩放后训练;所有滚动值只使用预测时点之前的数据。
Create lag, rolling, and calendar features, scale them, and ensure every rolling value uses only data before the forecast origin.
例子 1 · 滞后特征Example 1 · Lag features
输入Input
t-1、t-4 周岗位数Counts at t-1 and t-4
过程Process
按时间移位并删除不可用首行Shift chronologically and drop unavailable leading rows
结果 / 验收Result / check
预测行不含当前/未来目标Prediction rows contain no current/future target
例子 2 · 缩放敏感Example 2 · Scaling sensitivity
输入Input
数值跨度不同的滞后与月份Lags and month numbers on different scales
过程Process
Pipeline 中标准化后调 C/gammaScale in Pipeline then tune C/gamma
结果 / 验收Result / check
比较不缩放的反例Compare an unscaled counterexample
常见误区Common misconception
先在全数据上计算滚动均值再切分,测试期信息已经进入特征。
Computing rolling means on all data before splitting, leaking test-period information.
作品任务Portfolio task
构建泄漏安全的 lag Pipeline,对比 SVR、ARIMA 和季节朴素基线。
Build a leakage-safe lag Pipeline and compare SVR, ARIMA, and seasonal naive baselines.
验收:Acceptance:特征生成有时间单元测试;比较使用同一窗口、同一指标。Feature generation has temporal unit tests; all models share windows and metrics.
自测:如果模型指标变高,但“用支持向量回归预测时间序列”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Time Series Forecasting with Support Vector Regressor” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Feature generation has temporal unit tests; all models share windows and metrics. A metric is only one piece of evidence.
Reinforcement learning learns a policy through environment interaction and delayed rewards. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像在迷宫试路:每步看当前位置、选方向、收到代价,最终学会路线。
It is like exploring a maze: observe position, choose a move, receive a cost, and learn a route.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
定义状态、动作、转移、奖励和终止;Q-Learning 更新状态—动作价值,并权衡探索与利用。
Define states, actions, transitions, rewards, and termination; Q-Learning updates state-action values while balancing exploration and exploitation.
例子 1 · 奖励塑形Example 1 · Reward shaping
输入Input
求职任务下一步选择Choosing the next job-search action
过程Process
奖励有效完成而非点击次数Reward valid completion, not click count
既学习又逐步稳定Learning continues while behavior stabilizes
常见误区Common misconception
奖励写成“投递越多越好”,系统可能鼓励无差别海投而非高质量求职。
Rewarding “more applications” can optimize spam rather than job-search quality.
作品任务Portfolio task
在纸面设计一个五状态任务环境,列出可能的奖励黑客和安全终止条件。
Design a five-state task environment on paper, listing reward hacks and safe termination conditions.
验收:Acceptance:每个奖励都对应真实目标,且至少有一个反例证明代理指标会被钻空子。Each reward maps to the real goal, with at least one counterexample showing proxy exploitation.
自测:如果模型指标变高,但“强化学习与 Q-Learning:状态、动作、奖励”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Introduction to Reinforcement Learning and Q-Learning” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Each reward maps to the real goal, with at least one counterexample showing proxy exploitation. A metric is only one piece of evidence.
An environment interface organizes observations, actions, rewards, and termination into repeatable experiments. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像标准化训练馆:每位运动员面对同样规则、起点分布和计分方式。
It is like a standardized gym where athletes share rules, start distributions, and scoring.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
Run episodes through reset/step, distinguish terminated from truncated, and record returns and failure traces across seeds.
例子 1 · 单局好运Example 1 · One lucky episode
输入Input
一次高回报One high-return episode
过程Process
运行 100 局看均值和分布Run 100 episodes for mean and distribution
结果 / 验收Result / check
不能用单局证明策略稳定One episode cannot prove stability
例子 2 · 终止误读Example 2 · Termination confusion
输入Input
时间上限触发结束Episode ends by time limit
过程Process
区分失败终止与截断Distinguish failure termination from truncation
结果 / 验收Result / check
回报统计含正确语义Return statistics preserve meaning
常见误区Common misconception
训练环境分数高就认为现实可用,忽略模拟器与现实差距。
Treating high simulator reward as real-world readiness while ignoring the sim-to-real gap.
作品任务Portfolio task
实现最小 Q-Learning 环境循环,固定三个种子并保存失败 episode。
Implement a minimal Q-Learning loop with three fixed seeds and saved failed episodes.
验收:Acceptance:报告回报分布、终止原因、训练预算和至少一条失败轨迹。Report return distribution, termination reasons, training budget, and at least one failure trace.
自测:如果模型指标变高,但“在 Gym 类环境里训练与评估策略”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “CartPole Skating” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Report return distribution, termination reasons, training budget, and at least one failure trace. A metric is only one piece of evidence.
A production model lives inside a system of data, users, business rules, and feedback loops. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
模型像导航算法,地图更新、司机行为、道路封闭和反馈都会改变效果。
A model is like navigation logic; map updates, driver behavior, road closures, and feedback change outcomes.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
建立数据契约、版本、服务、监控、漂移检测、人工复核和回滚;离线分数只是上线门槛。
Add data contracts, versioning, serving, monitoring, drift detection, human review, and rollback; offline scores are only an entry gate.
例子 1 · 反馈回路Example 1 · Feedback loop
输入Input
只向用户展示模型推荐岗位Only model-recommended jobs are shown
过程Process
后续点击数据只来自已展示项Future clicks come only from shown items
结果 / 验收Result / check
训练数据越来越窄Training data narrows over time
例子 2 · 影子部署Example 2 · Shadow deployment
输入Input
新旧模型并行Old and new models run in parallel
过程Process
新模型不影响用户,只记录比较New model records comparisons without user impact
结果 / 验收Result / check
上线前发现分组退化Sliced regressions appear before launch
常见误区Common misconception
上线后只监控服务器 200,不监控输入分布、模型输出和用户后果。
Monitoring HTTP 200s after launch but not input distribution, model outputs, or user outcomes.
作品任务Portfolio task
画出岗位模型从数据进入到用户反馈的全链路,标版本、监控、审批和回滚点。
Draw the job model’s end-to-end flow from data to user feedback, marking versions, monitoring, approvals, and rollback.
验收:Acceptance:图中至少能定位数据坏、模型坏、接口坏和使用方式坏四类故障。The diagram can locate at least four failure classes: data, model, interface, and use.
自测:如果模型指标变高,但“现实世界中的机器学习系统”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Machine learning in the real world” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: The diagram can locate at least four failure classes: data, model, interface, and use. A metric is only one piece of evidence.
Model debugging asks who fails, on which samples, and why—not only the aggregate error. This lesson starts with the decision the capability supports, not an algorithm name.
类比桥梁Analogy bridge
像医生不能只看全院平均体温,要定位哪类病人在哪个环节出问题。
A doctor cannot rely on hospital-wide average temperature; failures must be localized by patient and process.
类比边界:类比只帮助识别关系;真正系统仍由数据、代码、接口和运行环境决定。Where it breaks: The analogy only exposes relationships; the real system is determined by data, code, interfaces, and its runtime.
工程上到底发生什么What it means in engineering
误差分析、特征重要性、反事实和群体切片提供线索;它们帮助形成假设,不自动证明因果。
Error analysis, feature importance, counterfactuals, and cohorts provide clues; they form hypotheses but do not prove causality.
例子 1 · 错误树Example 1 · Error tree
输入Input
全部验证错误All validation errors
过程Process
按语言、经验和来源递归切片Slice by language, experience, and source
结果 / 验收Result / check
发现小群体集中失败A small cohort concentrates failures
例子 2 · 反事实检查Example 2 · Counterfactual check
输入Input
同一岗位仅改变地点Same job with only location changed
过程Process
观察预测变化并复核合理性Observe prediction change and review plausibility
结果 / 验收Result / check
发现模型过度依赖地点代理Model over-relies on a location proxy
常见误区Common misconception
仪表板生成解释图就把它当最终答案;解释方法本身也有假设和不稳定性。
Treating a dashboard explanation as final truth; explanation methods have assumptions and instability.
作品任务Portfolio task
为最终模型建立三类 cohort,做误差、重要性和反事实调查,写修复/不修复决定。
Create three cohorts for the final model, investigate errors, importance, and counterfactuals, then document fix/no-fix decisions.
验收:Acceptance:每项决定都有样本证据、影响范围、验证计划和负责任使用边界。Each decision includes sample evidence, impact scope, validation plan, and responsible-use boundary.
自测:如果模型指标变高,但“用负责任 AI 工具调试模型”对应的真实决策没有改善,能否宣布成功?为什么?Self-check: If a model metric improves but the real decision behind “Model Debugging with Responsible AI dashboards” does not, can you claim success? Why?
No. Recheck the split, baseline, error types, and use context, then verify an observable outcome such as: Each decision includes sample evidence, impact scope, validation plan, and responsible-use boundary. A metric is only one piece of evidence.
Source: Microsoft ML-For-Beginners under the MIT License. Course attribution, official links, and version are preserved; teaching order, job examples, misconceptions, checks, and portfolio acceptance criteria are original.