gemseo / mlearning / classification

classification module

Classification model

The classification module implements classification algorithms, whose goal is to find relationships between input data and output classes.

Classification algorithms provide methods for predicting classes of new input data, as well as predicting the probabilities of belonging to each of the classes wherever possible.

This concept is implemented through the MLClassificationAlgo class which inherits from the MLSupervisedAlgo class.

class gemseo.mlearning.classification.classification.MLClassificationAlgo(data, transformer=None, input_names=None, output_names=None, **parameters)[source]

Bases: gemseo.mlearning.core.supervised.MLSupervisedAlgo

Classification Algorithm.

Inheriting classes should implement the MLSupervisedAlgo._fit() and MLClassificationAlgo._predict() methods, and MLClassificationAlgo._predict_proba_soft() method if possible.


  • data (Dataset) – learning dataset.

  • transformer (dict(str)) – transformation strategy for data groups. If None, do not scale data. Default: None.

  • input_names (list(str)) – names of the input variables.

  • output_names (list(str)) – names of the output variables.

  • parameters – algorithm parameters.


Train machine learning algorithm on learning set, possibly filtered using the given parameters. Determine the number of classes. :param list(int) samples: indices of training samples.

predict_proba(input_data, *args, **kwargs)