LibSVM: -wi option (weight selection) for cross-validation and testing

I need help choosing libSVM weights. I am at some point embarrassed; should I use the -wi option for cross validation? If so, should the calculated weights of all data or the calculated weights be used in accordance with the v-1 subsets (for v-fold cross-validation)? And my second question is whether to use the -wi option during forecasting? If so, should we use the calculated weights during training or should we calculate the weights according to the distribution of negative and positive instances in the test data?

For instance; we have 50 + data and 200 - data. Therefore, after calculating the best values โ€‹โ€‹of the parameter c and gamma, we will use the -w1 4 -w-1 1 options during training. But what about training during grid searching and cross validation? Say we perform a fivefold cross-validation. During training, for each of the remaining 4 subsets, the distribution of negative and probable instances is likely to change. So, should we recalculate weights during this 5-fold cross check?

Besides shoud, do we use the -w1 4 -w-1 1 options during testing?

thank

+4
source share
1 answer

, , /, C ( / /, , , )

libSVM , libSVM - , / . , .

, ( "" "//" / , "", )

+6

All Articles