New answers tagged

0

Majorly 3 types of machine learning model are present clustering, classification and regression. Each of them have different way of calculating accuracy. In case of regression following are the metrics available in scikit learn package. For more metrics check this LINK mean_absolute_error mean_squared_error mean_squared_log_error median_absolute_error ...


1

Good question. Using a threshold is perfectly fine and is not "manual overfitting". It is not manual because this is a step that can (and should) be done automatically. It is not overfitting as it doesn't modify the model itself. It modifies how you interpret the model's output. What the user did is actual called cost-sensitive learning. It is a technique ...


0

You're just overfitting here. That's a fairly complex network for the simple MNIST data set. It's fairly easy to separate the MNIST classes, so even though your overfit network is starting to do worse on the validation set - it's getting less certain about the correct answers, believing the wrong ones more - the most-probable class is still almost always ...


0

Usually this is due to a learning rate that is too high, it passes over the Loss function minimum and starts overshooting. Of course I can't be sure that's the reason but this is my best guess. Try to simplify your optimizer, use Adam() optimizer alone (without moving average) and set a fairly small learning rate, something like 0.001 or even 0.0001. Let's ...


0

# train pred = model.fit(X_train, y_train) Here you are juts fitting the model, not making any predictions. accuracy_score(X_test,pred) Here you are supposed to pass y_test, and y_predict, since its the output you are comparing not the input data. Try this- pred = model.predict(X_test) accuracy_score(X_test,pred)


0

It's an imbalanced classes problem, however, it's not a very imbalanced dataset. It's common question/task in interviews. You may get high accuracy because minor class has less weight in the model. This topic has been discussed several time here and here.


0

The most probably is data leakage, in this situation, you have the same values in train and test data(or linearly dependent). So please check out the input values.


0

Machine Learning is one of the few things where 99% is excellent and 100% is terrible. Well, I cannot prove this because I don't have your data, but probably: the test data is included in the training data. To check this possibility, here's a hint: print(X_test[X_test.isin(X_train)]) will print all the rows in X_test that appear in X_train. Can you ...


1

With Softmax as activation in final layer, you should have n neurons, where n is the number of classes. Here is an explanation: https://developers.google.com/machine-learning/crash-course/multi-class-neural-networks/softmax So basically: model.add(Dense(n_classes, activation='softmax')) If you are using one hot encoding: model.add(Dense(y_train[1], ...


2

One major difference is that the F1-score does not care at all about how many negative examples you classified or how many negative examples are in the dataset at all; instead, the balanced accuracy metric gives half its weight to how many positives you labeled correctly and how many negatives you labeled correctly. When working on problems with heavily ...


0

Your problem isn't just a low recall value, your problem is your model needs improving. A high accuracy with a highly unbalanced dataset means practically nothing since simply predicting the most common label will get you a very high accuracy. With imbalanced classes, it’s easy to get a high accuracy without actually making useful predictions. So, ...


2

Based on your screenshot, it's quite clear that the accuracy isn't 0.0 since the first two predictions match the true labels. So something must be wrong with how the accuracy is calculated. If you go to sklearn's documentation, you'll see that accuracy_score requires 1-d arrays while it seems that you are feeding it 2-d arrays. My guess is that right now, ...


0

If you are training classifiers, you can check: plain accuracy percentage, F1 score and other metrics (sensitivity, specificity, etc.), you can visualise true vs predicted values with confusion matrices. There's plenty of options. Please remember that the quality of a model can be assessed only on test data, i.e. data that you model didn't see in training ...


Top 50 recent answers are included