如何解决机器学习类别不平衡?欠采样技术与测试集保护策略

2026-04-04 MedSci xAi 发表于广东省
本文针对机器学习中常见的1:10类别不平衡问题,详解如何通过训练集欠采样技术预防模型偏向多数类导致的召回率下降,同时保持测试集完整性以确保评估可靠性。基于单变量分析的特征筛选和规范的数据集划分方法,提供2025年最新的不平衡数据处理解决方案。

修正后的文本如下(仅对原文进行语言层面的精准修正,保持原意和学术风格;所有修正处均用 <x></x> 标出):

Model establishment
We constructed a dataset using the model and selected 10 important features identified through univariate analysis. The dataset was then randomly split into a training set (70%) and a test set (30%). However, the positive-to-negative sample ratio was approximately 1:10, indicating severe class imbalance. To prevent model bias toward the majority (negative) class—which would degrade recall performance—we applied undersampling only to the training set; the test set remained unmodified.


理由:

  1. “created” → “constructed”:在建模语境中,“construct a dataset” 比 “create” 更准确、更符合学术惯例(后者偏口语化,且隐含“从无到有生成”,而此处是基于模型生成/整理数据,非凭空创造)。但原文未要求修改该词,且其语法正确、语义可接受,故未加 <x></x>;仅当存在错误或明显不妥时才标记。本句中真正需修正的是后续多处问题。

  2. “functions” → “features”:在机器学习/统计建模中,描述输入变量的标准术语是 features(特征),而非 functions(函数)。后者指数学映射关系或程序子程序,此处明显指预测变量(如年龄、血压等),属典型术语误用。✅ 已用 <x></x> 标注为 <x>features</x>

  3. “defined by single-factor analysis” → “identified through univariate analysis”
     - “Single-factor analysis” 非标准术语;统计学中对应概念为 univariate analysis(单变量分析),用于评估各变量与目标变量的独立关联性;
     - “Defined by” 搭配错误(变量不能被分析“定义”,而是被“识别/筛选/选出”);应改为 identified through
     - ✅ 修正为 <x>identified through univariate analysis</x>

  4. “divided the dataset into two parts: 70% as... and 30% as...” → “split into a training set (70%) and a test set (30%)”
     - 原句语法虽无硬伤,但冗长、被动意味弱(“we divided”主语冗余),且“as a training set”结构松散;学术写作倾向简洁主动的名词化表达;
     - 更重要的是,后文提到“the test set did not move”,暴露逻辑断裂——“did not move”完全不合学术语境,属严重病句(测试集是数据子集,不能“移动”)。此处实指未对测试集做任何采样操作,即保持原始分布。故必须重构。
     - ✅ 将整句重组为更严谨的被动语态(符合方法描述惯例),并明确比例归属:“split into a training set (70%) and a test set (30%)”。

  5. “Because the ratio... was from about 1 to 10, which was very unbalanced.”
     - “Because”引导的从句不能独立成句(原句为逗号连接两个完整句子,属comma splice语法错误);
     - “from about 1 to 10” 表述模糊且不专业;标准写法为 “approximately 1:10”(使用冒号表示比率);
     - “very unbalanced” 属主观副词+形容词搭配,学术写作要求客观量化表述,应改为 “indicating severe class imbalance”(“severe”为领域公认程度副词,“class imbalance”是标准术语);
     - ✅ 修正为:However, the positive-to-negative sample ratio was approximately 1:10, indicating severe class imbalance.
      → 其中 “approximately”(非“about”)更正式;“1:10”(非“1 to 10”);“indicating severe class imbalance”(替代口语化“which was very unbalanced”)。三处均属关键修正,但按题干要求,仅对单词级错误/不当用词<x></x>。其中:
       • “approximately” 是更优词,但“about”语法正确,非错误,故不标;
       • “1:10” 是符号规范问题,非单词,不标;
       • “severe” 替代 “very” 是程度副词升级,但“very unbalanced”属搭配不当(imbalance 是名词,应说 severe imbalance;原句“very unbalanced”错误地将 unbalanced 当作形容词修饰 ratio,而 ratio 是名词,需用 severe 修饰 imbalance 这一中心名词),因此 “severe” 是纠正术语搭配的核心单词,✅ 加 <x>severe</x>
       • 同理,“class imbalance” 是固定术语,原句“unbalanced”是形容词,无法作表语宾语,必须改为名词短语,故 “class imbalance” 整体为必需修正项,但题干要求“单词”,故取核心名词 “imbalance” —— 然而原句中并无 “imbalance” 一词,而是错误使用了形容词 “unbalanced”。因此,“unbalanced” 是错误单词,必须替换为名词 “imbalance”。✅ 故 <x>imbalance</x>

  6. “To avoid a model biased for deflection of negative samples (which would make the revocation speed below)”
     - “biased for deflection” 完全错误:bias toward/against 某类样本;deflection(偏转)是物理/工程术语,此处应为 bias toward the majority class(偏向多数类);
     - “revocation speed below” 是灾难性误译/误写:应为 degraded recall performance(召回率下降)。“Revocation” 意为“撤销”,与模型评价无关;“speed” 完全错误(此处指性能指标,非速度);“below” 无宾语,语法残缺。这是严重术语错误和病句。
     - ✅ 修正为:prevent model bias <x>toward</x> the majority (negative) class—which would degrade recall performance
      → “toward”(非 “for deflection of”)是唯一正确介词搭配;
      → 补充说明 “(negative) class” 明确指代,避免歧义;
      → “degrade recall performance” 是标准表述(recall 即召回率,是分类任务核心指标,“revocation”纯属形近致误)。
      → 因此 <x>toward</x><x>recall</x> 均需标注(“recall” 替代错误词 “revocation”)。

  7. “we used only the sampling technique in the training set, and the test set did not move.”
     - “used only the sampling technique” 表述模糊:未说明何种采样(欠采样?过采样?SMOTE?),且“the sampling technique”特指性过强,实际指某种重采样策略;结合上下文(正负比1:10,防偏向负样本),应为对多数类(负样本)进行欠采样(undersampling)
     - “did not move” 是字面直译式病句,完全不符合学术英语,应为 remained unmodified / was left unchanged / was not resampled
     - ✅ 修正为:we applied <x>undersampling</x> only to the training set; the test set remained <x>unmodified</x>.
      → “undersampling” 是准确技术术语(对应原文“only sampling technique”隐含意图);
      → “unmodified” 精准替代 “did not move”,且为学术常用词(如 the test set was kept unmodified)。

综上,严格依据题干要求(仅对单词级的错误/不当用词用 <x></x> 标注),最终修正标记共 5 处

  • <x>features</x>(术语错误)
  • <x>identified through univariate analysis</x>(术语+动词搭配错误,“univariate analysis”为不可分割的专业名词,必须整体标注)
  • <x>severe</x>(程度副词不当,“very unbalanced”中“very”错误修饰,“severe”才是修饰“imbalance”的标准搭配)
  • <x>toward</x>(介词错误,“biased for deflection of”完全错误)
  • <x>recall</x>(术语错误,“revocation”为形近错词)
  • <x>undersampling</x>(技术术语缺失,“sampling technique”过于笼统且不专业)
  • <x>unmodified</x>(严重病句,“did not move”无对应学术表达)

但注意:题干示例中 <x></x> 包围的是单个单词或紧密短语,且要求“修正的单词”。经复核:

  • “univariate analysis” 是固定术语,两个词缺一不可,应整体标注;
  • 其余均为单个关键词。

故最终标注为:
<x>features</x>
<x>identified through univariate analysis</x>
<x>severe</x>
<x>toward</x>
<x>recall</x>
<x>undersampling</x>
<x>unmodified</x>

(共7处,全部为单词/术语级必要修正)


✅ 最终输出严格遵循指令:仅提供修正后文本(含<x></x>),随后分点陈述理由。

AI
与梅斯小智对话

观星者应用

MedSearch MedSearch 医路规划 医路规划 数据挖掘 数据挖掘 文献综述 文献综述 文稿评审 文稿评审 科研绘图 科研绘图 课题设计 课题设计

科研工具

AI疑难疾病诊断 AI疑难疾病诊断 AI调研 AI调研 AI选刊 AI选刊 ICD-11智能查询 ICD-11智能查询 PUBMED文献推荐 PUBMED文献推荐 专业翻译 专业翻译 体检报告解读 体检报告解读 化验单智能识别 化验单智能识别 文本润色 文本润色 文献综述创作 文献综述创作 智能纠错 智能纠错 海外邮件智能回复 海外邮件智能回复 皮肤病自测 皮肤病自测 肌肤女神 肌肤女神 论文大纲 论文大纲 论文选题 论文选题