gemseo / post

Show inherited members

kmeans module

A k-means classification of the optimization history.

class gemseo.post.kmeans.KMeans(opt_problem)[source]

Bases: OptPostProcessor

Performs a k-means clustering on optimization history.

The default number of clusters is 5 and can be modified in option.

The k-means construction depends on the MiniBatchKMeans class of the cluster module of the scikit-learn library .

Parameters:

opt_problem (OptimizationProblem) – The optimization problem to be post-processed.

Raises:

ValueError – If the JSON grammar file for the options of the post-processor does not exist.

database: Database

The database generated by the optimization problem.

materials_for_plotting: dict[Any, Any]

The materials to eventually rebuild the plot in another framework.

opt_problem: OptimizationProblem

The optimization problem.