F1 score support for objective
See original GitHub issueToday objective = “val_f1” returns an error
Failed to train : <class ‘ValueError’> : Could not infer optimization direction (“min” or “max”) for unknown metric “val_f1”. Please specify the objective asa kerastuner.Objective
, for example kerastuner.Objective("val_f1", direction="min")
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:20 (9 by maintainers)
Top Results From Across the Web
A Look at Precision, Recall, and F1-Score | by Teemu Kanstrén
F1-score equals precision and recall if the two input metrics (P&R) are equal. The Difference column in the table shows the difference between...
Read more >Accuracy, Precision, Recall & F1 Score - Exsilio Blog
F1 score - F1 Score is the weighted average of Precision and Recall. Therefore, this score takes both false positives and false negatives...
Read more >What Is a Good F1 Score? — Inside GetYourGuide
F1 := 2 / (1/precision + 1/recall ). It reaches its optimum 1 only if precision and recall are both at 100%. And...
Read more >Accuracy, Precision, Recall & F1-Score - Python Examples
Model F1 score represents the model score as a function of precision and recall score. F-score is a machine learning model performance metric ......
Read more >What is the F1-score? - Educative.io
The F1-score combines the precision and recall of a classifier into a single metric by taking their harmonic mean. It is primarily used...
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 FreeTop 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
Top GitHub Comments
Had this same issue while running latest version of autokeras in Colab environment. While using this f1 custom objective, the object’s .fit() worked OK, but failed to .predict() or .export_model() after training. Keras was demanding the custom objects, and they weren’t being passed on.
Fixed it by changing the StructuredDataClassifierTuner function like this, I leave it here for reference of whomever might find this useful:
Here f1_score_custom is a custom function, ak is autokeras, and autok is an StructuredDataClassifier instance.
I am working on it. It seems it is a bug that it always use val_loss as objective.