f1_measure module¶
The F1 to measure the quality of a classification algorithm.
The F1 is defined by
where \(\\mathit{precision}\) is the number of correctly predicted positives divided by the total number of predicted positives and \(\\mathit{recall}\) is the number of correctly predicted positives divided by the total number of true positives.
- class gemseo.mlearning.quality_measures.f1_measure.F1Measure(algo, fit_transformers=True)[source]
Bases:
BaseMLErrorMeasure
The F1 measure for machine learning.
- Parameters:
algo (BaseMLClassificationAlgo) – A machine learning algorithm for classification.
fit_transformers (bool) –
Whether to re-fit the transformers when using resampling techniques. If
False
, use the transformers of the algorithm fitted from the whole learning dataset.By default it is set to True.
- SMALLER_IS_BETTER: ClassVar[bool] = False
Whether to minimize or maximize the measure.
- algo: BaseMLClassificationAlgo
The machine learning algorithm whose quality we want to measure.