Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [f1score]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

output F1-score instead of Accuracy

I have the code below outputting the accuracy. How can I output the F1-score instead? ...
user avatar
0 votes
1 answer
24 views

Scikit learn ComplementNB is outputting NaN for scores

I have an unbalanced binary dataset with 23 features, 92000 rows are labeled 0, and 207,000 rows are labeled 1. I trained models on this dataset such as GaussianNB, DecisionTreeClassifier, and a few ...
user avatar
-1 votes
1 answer
26 views

Difference between the different measurement metric [closed]

Can someone explain what each of these mean? both in simple terms and in terms of TP, TN, FP, FN? Also are there any other common metrics that I am missing? F-measure or F-score Recall Precision ...
user avatar
1 vote
1 answer
26 views

Is it correct to train and validate the model on F1-score metrics?

I am trying to do experiments on multiple data sets. Some are more imbalanced than others. Now, in order to assure fair reporting, we compute F1-Score on test data. In most machine learning models, we ...
user avatar
  • 140
0 votes
0 answers
30 views

Overfitting? Is it ok, if I've met my desired threshold?

I've trained a lightgbm classification model, selected features, and tuned the hyperparameters all to obtain a model that appears to work well. When I've come to evaluate it on an out of bag selection ...
user avatar
3 votes
1 answer
478 views

How F1 score is good with unbalanced dataset

I have read around on this site that it's recommended to use F1 score if the dataset is imbalanced and if you want to seek a balance between recall and precession. Could you please explain how F1 can ...
user avatar
  • 179
0 votes
1 answer
3k views

NameError: name 'model' is not defined Keras with f1_score

I'm having a problem with my Keras model, in the .compile() I use accuracy, loss, precision, recall and AUC, but also I need f1_score, due to Keras doesn´t include f1_score, I tried to calculate by ...
user avatar
  • 13
0 votes
0 answers
7 views

Why does the summaryFunction data only returns 10 rows with custom metric (caret trControl)

I was trying to generate my own F1 metric, however I am wondering why I only get 10 rows for my prediction in the data parameter. Can somebody please clarify were it doesn't return me all predictions ...
user avatar
0 votes
1 answer
419 views

problem with using f1 score with a multi class and imbalanced dataset - (lstm , keras)

I'm trying to use f1 score because my dataset is imbalanced. I already tried this code but the problem is that val_f1_score is always equal to 1. I don't know if I did it correctly or not. my X_train ...
user avatar
1 vote
1 answer
75 views

Perfect scores for multiclass classification

I am working on a multiclass classification problem with 3 (1, 2, 3) classes being perfectly distributed. (70 instances of each class resulting in (210, 8) dataframe). Now my data has all the 3 ...
user avatar
  • 1,241
0 votes
2 answers
108 views

Question answering bot: EM>F1, does it make sense?

I am fine-tuning a Question Answering bot starting from a pre-trained model from HuggingFace repo. The dataset I am using for the fine-tuning has a lot of empty answers. So, after the fine tuning, ...
user avatar
1 vote
1 answer
54 views

How to measure multi-label multi-class accuracy

I have a model that has multi-label multi-class targets Example Age Height Weight Mark Distance Red Yellow Green Blue Black White 14 160 62 78 103 0 1 1 1 1 0 56 177 90 99 363 1 1 0 0 0 0 32 179 ...
user avatar
  • 497
0 votes
0 answers
15 views

How can I Determine a Treshold According to the Precision and Recall?

I am gettin these precision and recall values from my classifier and I want to determine a treshold for the test data. How can I determine that treshold? Is these values enough or something else is ...
user avatar
1 vote
1 answer
24 views

How to improve my f1 score in stories analyze

I got an assignment to build a model that identify the gender of the text writer. The assignment score will determine by my model f1_score, to get the maximum points, T need it will be at least 0.7. I'...
user avatar
2 votes
1 answer
49 views

Making an ensemble model for high F1 score

I presently have 2 algorithms that have a numerical output. Using a threshold of 0.9, I get the classification output. Let's say they are: P (high precision, low recall) R (high recall, low precision)...
user avatar
0 votes
1 answer
94 views

Accuracy on Validation and Test set, Overfit?

Just a quick question, I am building a ML model right now however I am receiving very similar (72.2 and 72.4 for example)% for both Accuracy and F1-Score on my Validation Dataset and my unseen Test ...
user avatar
1 vote
1 answer
164 views

How to explain a relationship between Accuracy and F1 Score / F-Measure?

I am building a CNN model for pitch estimation using a song recording. Pitch estimation is done by inputting spectrogram to CNN model and make the CNN predict pitch sequence (250 pitch values per ...
user avatar
1 vote
1 answer
135 views

How to compute f1_score for multiclass multilabel classification

I have used one hot encoder [1,0,0][0,1,0][0,0,1] for my functional classification model. The predicted probabilities for test data ...
user avatar
  • 121
0 votes
2 answers
402 views

Warning when plotting confusion matrix with all sample of one class

I have two arrays: the first one with all the correct labels (they are all set to zero since each sample belong to the same class) and another one with all the labels predicted by my neural network. ...
user avatar
  • 43
0 votes
1 answer
45 views

Which F1-score is used for the semantic segmentation tasks?

I read some papers about state-of-the-art semantic segmentation models and in all of them, authors use for comparison F1-score metric, but they did not write whether they use the "micro" or &...
user avatar
2 votes
1 answer
887 views

scikit-learn classification report's f1 accuracy?

When I run scikit-learn classification_report() on my 2-class y and yhat, I get the ...
user avatar
1 vote
1 answer
315 views

What is the appropriate statistical significance test for multi-class classification?

I have a multi-class classification problem. I am primarily using macro-average F1 measure to evaluate the performance of models and want to verify if the results are statistically significant. I have ...
user avatar
1 vote
3 answers
437 views

Too high performances on a classification problem

I have a .json file as dataset of the type: and I am working on a classification problem in which I have to predict 4 classes, which are rhe semantic. I have worked through the problem, and after ...
user avatar
  • 721
6 votes
4 answers
282 views

Is an $F_1$ score of 0.1 always bad?

I'm currently building a model to predict early mortgage delinquency (60+ days delinquent within 2 years of origination) for loans originating in 2018Q1. I will eventually train out-of-time (on loans ...
user avatar
  • 213
-1 votes
1 answer
56 views

Model to choose with Cross Validation or not?

I made different tests on an imbalanced dataset and got these results: Model 1 = train test validation split + Cross Validation(cv=10) --> f1'micro' 0,95 Model 2 = train test split + smote method ...
user avatar
  • 329
1 vote
1 answer
123 views

how print f1-score with scikit´s accuracy_score or accuracy of confusion_matrix?

I would like to print the f1-score. I got confused about the wording f1-accuracy score and accuracy score. What is the difference of these 2 scikit-learn metrics and how can I print the f1-score out ...
user avatar
  • 329
1 vote
1 answer
768 views

Multiclass Classification and log_loss

I hope I can make this clear with few lines of code/explanation. I've a 16K list of texts, labelled over 30 different classes that were ran through different classifiers; my Prediction and the Ground ...
user avatar
5 votes
3 answers
1k views

Accuracy is lower than f1-score for imbalanced data

For a binary classification, I have a dataset with 55% negative label and 45% positive labels. The results of the classifier shows that the accuracy is lower than the f1-score. Does that mean that the ...
user avatar
0 votes
1 answer
173 views

Selecting threshold for F1 Score

When selecting a probability threshold to maximize the F1 score prior to deploying a model (based on the precision-recall curve), should the threshold be selected based on the training or holdout ...
user avatar
0 votes
1 answer
34 views

How to calculate the evaluation metrics (i.e., F1 score) in leave one subject out cv when a subject belongs to single class only

I have dataset of 10 subjects. the dataset has 4 classess. 0,1,2 and 3. The distribution of classes are not same. For example subject 1 does not have 1,2 and 3. It belongs to zeros class. currently ...
user avatar
  • 1
1 vote
1 answer
28 views

Is it conscientious to use a threshold for a model output in order to play on the recall and precision?

I have just finished reading an article about the F1 score, recall and precision. Everything was clear except the fact that the author, in his example (see https://towardsdatascience.com/beyond-...
user avatar
  • 13
3 votes
1 answer
43 views

F1 score graph skewed

The following code ...
user avatar
  • 575
9 votes
1 answer
4k views

Balanced Accuracy vs. F1 Score

I've read plenty of online posts with clear explanations about the difference between accuracy and F1 score in a binary classification context. However, when I came across the concept of balanced ...
user avatar
  • 227
1 vote
0 answers
700 views

How can I calculate the F1 score using Mask RCNN?

I customized the "https://github.com/matterport/Mask_RCNN.git" repository to train with my own data set, for object detection, ignoring the mask segmentation part. Now I am evaluating my results, I ...
user avatar
0 votes
1 answer
356 views

Confusion matrix of UNET image sgemenation model

I have used Unet model for image segmentation. I have used RGB images and corresponding image masks and at output i got corresponding region of interest. Now i want to find confusion matrix of this ...
user avatar
1 vote
0 answers
606 views

Calculating the F score of Object Detection of Mask RCNN

I am using Detectron2 Mask RCNN for an object detection problem. The images consist of cells that are very close to each other. I can not use mAP as a performance measure since the annotations are a ...
user avatar
12 votes
4 answers
9k views

Can the F1 score be equal to zero?

As it is mentioned in the F1 score Wikipedia, 'F1 score reaches its best value at 1 (perfect precision and recall) and worst at 0'. What is the worst condition that was mentioned? Even if we ...
user avatar
-1 votes
1 answer
79 views

What is evaluation metric for two sets? [closed]

I've two sets one is ground truth and other is output of my machine learning models. Assume my groundtruth set is A={1,2,3,4,5} and output of machine learning model is B={3,4,5,6,7,8}. One way I can ...
user avatar
1 vote
0 answers
20 views

Monotonicity of Jaccard and Dice in multilabel datasets

I understand that Jaccard and Dice follow a monotonic relation on binary datasets because the two are related as $J = {S \over {(2 - S)}}$, and I guess this would be the case when micro-average is ...
user avatar
  • 11
0 votes
1 answer
167 views

Different definitions of Macro F1 score, which one is used in Scikit-learn?

In this article Macro F1 and Macro F1 two different definitions of the F1 used in the literature are demonstrated. The first F1 score is computed such as: F1 scores are computed for each class ...
user avatar
3 votes
1 answer
57 views

Multiclass imbalanced classification

I have a dataset with the target variable having 3 classes. Value counts of Target variable are as follows: ...
user avatar
1 vote
1 answer
1k views

Macro F1 result higher than accuracy for imbalanced dataset

In one of the research papers on fake news detection, the authors collected a fake news binary dataset (fake vs. real news) consists of 16,817 real articles and <...
user avatar
  • 240
2 votes
1 answer
993 views

How to correctly calculate average F1 score, precision and recall of a Named Entity Recognition system?

My Named Entity Recognition (NER) pipeline built with Apache uimaFIT and DKPro recognizes named entities (called datatypes for now) in texts (e.g. persons, locations, organizations and many more). I ...
user avatar
4 votes
1 answer
101 views

Visualizing F-score differences in information extraction

I have several corpora and NLP systems (including a few merge ensembles of output of these systems combined in unions and intersections) with which I have extracted the annotation span sets {(begin, ...
user avatar
3 votes
2 answers
2k views

Is it possible to make F1_Score differentiable and use it directly as a Loss function?

One of the metrics that is widely used in binary classification is the F1 score: $F_1 = 2\cdot \frac{recall \cdot precision}{recall+precision}$ The problem of the F1-score is that it is not ...
user avatar
5 votes
4 answers
17k views

How to compute f1 in TensorFlow

I have a code that computes the accuracy, but now I would like to compute the F1 score. ...
user avatar