by: Kevin Broløs & Chris Cave
(Feyn version 2.1.0 or newer)
The number of potential models that can explain a dataset can vary. The function
get_diverse_models finds the best performing
Models from a list that have evolved independently in the QLattice.
This allows you to filter down the list of possible models to choose from, and only look at the ones that are most likely to be structurally or behaviourally different.
import feyn from feyn.datasets import make_classification train, test = make_classification() ql = feyn.connect_qlattice() models = ql.sample_models(train.columns, 'y', 'classification', max_complexity=10) models = feyn.fit_models(models, train, 'binary_cross_entropy', 'bic', 4) models = feyn.prune_models(models, True, True) models = feyn.get_diverse_models( models=models, n=10 )
The list of models to find the diverse models from. The function expects the list to be sorted by some metric, such as the loss.
The maximum amount of models to return from the list.