r - 如何在 R 中为单调(非递减)函数实现 SVM?
问题描述
我有一个简单的回归方程,类似于
svm_cv<-tune( svm,
count~day_index,
kernel="radial",
scale=TRUE,
data=bdata,
ranges=list(cost=2^(-8:8),
gamma=2^(-8:8))
)
现在,当我绘制从模型做出的预测时,我可以看到的增加是不正确的,因此值count
永远不会减少day_index
svm_cv$best.model
如何在 R 中应用此限制?
解决方案
对于任何有相同要求的人: reddit 用户uzzler10向我指出了isoreg库,它似乎已经完成了我需要的操作
https://stat.ethz.ch/R-manual/R-devel/library/stats/html/isoreg.html
推荐阅读
- apache - 如何在apache上启用cors?
- linux - Tensorflow 源构建配置失败:找不到任何 cuda.h 匹配版本和字典值错误
- ruby-on-rails - 更改模型回调的参数值
- html - 背景重复:空间;有时在CSS中不起作用
- c# - 不可覆盖的成员(此处:Login.getInfo)不得用于设置/验证表达式
- python - ImportError:没有名为“utils.io”的模块
- asp.net-core - 旋转木马在部分视图中只显示一张卡片?
- javascript - 将属性插入到 Vanilla JS 中特定索引处的对象中
- ruby - 为什么更改 RSpec 中“it”和“subject”的顺序会改变我的测试结果?
- react-native - 如何在没有 npm 的情况下手动从 github 下载和导入 node 模块,并将其安装在 React Native 项目中?