gemseo / mlearning / quality_measures

Show inherited members

f1_measure module

The F1 to measure the quality of a classification algorithm.

The F1 is defined by

\[F_1 = 2\frac{\mathit{precision}\mathit{recall}} {\mathit{precision}+\mathit{recall}}\]

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: MLErrorMeasure

The F1 measure for machine learning.

Parameters:
  • algo (MLClassificationAlgo) – 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: MLAlgo

The machine learning algorithm usually trained.

Examples using F1Measure

Advanced mixture of experts

Advanced mixture of experts