Questions tagged [multiclass-classification]

776 questions
1
vote
1 answer

allocating category to a comment pandas

My task is to allocate broad and fine category to the text I have in a pandas dataframe. My df is something like this: Text I like this pen this is the worst light bulb ever these pants fit me just fine Desired output: …
1
vote
1 answer

learning curve of multiclass classification task

I'm trying to do a multiclass classification using multiple machine learning using this function that I have created: def model_roc(X, y): X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, stratify=y, random_state=11) …
1
vote
1 answer

Why is testing accuracy so low, could there be a bug in my code?

I've been training an image classification model using object detection and then applying image classification to the images. I have 87 custom classes in my data(not ImageNet classes), and just over 7000 images altogether(around 60 images per…
1
vote
1 answer

StratifiedKfolds with imbalanced data for multiclass classification

I'm trying to build a model of multiclass classification using imbalanced data with few samples(436) and 3 classes. After standardizing data I split it using stratifiedkfolds to be sure that my minority class is represented well on the train and…
1
vote
0 answers

ROC_AUC from prediction probabilities from .pred_proba are better than from predictions from .pred

I have a multiclass classification problem. Now, I want to get the predictions from my fit classifier (OneVsRestClassifier(XGBoost)) to obtain the Area under the ROC curves in Scikit-Learn. I noticed that my AUCs from roc_curve and auc are better…
1
vote
1 answer

ImageNet classification challenge: Achieving top-5 error of 0.99472 on test set using VGG11

I recently took an imagenet pre-trained VGG11 network and made predictions on the imagenet test dataset. Upon submitting this file to the evaluation server, I received an email with following text: Error: 0.99607 (top-5) 0.99898 (top-1) Per-class…
1
vote
0 answers

Combining scikitlearn's GridsearchCV and lightgbm's mutliclass classifier

I am trying to find reliable hyper parameters for training a multiclass classifier, using both lgbm's "gbdt" and scikitlearn's GridsearchCV. On the feature side of things there is a ~4k x 40 matrix, containing continuous values. On the labeling side…
1
vote
0 answers

Stacking multiclass classification accuracy is lower than same model for binary classification problem?

I have developed a stacked classification model which consists of Random forest, CNN, and logistic regression as a meta-model. Its accuracy is 99% for binary classification problem and its accuracy on multiclass classification is very low. Epoch…
1
vote
0 answers

how to predict a single image using already trained model in keras

I reeferred https://www.kaggle.com/code/lsind18/gemstones-multiclass-classification-cnn to train a model. According to the above referred source,the test images are included as sub folders in the root directory.(That is the Test folder has sub…
1
vote
2 answers

Dimension issues for LSTM sequence model on Keras

I'd like to train a simple LSTM model for sequence data with 128 time steps with 6 features for 118 multi-classes. The dimensions of the dataset are shown below: X_train, X_test shape: (batch, timesteps, num_features) = (batch, 128, 6) y_train,…
1
vote
1 answer

Getting a ValueError: Shapes (None, 1) and (None, 5) are incompatible

X_train = df_train["Base_Reviews"].values X_test = df_test["Base_Reviews"].values y_train = df_train['category'].values y_test = df_test['category'].values num_words = 20000 #Max. workds to use per toxic comment max_features = 15000 #Max. number…
1
vote
1 answer

UserWarning: One or more of the test scores are non-finite – GridSearchCV for MultiOutputClassifier(MLPClassifier)

I am trying out scikit-learn for the first time, for a Multi-Output Multi-Class text classification problem. I am attempting to use GridSearchCV to optimize the parameters of MLPClassifier for this purpose. Below is the code I have so far: import…
P A N
  • 5,642
  • 15
  • 52
  • 103
1
vote
1 answer

How to use GridSearchCV with MultiOutputClassifier(MLPClassifier) Pipeline

I am trying out scikit-learn for the first time, for a Multi-Output Multi-Class text classification problem. I am attempting to use GridSearchCV to optimize the parameters of MLPClassifier for this purpose. I will admit that I am shooting in the…
P A N
  • 5,642
  • 15
  • 52
  • 103
1
vote
1 answer

ValueError: Classification metrics can't handle a mix of multiclass and continuous-multioutput targets

I am trying to calculate the f1 score for a multi-class classification problem using the Cifar10 dataset. I am importing f1 metirics from the sklearn library. However I keep getting the following error message: ValueError: Classification metrics…
1
vote
0 answers

When to use OneVsRestClassifier?

If the decision function of svm.SVC is by default "ovr", why would we use OneVsRestClassifier(svm.SVC(kernel="linear") instead of just svm.SVC(kernel="linear")?