Questions tagged [multiclass-classification]

776 questions
1
vote
0 answers

I`m trying to generate predictions for test videos but I have this error (IndexError: arrays used as indices must be of integer (or boolean) type)

This is my code to generate predictions for test videos in the model and this is how it works First, we will create two empty lists – one to store the predictions and the other to store the actual tags Then, we will take each video from the test…
1
vote
1 answer

Keras model.predict is nearly always incorrect on training dataset; even when training it to near 100% accuracy

I am trying to do multiclass classification with keras for videogame characters. The problem is that even when the training accuracy/validation accuracy hits near 100% and 70% respectively; when I actually run model.predict() on an image that I…
1
vote
1 answer

How to extract performance metrics from confusion matrix for multiclass classification model with 5 classes in Python?

I built multiclass classification model (with 5 classes in target) in Python and I have confusion matrix like below: confusion_matrix(y_test, model.predict(X_test)) [[2006 114 80 312 257] [567 197 87 102 155] [256 84 316 39 380] [565 30 67…
1
vote
1 answer

How to avoid overfitting on multiclass classification OvR Xgboost model / class_weight in Python?

I try to build multiclass classification model in Python using XGBoost OvR (OneVsRest) like below: from xgboost import XGBClassifier from sklearn.multiclass import OneVsRestClassifier from sklearn.metrics import roc_auc_score X_train, X_test,…
1
vote
2 answers

Value error: too many values to pack - in a decision tree algorithm

I've copied the code that is used for data visualization in kaggle. I applied it with another dataset. When I was executing for confusion matrix, visualization etc. it shows value error: too many values to pack (expected 4). I've searched many…
1
vote
0 answers

Why does the output for this Sequential model constantly changes position everytime I run it back?

So, I'm making a rock paper scissors prediction using multiclass classification, but I have several problems with this code (1) The data sorting code import pandas import sklearn from sklearn import datasets import zipfile import os from…
1
vote
1 answer

Select only classes with best metric (f1 score) in a multiclass classification problem

I have a multiclass classification problem with almost 50 classes. After I ran the models some of the classes get ver good scores (.70 and higher) and others perform badly. What I want to do, is based on the metrics I obtain, keep only classes with…
1
vote
0 answers

Implementing a Basic Neural Network to Perform Classification with Neuroph

I'm very new to neural networks, and decided to try implementing a basic one using Neuroph in Java to perform multiclass classification using Multilayer Perceptron. public static void main(String[] args) { final MultiLayerPerceptron…
1
vote
1 answer

Tensorflow Macro F1 Score for multiclass and also for binary classification

I am trying to train 2 1D Conv neural networks - one for a multiclass classification problem and second for a binary classification problem. One of my metrics has to be Macro F1 score for both problems. However I am having a problem using…
1
vote
1 answer

how to initialize y_true and y_pred for confusion_matrix and classification_report

How to initialize y_true and y_pred for confusion_matrix and classification_report? I have used flow_from_dataframe. My code is as below: train_set = train_datagen.flow_from_dataframe( train, path, x_col="image_name", y_col="level", …
1
vote
1 answer

SVM to multiclass SVM

I have a code snippet for implementing SVM from scratch (binary classefier) These code wouldn't work on minist because output predictions 0 or 1 class SVM: def __init__(self, learning_rate=1e-3, lambda_param=1e-2, n_iters=1000): self.lr…
Not Bedo
  • 11
  • 2
1
vote
0 answers

Support for one vs all classification in pytorch

I have been clinging to a problem on multi class classification with a large number of classes (500) and a one vs rest classifier seems to be a good approach to handle it. Is there any support for the same in pytorch itself? All that I could find is…
1
vote
0 answers

WeightedRandomSampler with multi-dimensional batch

I'm working on a classification problem (100 classes) and my dataset has a huge class imbalance. To tackle this, I'm considering using torch's WeightedRandomSampler to oversample the minority class. I took help from this post which seemed pretty…
1
vote
0 answers

Multiclass classification using multiple columns as input

I am using linearsvc for prediction. I want to use two columns to predict the class of an item. I have written code by using only one column how to inlcude two columns for that. labels_T = df_T['Asso_Sub'] text_T=df_T['Title'] count_vect =…
1
vote
1 answer

How to predict label for new input values using artificial neural network in python

I am new in machine learning. I am making a Streamlit app for multiclass classification using artificial neural network. My question is about the ANN model, not about the Streamlit. I know I can use MLPClassifier, but I want to build and train my…