If the data set is highly imbalanced i would suggest you yo use Structural SVM instead of basic classification model.
From section 3.3 of the paper - predicting structured objects with support vector machines1
What does this mean for learning? Instead of optimiz-
ing some variant of error rate during training, which is what
conventional SVMs and virtually all other learning algo-
rithms do, it seems like a natural choice to have the learning
algorithm directly optimize, for example, the F 1 -Score (i.e.,
the harmonic mean of precision and recall). This is the point
where our binary classification task needs to become a struc-
tured output problem, since the F 1 -Score (as well as many
other IR measures) is not a function of individual examples
(like error rate), but a function of a set of examples. In partic-
ular, we arrive at the structured output problem of predict-
ing an array of labels y = ( y 1 , ..., y n ), y i Î {−1, +1}, for an array
of feature vectors x = (x 1 , ..., x n ), x i Î Â N . Each possible array
of labels y– now has an associated F 1 -Score F 1 (y, – y ) w.r.t. the
true labeling y, and optimizing F 1 -Score on the training set
becomes a well-defined problem.
I would suggest you to read the entire paper.
For implementation you can use python pystruct library2