<div dir="ltr">Hi all,<div><br></div><div>I'm looking to run a 3-way classification with LinearCSVMC(), but I'd like to assign different weights to each of the labels. </div><div><br></div><div>That being said, I'm a little confused as to how I should input the weights for each label, since I'm not exactly sure how the SVM would know how to map the correct weights to the labels assigned in the data set.  My first attempt went something like this:</div>
<div><br></div><div>weights = [1,5,10]</div><div>weight_labels = 'class1', 'class2', 'class3']  #Where class1 corresponds to one of the target labels, class 2 corresponds to the second target label, and so on.</div>
<div><br></div><div>clf = LinearCSVMC(weight=weights, weight_label=weight_labels)</div><div><br></div><div>This read out the following error:</div><div>







<p class=""><span class="">FailedToTrainError</span>: invalid literal for int() with base 10: 'class1'</p>I assumed (falsely) that by inputting the corresponding labels in the data set to the weight_labels attribute that it would correctly assign the weights to the correct labels.  Anyhow, I subsequently changed the weight_labels to integers, i.e.,<br>
weight_labels=[0, 1, 2]</div><div><br></div><div>and it seemed to run fine.  However, I'm not exactly sure how PyMVPA interfaces with the actual SVM package, so I'm worried it may be assigning weights to the incorrect labels.  I also contemplated the thought that maybe the weights should be inputted as an array of length n, where n=number of samples being funneled into the classifier, but I figured I should clarify on the forum first before I guessed around.</div>
<div><br></div><div>Thank you in advance for any advice!</div><div><br></div><div>Best,</div><div>Taku</div><div><br>
</div></div>