Lesson4-rossman -how to configure different weight for the samples with fastai when dealing with structed data?


(yang) #1

I have learned lesson4-rossman .

how to configure different weight for the samples with fastai when dealing with structed data?
we have a special dataset,
for example, the column_label has two values: 0 and 1, the samples are extremely unbalanced,
there are more than 800 thousand samples whose column_label are 0 but only 5000 samples whose colume_label are 1 . we want to raise theirs weight.

it can set different weight by “class_weight” parameter if using sklearn.linear_model.SGDClassifier

but how can achieve it with fastai?
thank you