- mne.simulation.metrics.f1_score(stc_true, stc_est, threshold='90%', per_sample=True)#
Compute the F1 score, also known as balanced F-score or F-measure.
The F1 score can be interpreted as a weighted average of the precision and recall, where an F1 score reaches its best value at 1 and worst score at 0. The relative contribution of precision and recall to the F1 score are equal. The formula for the F1 score is:
F1 = 2 * (precision * recall) / (precision + recall)
Threshold is used first for data binarization.
- stc_trueinstance of (Vol|Mixed)SourceEstimate
The source estimates containing correct values.
- stc_estinstance of (Vol|Mixed)SourceEstimate
The source estimates containing estimated values e.g. obtained with a source imaging method.
The threshold to apply to source estimates before computing the f1 score. If a string the threshold is a percentage and it should end with the percent character.
If True the metric is computed for each sample separately. If False, the metric is spatio-temporal.
New in version 1.2.