What input does SVM consider when doing the text classification?

I was using SVM for text classification

pipe_lr1 = Pipeline(steps=[('cv',TfidfVectorizer()),
('lr_multi',MultiOutputClassifier(LinearSVC()))])


Will SVM takes data like sparse matrices like this?

(0, 320)    1.0
(1, 106)    0.7418635863640789
(1, 320)    0.6705508326943057
(2, 547)    0.5655985284555338
(2, 1062)   0.556131277628881
(2, 320)    0.6089468832762044


or when I convert these into vectors using todense()

[[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]
...
[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]]


Which one of those will considered as inputs to svm In vector form or sparse form?

• It is hard to see whole picture with one code line. Would you share you code included your text data/dataset loading portion? Nov 14, 2022 at 19:58
• I cannot upload data, this is all the code I have, after this I will use pipe_lr1.fit(x_train1,y_train1) my question was what does SVM consider as Input data? Nov 14, 2022 at 20:06
• I am sorry for confusion. I didn't ask upload actual data. I want to see what kind text you want to analyze. Do you have any similar example of your data? Nov 14, 2022 at 21:49
• the data looks similar to this post datascience.stackexchange.com/questions/113586/… Nov 14, 2022 at 21:52