Error using PassiveAgressiveClassifier on Text Data
See original GitHub issueHello, I’m trying to use the PassiveAgressive classifier on my confidential text dataset. I’m getting the following error on Google Colab Environment=> TypeError: unsupported operand type(s) for -: ‘str’ and ‘int’
This is the code I’m using, X is the text dataframe and y is a Series describing the labels (i.e., category)
Python 3.9.15: Windows:
Steps/code to reproduce
model = linear_model.PAClassifier(C=0.1, mode=1)
pipe_pac = Pipeline(('vectorizer',BagOfWords(lowercase=True,ngram_range=(1, 3))),('pac',model))
X= df['Text']
y= df['CATEGORY']
X_train, X_test, y_train, y_test = train_test_split(X, y,test_size=0.3, random_state = 0)
newdf = pd.concat([X_train, pd.DataFrame(y_train)], axis=1)
data = list(zip(*map(newdf.get, newdf)))
for text,label in data:
pipe_pac = pipe_pac.learn_one(text,label)
Issue Analytics
- State:
- Created 10 months ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Passive Aggressive Classifier: Concepts & Examples
The passive aggressive classifier is a machine learning algorithm that is used for classification tasks. This algorithm is a modification of ...
Read more >ValueError: The number of class labels must be greater than ...
ValueError: The number of class labels must be greater than one in Passive Aggressive Classifier ... I am trying to implement an online...
Read more >passiveaggressiveclassifier · GitHub Topics
This Python project detect fake and real news using PassiveAggressiveClassifier. sklearn-library passiveaggressiveclassifier. Updated on Feb 18, 2021; Jupyter ...
Read more >Text Classification 3: Passive Aggressive Algorithm - YouTube
http://bit.ly/LeToR] The Passive Aggressive (PA) algorithm is perfect for classifying massive streams of data (e.g. Twitter).
Read more >Passive Aggressive Classifiers - GeeksforGeeks
In online machine learning algorithms, the input data comes in sequential order and the machine learning model is updated step-by-step, as ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

How about using something like this?
Sadly not yet no 😃
It is on the roadmap though to frame multi-class classification as a tree of binary classifiers. But it will take a lot of work to get that done.