- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想使用 sklearn SVR 方法,但当我编写 SVR()
函数时,它会抛出错误。它说SVR 不是可调用的
。
我就是这样调用它的
from sklearn.svm import SVR
这是我收到错误的代码
svr_lin = SVR(kernel='linear', C=1e3)
svr_poli = SVR(kernel='poly', C=1e3, degree = 2)
svr_rbf = SVR(kernel='rbf', C=1e3, gamma=0.1)
这是我得到的错误:
error in prediccion(fechas, precios, x)
24 svr_rbf = SVR(kernel='rbf', C=1e3, gamma=0.1)
25
26 svr_lin(fechas, precios) <----
27 svr_poli(fechas, precios)
28 svr_rbf(fechas, precios)TypeError: 'SVR' object is not callable
我也尝试过使用 SVC 等其他方法,但出现了相同的错误。
提前致谢。
最佳答案
关于python-3.x - SVR对象不可调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51693059/
我是机器学习新手,拥有 IMDb 电影数据集(约 14000 部)。我正在尝试使用支持向量回归模型来预测 IMDB 电影评级。为了进行预测,我使用“ratingCount”列。我使用 matplotl
我正在创建一个基本应用程序,根据使用 Python 和 Scikit-learn 的股票 n 的特征来预测股票第 n+1 天的“收盘”值(value) 我的数据框中的示例行如下所示(2000 行)
我正在使用SVR,并使用此resource。一切都很清晰,具有ε密集损失功能(如图)。预测自带管,用于覆盖大多数训练样本并使用支持向量来概括范围。 然后我们有了这个解释。 This can be de
我正在实现 SVR使用 sklearn python 中的 svr 包。我的稀疏矩阵大小为 146860 x 10202。我将它分成大小为 2500 x 10202 的各种子矩阵。对于每个子矩阵,SV
当我使用 Scikit learn 的 SVR 来拟合一些自己的数据时,经过训练的估计器最终不包含支持向量,因此预测值总是恒定的。令我惊讶的是,同样的代码在使用一些随机训练数据时可以完美运行。我的代码
我对建模技术有点陌生,我正在尝试比较 SVR 和线性回归。我使用 f(x) = 5x+10 线性函数来生成训练和测试数据集。到目前为止,我已经编写了以下代码片段: import csv import
我有以下训练数据: x = [ [0.914728682,5.217,5,0.217,3.150362319,33.36,35,-1.64,4.220113852], [0.88505
我有一个类似 twitter(另一个微博)的数据集,包含 160 万个数据点,并尝试根据其内容预测其转发数量。我提取了它的关键字并将关键字用作词袋特征。然后我得到了120万维的特征。特征向量非常稀疏,
stackoverflow上类似问题的答案建议更改实例SVR()中的参数值,但我不明白如何处理它们。 这是我正在使用的代码: import json import numpy as np from s
我面临以下问题,我正在从 scikit-learn 库中运行一个 SVR,训练集有大约 46500 个观察值,它运行了六个多小时,直到现在。 我正在使用线性内核。 def build_linear(s
例如,假设我有“性别”字段,并且我只想允许值 Male、Female 或 Unisex。这在 SQL Server Management Studio 中可能吗? 更新:到目前为止,解决方案指向“检查
我即将使用 Scikit-Learn 中的支持向量回归来预测 IMDB 评分(电影放映率)。问题是它总是为每个输入给出相同的预测结果。 当我使用数据训练进行预测时,它会给出各种结果。但是在使用数据测试
我最近发现可以在 SQL Server 2005 的索引中使用 WHERE 子句。我想优化一些查询,并希望得到一些反馈。 感兴趣的表包含 2 个浮点列,[长] 和 [短]。这些列在 20-40% 的行
我在做什么:我正在尝试使用在另一台机器上构建的经过测试的(腌制的)SVM 回归模型来预测数据。缩放工作正常,但即使尝试基于原始学习样本进行预测也会失败并出现相同的错误。 'SVR' object ha
我正在寻找一个支持向量回归(SVR)库,它可以为我提供用于计算预测值的回归模型/方程。您知道有什么库可以为我提供回归模型/方程作为输出以及预测值吗? 我使用了 Weka SMOreg,它运行良好,但它
我试图理解下面的代码有什么问题。我知道 Y 变量是 1D 数组,预计是 2D 数组,需要 reshape 结构,但该代码之前可以正常工作一个警告。 # Importing the libraries
我正在尝试使用 Java 中 LIBSVM 的 epsilon-SVR 来预测单变量时间序列(我的数据由两列、一个时间戳和一个数值组成)。 当我不使用功能时,仅将数组索引视为功能(我知道它不值得信赖)
我正在尝试优化 SVR 模型,但由于过度拟合而面临问题,为了克服这个问题,我尝试减少迭代次数,而不是一直等到收敛。 为了比较这两种模型,我需要两种情况下的迭代次数。如何知道在打开的情况下(max_it
这是代码的粘贴:SVM sample code 我检查了这个问题的其他几个答案...似乎这个问题的特定迭代有点不同。 首先,我的输入被归一化,每个点有五个输入。这些值的大小都合理(健康的 0.5s 和
我正在尝试使用 Scikit Learn Package 拟合 SVM 回归模型,但它没有像我预期的那样工作。 您能帮我找出错误吗?我想使用的代码是: from sklearn.svm import
我是一名优秀的程序员,十分优秀!