使用 MATLAB 拟合神经网络

发布于 2024-09-07 09:37:27 字数 149 浏览 3 评论 0原文

我想使用神经网络拟合一个函数,以 0/1 作为输出。 请帮助我找到最好的方法。

事实上我想知道MATLAB中的拟合函数,特别是神经网络工具箱中的拟合函数。我不知道哪种方法适合对具有二进制输出的函数进行建模。

另外,在 MATLAB 中是否可以增加体重?

I want to fit a function using neural networks, with 0/1 as outputs.
please help me find the best way to it.

In fact I want to know the fitting function in MATLAB, specifically in the neural network toolbox. I don't know which method is good for modeling a function with binary output.

Also is there anyway in MATLAB that I can gain weights?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

何以笙箫默 2024-09-14 09:37:27

如果您有一个二元分类任务(0/1输出),那么您可以训练一个神经网络有两个输出节点,每个类一个,技巧是在输出节点,使其始终在 [0,1] 范围内(如果您使用 NEWPR 函数,这是默认值)。它可以解释为概率,那么您可以使用默认值 0.5 作为阈值,或者使用 ROC 曲线 为您的案例找到更好的阈值。

请参阅这篇文章了解 MATLAB 中的简单示例学习 XOR 二元运算符。

If you have a binary classification task (0/1 output), then you can train a NN with two output nodes, one per class, and the trick is to use a logistic function on the output node so that that its always in the range [0,1] (this is the default if you use NEWPR function). It can be interpreted as a probability, then you can use the default value 0.5 as threshold or maybe use ROC curves to find a better threshold for your case.

Please see this post for a simple example in MATLAB of learning the XOR binary operator.

獨角戲 2024-09-14 09:37:27

通常神经网络用于决策,因此 0/1 答案正是您想要的:“是”或“否”。

为了实际适应网络,需要使用两组已知的可产生“是”和“否”答案的组。然后计算I 类和 II 类错误的比率(通常称为纯度和 1-效率) )作为网络参数的函数。

这些函数的值介于 0 和 1 之间。拟合的目标是找到一组网络参数,在 I 类和 II 类误差之间产生可接受的平衡,同时使它们尽可能小。

Usually neural networks are used for decision making, so a 0/1 answer is just what you want: a "yes" or a "no".

To actually fit the network one uses two sets that are known to produce a "yes" and "no" answer. Then one calculates the rates of Type I and Type II errors (often called purity and 1-efficiency) as a function of the network parameters.

These functions have values between 0 and 1. The goal of the fit is to find a set of network parameters which produce an acceptable balance between Type I and Type II errors while making them both as small as possible.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文