Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argument list for class template "shark::RFClassifier" is missing #264

Open
cydcydcyd opened this issue Feb 22, 2019 · 9 comments
Open

argument list for class template "shark::RFClassifier" is missing #264

cydcydcyd opened this issue Feb 22, 2019 · 9 comments

Comments

@cydcydcyd
Copy link

Hi, I download shark4.0 from https://github.com/Shark-ML/Shark/tree/4.0
I compile the library and try to use RFTrainer, and I get some errors like:
Severity Code Description Project File Line Suppression State
Error (active) argument list for class template "shark::RFClassifier" is missing forestCounting c:\Users\chenyuduo\Desktop\forestCounting\forestCounting\forestCounting\main.cpp 64

Severity Code Description Project File Line Suppression State
Error (active) argument list for class template "shark::RFTrainer" is missing forestCounting c:\Users\chenyuduo\Desktop\forestCounting\forestCounting\forestCounting\main.cpp 65
Can you help me solve it?thanks

@Ulfgard
Copy link
Member

Ulfgard commented Feb 22, 2019

@Ulfgard
Copy link
Member

Ulfgard commented Feb 22, 2019 via email

@cydcydcyd
Copy link
Author

@Ulfgard
Thank you. I read examples to solve the problem.
Another problem is that RFTrainer is still slow in debug mode.
Did you speed up?

@Ulfgard
Copy link
Member

Ulfgard commented Feb 25, 2019 via email

@cydcydcyd
Copy link
Author

cydcydcyd commented Feb 26, 2019

hello,I try to use RFTrainer as regression, but the result is different from sklearn.
here is some of my codes:
data.shuffle(); data.makeIndependent(); RFTrainer<RealVector> trainer(false,false); trainer.setMaxDepth(10); trainer.setMinSplit(20); RFClassifier<RealVector> model; trainer.train(model, data); Data<RealVector> testInputs = createTestInputs(fMat); Data<RealVector> pred = model(testInputs);

@Ulfgard
Copy link
Member

Ulfgard commented Feb 26, 2019 via email

@cydcydcyd
Copy link
Author

cydcydcyd commented Feb 26, 2019

The results are quite different and I'm not sure if I missed the key steps.
I need to use OpenCV to calculate the feature of the images and the features in cv::Mat will be converted into shark::RealVector.
LabeledData<RealVector, RealVector> labeleddata = createLabeledDataFromRange(inputs, outputs);
WeightedLabeledData<RealVector, RealVector> data(labeleddata, 1.0f);
I set weight of each feature to 1.

@Ulfgard
Copy link
Member

Ulfgard commented Feb 26, 2019 via email

@cydcydcyd
Copy link
Author

My input feature is 637 dimensions, and the output tag is 49 dimensions. There are 2000 data in total. It takes 15sec to train with RFTrainer. Is this normal speed? I use release mode.
image
The parameter type of the train function is WeightedLabeledData < RealVector, RealVector >. I don't know how to do without weights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants