我正在浏览此svm tutorial并尝试将其应用于我的数据。
我在矩阵 ept
中读取了SQLite中的数据 但是,对我来说,结构看起来很相似> print (cats)
Sex Bwt Hwt
1 F 2.0 7.0
2 F 2.0 7.4
...
48 M 2.0 6.5
49 M 2.0 6.5
> print(ept)
EPT DIL BRT EX
1 T640 -0.968750 -0.372549020 0.32400
2 T640 -0.968750 -0.325490196 0.32400
...
30 T1280 -0.984375 0.082352941 -0.04675
31 T1280 -0.984375 0.145098039 -0.04675
...
cat的摘要在第1列中产生不同的输出结构:
> summary(cats)
Sex Bwt Hwt
F:47 Min. :2.000 Min. : 6.30
M:97 1st Qu.:2.300 1st Qu.: 8.95
Median :2.700 Median :10.10
Mean :2.724 Mean :10.63
3rd Qu.:3.025 3rd Qu.:12.12
Max. :3.900 Max. :20.50
> summary(ept)
EPT DIL BRT EX
Length:119 Min. :-0.9844 Min. :-0.71765 Min. :-0.5587
Class :character 1st Qu.:-0.9688 1st Qu.:-0.42353 1st Qu.:-0.0235
Mode :character Median :-0.9375 Median :-0.16078 Median : 0.1555
Mean :-0.8887 Mean :-0.16981 Mean : 0.1635
3rd Qu.:-0.8750 3rd Qu.: 0.04706 3rd Qu.: 0.5000
Max. : 0.0000 Max. : 0.59216 Max. : 0.5000
然后在ept上调用数据也失败了:
> data(cats)
> data(ept)
Warning:
In data(ept) : data-set ‘ept’ not found # my translation here
>
我在这里缺少什么?我怎样才能为svm创建自己的数据集(e1071)?
答案 0 :(得分:0)
转换帮助:
ept$EPT <- factor(ept$EPT)