weka up-sampling & down-sampling
2015-06-24 20:14
405 查看
up-sampling:
SMOTE algorithm,over-sampled by creating ``synthetic'' examples rather than by over-sampling with replacement.
Weka supervised SMOTE filter
两个参数:
[list]
[*]nearestNeighbors:how many nearest neighbor instances (surrounding the currently considered instance) are used to build an inbetween synthetic instance. 默认取值5.
[*]percentage.how many synthetic instances are created based on the number of the class with less instances. 默认值100,假设minority class有25个样本,则25个新样本将会根据nearest Neighbors来合成,此时minority class的样本数变成了50.
[/list]
down-sampling
The majority class is under-sampled by randomly removing samples from the majority class population until the minority class becomes some specified percentage of the majority class.
Weka supervised SpreadSubsample filter
maxCount:可以取minority class的样本数量 n。
如果 maxCount < n: 则正负例的样本数量都减少到maxCount
如果 maxCount > n: 则minority class的样本数量 n不变,majority class的样本数量减少到maxCount
SMOTE algorithm,over-sampled by creating ``synthetic'' examples rather than by over-sampling with replacement.
Weka supervised SMOTE filter
两个参数:
[list]
[*]nearestNeighbors:how many nearest neighbor instances (surrounding the currently considered instance) are used to build an inbetween synthetic instance. 默认取值5.
[*]percentage.how many synthetic instances are created based on the number of the class with less instances. 默认值100,假设minority class有25个样本,则25个新样本将会根据nearest Neighbors来合成,此时minority class的样本数变成了50.
[/list]
down-sampling
The majority class is under-sampled by randomly removing samples from the majority class population until the minority class becomes some specified percentage of the majority class.
Weka supervised SpreadSubsample filter
maxCount:可以取minority class的样本数量 n。
如果 maxCount < n: 则正负例的样本数量都减少到maxCount
如果 maxCount > n: 则minority class的样本数量 n不变,majority class的样本数量减少到maxCount
Instances train = DataSource
.read(path);
train.setClassIndex(rawins.numAttributes() - 1);
weka.filters.supervised.instance.SpreadSubsample sps = new SpreadSubsample();
sps.setMaxCount(n); //minority class的样本数量 n
sps.setInputFormat(train);
Instances ins = sps.useFilter(train, sps);
相关文章推荐
- 图像的上采样(up-sampling)和下采样(down-sampling)
- 图像的上采样(up-sampling)和下采样(down-sampling)
- matlab 信号与系统(一)—— 上采样(Upsampling)和下采样(Downsampling)
- sicily 1176. Two Ends (Top-down 动态规划+记忆化搜索 v.s. Bottom-up 动态规划)
- 重构之Pull up Method 与Push Down Method
- vc中处理按钮的UP和DOWN事件
- Button中MouseLeftButtonDown和MouseLeftButtonUp事件无法触发的解决方案
- Tasker : Scale Up/Down CPU Speed at Different Times
- linux 中vi命令^f 往下一页 (forward) ^b 往上一页 (before) ^d 往下半个屏幕(down) ^u 往上半个屏幕(up)
- up和down还可以使用类似选择器的形式来捕获控件
- KeyPress,UP DOWN LEFT RIGHT触发不了
- 【IndiaHacks 2016 - Online Edition (Div 1 + Div 2) ErrichtoC】【脑洞 好题 讨论?NO!暴力】Bear and Up-Down 多少种一次交
- 图像的上采样(upsampling)与下采样(subsampled)
- 1338_Up and Down Sequences
- CentOS7 Failed to start LSB: Bring up/down解决方法
- Eclipse快捷键 ctrl+alt+up/down 不起作用
- BigDecimal.ROUND_HALF_UP和BigDecimal.ROUND_HALF_DOWN的区别
- 如何 Scale Up/Down Deployment?- 每天5分钟玩转 Docker 容器技术(126)
- OpenGL缺少滚轮控制事件GLUT_WHEEL_UP, GLUT_WHEEL_DOWN