Revision history [back]

there is no problem with setting the weights using

svm->setClassWeights(weights);


at all. while you could also pass them into the TrainData structure, it does not matter, in both cases we have valid classWeights in SVMImpl::do_train(). (where those are actually used)

it also does not matter, if you make it 1x4 or 4x1, the only requirement is: 1 dim has to 1, the other numClasses (and type should be float or double).

so, everything is all right, and happy coding ;)

there is no problem with setting the weights using

svm->setClassWeights(weights);


at all. while you could also pass them into the TrainData structure, it does not matter, in both cases we have valid classWeights params.classWeights in SVMImpl::do_train(). (where those are actually used)

it also does not matter, if you make it 1x4 or 4x1, the only requirement is: 1 dim has to 1, the other numClasses (and type should be float or double).

so, everything is all right, and happy coding ;)

there is no problem with setting the weights using

svm->setClassWeights(weights);


at all. while you could also pass them into the TrainData structure, it does not matter, in both cases we have valid params.classWeights in SVMImpl::do_train(). (where those are actually used)

it also does not matter, matter, if you make it 1x4 or 4x1, the only requirement is: requirements are:

• 1 dim has to 1, 1
• the other dim must be numClasses (and
• type (of the weights) should be float or double).

double
• SVM type must be C_SVC

so, everything is all right, and happy coding ;)