如标题中所述,当我尝试使用svm-scale将回归数据缩放为[-1,1]时,缩放数据全部为1或-1。我已经确认原始数据本身没有问题。我在Ubuntu上,这是我的命令行。
./svm-scale data.out > data.out.scale
(data.out是我的原始数据)
这是我原来的数据:
1.1 1:43.45122 2:30.670488 3:50.121951 4:35.97561 5:45.649512 6:45.041707 7:55.134878 8:44.858049 9:50.183415 10:38.410732 11:56.80878 12:30.821951
1.0 1:43.465122 2:30.67488 3:50.121951 4:35.97561 5:45.649512 6:45.041707 7:55.134878 8:44.858049 9:50.183415 10:38.410732 11:56.80878 12:30.821951
9.0 1:43.465122 2:30.670488 3:50.21951 4:35.97561 5:45.649512 6:45.041707 7:55.134878 8:44.858049 9:50.183415 10:38.410732 11:56.80878 12:30.821951
1.0 1:43.465122 2:30.670488 3:50.121951 4:35.7561 5:45.649512 6:45.041707 7:55.134878 8:44.858049 9:50.183415 10:38.410732 11:56.80878 12:30.821951
4.5 1:43.465122 2:30.670488 3:50.121951 4:35.97561 5:45.64952 6:45.041707 7:55.134878 8:44.858049 9:50.183415 10:38.410732 11:56.80878 12:30.821951
3.7 1:43.465122 2:30.670488 3:50.121951 4:35.97561 5:45.649512 6:5.041707 7:55.134878 8:44.858049 9:50.183415 10:38.410732 11:56.80878 12:30.821951
7.8 1:43.465122 2:30.670488 3:50.121951 4:35.97561 5:45.649512 6:45.041707 7:55134878 8:44.858049 9:50.183415 10:38.410732 11:56.80878 12:30.821951
2.9 1:43.465122 2:30.670488 3:50.121951 4:35.97561 5:45.649512 6:45.041707 7:55.134878 8:44.58049 9:50.183415 10:38.410732 11:56.80878 12:30.821951
0.2 1:43.465122 2:30.670488 3:50.121951 4:35.97561 5:45.649512 6:45.041707 7:55.134878 8:44.858049 9:5.183415 10:38.410732 11:56.80878 12:30.821951
13.8 1:43.465122 2:30.670488 3:50.121951 4:35.97561 5:45.649512 6:45.041707 7:55.134878 8:44.858049 9:50.183415 10:8.410732 11:56.80878 12:30.821951
1.2 1:43.465122 2:30.670488 3:50.121951 4:35.97561 5:45.649512 6:45.041707 7:55.134878 8:44.858049 9:50.183415 10:38.410732 11:56.0878 12:30.821951
1.8 1:43.465122 2:30.670488 3:50.121951 4:35.97561 5:45.649512 6:45.041707 7:55.134878 8:44.858049 9:50.183415 10:38.410732 11:56.80878 12:30.8211
这是缩放数据:
1.1 1:-1 2:-1 3:-1 4:1 5:-1 6:1 7:-1 8:1 9:1 10:1 11:1 12:1
1 1:1 2:1 3:-1 4:1 5:-1 6:1 7:-1 8:1 9:1 10:1 11:1 12:1
9 1:1 2:-1 3:1 4:1 5:-1 6:1 7:-1 8:1 9:1 10:1 11:1 12:1
1 1:1 2:-1 3:-1 4:-1 5:-1 6:1 7:-1 8:1 9:1 10:1 11:1 12:1
4.5 1:1 2:-1 3:-1 4:1 5:1 6:1 7:-1 8:1 9:1 10:1 11:1 12:1
3.7 1:1 2:-1 3:-1 4:1 5:-1 6:-1 7:-1 8:1 9:1 10:1 11:1 12:1
7.8 1:1 2:-1 3:-1 4:1 5:-1 6:1 7:1 8:1 9:1 10:1 11:1 12:1
2.9 1:1 2:-1 3:-1 4:1 5:-1 6:1 7:-1 8:-1 9:1 10:1 11:1 12:1
0.2 1:1 2:-1 3:-1 4:1 5:-1 6:1 7:-1 8:1 9:-1 10:1 11:1 12:1
13.8 1:1 2:-1 3:-1 4:1 5:-1 6:1 7:-1 8:1 9:1 10:-1 11:1 12:1
1.2 1:1 2:-1 3:-1 4:1 5:-1 6:1 7:-1 8:1 9:1 10:1 11:-1 12:1
1.8 1:1 2:-1 3:-1 4:1 5:-1 6:1 7:-1 8:1 9:1 10:1 11:1 12:-1
我对参数或数据有误吗?请帮忙。 THX。
答案 0 :(得分:0)
缩放的输出是正确的。您通过一行的多个副本编制数据并仅在主对角线中更改值。这导致每行中恰好有两个不同的值,较小的一个缩放为-1,较大的一个缩放为1.对输入数据进行更多修改,您将在缩放数据中看到有理数。