I have a csv, struct is
CAT1,CAT2,TITLE,URL,CONTENT
, CAT1, CAT2, TITLE ,CONTENT are in chinese.
I want train LinearSVC
or Multinomial
Thanks to @meelo, I solved this problem.
As he said: in my code, data
is a feature vector, target
is target value. I mixed up two things.
I learned that TfidfVectorizer
processes data to [data, feature], and each data should map to just one target.
If I want to predict two type targets, I need two distinct targets:
target_C1
with all C1 valuetarget_C2
with all C2 value.Then use the two targets and original data to train two classifier for each target.