第一章.Classification -- 08.ROC Curve Algorithm翻译

Let’s talk about another way to produce ROC curves.

So ROC curves can be produced in two ways: the one that I just showed you,

which is for a single, real valued classifier.

In that case, the ROC curve evaluates the classifier.

There’s another way to create an ROC curve,

where you can use a single algorithm and sweep the imbalance parameter across the full range and trace out an ROC curve to evaluate the algorithm.

So one is a property of a single classifier and the other is a property of a whole algorithm.

So let’s go over this way again and I’ll repeat how to do that.

So let’s say that we have our classifier – our function, f, and it’s increasing along this direction.

And we could place a decision boundary anywhere we wanted along here.

So let’s start from the top and sweep this thing down from top to bottom,

and every time we move it, you record the true positive rate and the false positive rate.

And then you plot all of those CPRs and FPRs on the scatter plot and that’s the ROC curve,

so let’s do it.

So we swing that whole thing that way and we record the true positive rate and false positive rate as we do it.

Okay, and that traces out this whole curve. So that’s the first way to create ROC curves,

and that’s for a single classification model.

And now let’s talk about how to evaluate an algorithm.

Do you remember the c parameter from the imbalanced learning section?

That’s the one that allows you to weight the positives differently than the negatives.

So here, I’m going to sweep through values of the c parameters and fit a machine learning model each time we adjust the c.

And we’re going to start with c being tiny.

So the classifier doesn’t care about the positives at all –

it just cares about getting the negatives right. And guess what?

It got all of them right because it just classified everything as negative.

Then we adjust c and we get this one.

And then we adjust c again and get that decision boundary and this one,

and that one. And as you do this sweep, you get different models each time,

but you also get a true positive rate and a false positive rate each time.

So you could plot those values on a ROC curve.

But this ROC curve evaluates the whole algorithm and not one algorithm.

Now what’s the advantage of using one of these methods over the other?

It’s not really like that – you can’t really say that.

One of these two things is an evaluation measure for a single function and the other is a measure of quality for a whole algorithm.

Usually an algorithm that’s optimized for a specific decision point can actually do better than an algorithm that is optimized for something else.

So usually, you would expect to see the ROC curve for the whole algorithm,

which is optimized at each point on this curve.

You’d expect that to do better than just the single classifier,

though every once in a while you do get a surprise and something weird happens.

But in any case, this is the idea.

If you use the algorithm and fiddle with the class weight parameter,

you’re essentially optimizing for each point along that curve.

Whereas, if you use a fixed classifier, you might be optimizing for one point on that curve,

or for something else entirely, so you wouldn’t expect the ROC curve to be as good.

Okay, so here ends the discussion of ways to produce ROC curves.

让我们讨论另一种生产ROC曲线的方法。

所以ROC曲线可以用两种方式产生:我刚才给你们看的那个,

这是一个单一的,实值的分类器。

在这种情况下,ROC曲线评估分类器。

还有一种创建ROC曲线的方法,

你可以使用一个算法,在整个范围内扫描不平衡参数,并找出一个ROC曲线来评估算法。

一个是单个分类器的属性另一个是整个算法的属性。

我们再看一遍,我重复一下怎么做。

假设有一个分类器,函数f,它沿着这个方向增长。

我们可以在任何我们想要的地方设置一个决策边界。

让我们从上面开始,从上到下,

每次移动的时候,你都记录了正确率和假阳性率。

然后把所有的CPRs和FPRs都画在散点图上这是ROC曲线,

让我们来做它。

所以我们用这种方法来改变整个事情我们记录了真实的正确率和假阳性率。

好的,这就是曲线的轨迹。这是创建ROC曲线的第一种方法,

这是一个分类模型。

现在我们来讨论一下如何计算一个算法。

你还记得不平衡学习部分的c参数吗?

这是允许你以不同于消极的方式来衡量积极因素的方法。

在这里,我将扫过c参数的值并在每次调整c时匹配机器学习模型。

我们从c很小开始。

所以分类器并不关心所有的优点。

它只关心负负的问题。你猜怎么着?

所有这些都是正确的,因为它把所有东西都归为负。

然后我们调整c,得到这个。

然后我们再调整c,得到这个决定边界,

这一个。当你做这个扫描时,每次都得到不同的模型,

但是你也会得到一个真实的正速率和一个假的正速率。

你可以在ROC曲线上画出这些值。

但是这个ROC曲线对整个算法进行了评估,而不是一个算法。

那么使用这些方法中的一个的好处是什么呢?

这不是真的,你不能这么说。

这两种方法中的一种是对单个函数的评估,另一种是对整个算法的质量度量。

通常,针对某个特定决策点进行优化的算法实际上比针对其他内容优化的算法做得更好。

通常情况下,你会看到整个算法的ROC曲线,

在这条曲线上的每一点上都进行了优化。

你会希望它比单一分类器做得更好,

虽然每隔一段时间你都会感到意外,但奇怪的事情发生了。

但无论如何,这是一个想法。

如果你使用这个算法来摆弄类权重参数,

你对曲线上的每一点都进行了优化。

然而,如果你使用固定的分类器,你可能会在曲线上的某一点进行优化,

或者完全是为了别的东西,所以你不会期望ROC曲线会这么好。

好的,这里结束了关于生产ROC曲线的方法的讨论。

深度学习是机器学习的一个子领域,它基于人工神经网络的研究,特别是利用多层次的神经网络来进行学习和模式识别。深度学习模型能够学习数据的高层次特征,这些特征对于图像和语音识别、自然语言处理、医学图像分析等应用至关重要。以下是深度学习的一些关键概念和组成部分: 1. **神经网络(Neural Networks)**:深度学习的基础是人工神经网络,它是由多个层组成的网络结构,包括输入层、隐藏层和输出层。每个层由多个神经元组成,神经元之间通过权重连接。 2. **前馈神经网络(Feedforward Neural Networks)**:这是最常见的神经网络类型,信息从输入层流向隐藏层,最终到达输出层。 3. **卷积神经网络(Convolutional Neural Networks, CNNs)**:这种网络特别适合处理具有网格结构的数据,如图像。它们使用卷积层来提取图像的特征。 4. **循环神经网络(Recurrent Neural Networks, RNNs)**:这种网络能够处理序列数据,如时间序列或自然语言,因为它们具有记忆功能,能够捕捉数据中的时间依赖性。 5. **长短期记忆网络(Long Short-Term Memory, LSTM)**:LSTM 是一种特殊的 RNN,它能够学习长期依赖关系,非常适合复杂的序列预测任务。 6. **生成对抗网络(Generative Adversarial Networks, GANs)**:由两个网络组成,一个生成器和一个判别器,它们相互竞争,生成器生成数据,判别器评估数据的真实性。 7. **深度学习框架**:如 TensorFlow、Keras、PyTorch 等,这些框架提供了构建、训练和部署深度学习模型的工具和库。 8. **激活函数(Activation Functions)**:如 ReLU、Sigmoid、Tanh 等,它们在神经网络中用于添加非线性,使得网络能够学习复杂的函数。 9. **损失函数(Loss Functions)**:用于评估模型的预测与真实值之间的差异,常见的损失函数包括均方误差(MSE)、交叉熵(Cross-Entropy)等。 10. **优化算法(Optimization Algorithms)**:如梯度下降(Gradient Descent)、随机梯度下降(SGD)、Adam 等,用于更新网络权重,以最小化损失函数。 11. **正则化(Regularization)**:技术如 Dropout、L1/L2 正则化等,用于防止模型过拟合。 12. **迁移学习(Transfer Learning)**:利用在一个任务上训练好的模型来提高另一个相关任务的性能。 深度学习在许多领域都取得了显著的成就,但它也面临着一些挑战,如对大量数据的依赖、模型的解释性差、计算资源消耗大等。研究人员正在不断探索新的方法来解决这些问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值