这是indexloc提供的服务,不要输入任何密码
Skip to content

panic: interface conversion: ... missing method CatToNum #47

@jerogee

Description

@jerogee

I run into an error using libsvm's sparse format, given the following files:

  1. Training data, 5 instances: https://www.dropbox.com/s/nlzfgj9235ffhsd/cf_test2.train.libsvm?dl=1
1.00000001 2:4.682604e-01 3:6.842105e-01 ...
1.60000001 2:2.247624e+00 3:4.454545e-01 ...
...
  1. Testing data, 2 instances: https://www.dropbox.com/s/t44uc09rdyboiev/cf_test2.test.libsvm?dl=1
0.16666601 2:1.619004e+00 3:3.390276e-01 ...
0.88888801 2:6.182730e-01 3:1.569653e-01 ...

Training goes well, but testing throws an error. Any idea what is going on?

$ growforest -train cf_test2.train.libsvm -rfpred cf_test2.sf -target 0
...
$ applyforest -fm cf_test2.test.libsvm -rfpred cf_test2.sf -preds cf_test2.pred
Target is 0 in feature 0
panic: interface conversion: *CloudForest.DenseNumFeature is not CloudForest.CatFeature: missing method CatToNum

goroutine 1 [running]:
github.com/ryanbressler/CloudForest.(*CatBallotBox).TallyError(0x20832bfe0, 0x2208291c48, 0x2082b40f0, 0x2)
    /Users/jg/src/github.com/ryanbressler/CloudForest/catballotbox.go:91 +0x5c
main.main()
    /Users/jg/src/github.com/ryanbressler/CloudForest/applyforest/applyforest.go:69 +0xb5a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions