简体   繁体   English

结合两种分类模型

[英]Combining Two Classification Models

I'm new with machine learning, I have labeled data with 0 for normal and 1 for attack, The idea is like this:我是机器学习的新手,我将数据标记为 0 表示正常,1 表示攻击,想法是这样的:

I want to build a model that apply DT in the first level.我想构建一个在第一级应用 DT 的模型。 The output from DT will be Either Normal or attack. DT 的输出将是 Normal 或 Attack。 Firstly if the data classified as attack by DT we alert, Secondly, if the data classified as a normal, we take the normal data and fed it to the second model (SVM) to double check if normal or attack.首先,如果数据被 DT 归类为攻击,我们会发出警报,其次,如果数据归类为正常,我们将正常数据输入到第二个模型(SVM)中,以仔细检查是否正常或攻击。

I have read about ensemble learning, but most of these methods combine the models and take the average or weighting, Any idea how can we implement this?我已经阅读了关于集成学习的内容,但是这些方法中的大多数都将模型结合起来并取平均值或加权,知道我们如何实现这一点吗? Thanks谢谢

You defined a rule for combining the two models, but why don't you let a model learn this rule?你定义了一个规则来组合两个模型,但为什么不让模型学习这个规则呢?

You can train both DT and SVM on all the data.您可以在所有数据上训练 DT 和 SVM。 Then, take the output of both (the probability of normal), and feed this to another model (a DT for example) that will predict the final prediction.然后,获取两者的输出(正常概率),并将其提供给另一个将预测最终预测的模型(例如 DT)。

In this way the last model (which is called super model), can learn if the right way to combine the models is average/weighting/max/min or your rule...通过这种方式,最后一个模型(称为超级模型)可以了解组合模型的正确方法是平均值/权重/最大值/最小值还是您的规则......

I hope it helps 😄我希望它有帮助😄

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 结合两种不同的深度学习模型进行评估 - Combining two different deep learning models for evaluation 结合/合并KERAS中的两种转移学习模型 - Joining/Combining two models for Transfer Leaning in KERAS 组合两个或多个查询集或将不同模型组合为单个输出 - Combining two or more queryset or combining different models as a single output 在Python中结合聚类和分类 - Combining Clustering and classification in Python Django - 将两个模型序列化器组合成一个 JSON 响应 - Django - combining two models serializer into one JSON response 将两个预训练模型与 2 个不同的类(数据集)结合起来进行预测 - Combining two Pre Trained models with 2 different classes (dataset) for Prediction 如何修改 PyTorch 中的预训练 Torchvision 模型以返回两个输出用于多标签图像分类 - How to modify Pretrained Torchvision Models in PyTorch to return two outputs for multilabel Image Classification 经典分类模型的简单 CV - Simple CV for classic classification models 结合多个二元分类器 (LinearSVC) 进行多标签分类 - Combining Multiple Binary Classifiers (LinearSVC) for Multilabel Classification 结合 PyTorch 中的文本和表格数据进行分类 model - Combining text and tabular data in PyTorch for classification model
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM