eqdisco.models.SymbolicClassifier#
- class eqdisco.models.SymbolicClassifier(population_size=300, generations=30, functions=('add', 'sub', 'mul', 'div', 'sin', 'cos', 'exp', 'log', 'sqrt', 'square'), decision='logistic', loss=None, class_weight=None, optimize='none', optimize_fraction=0.1, optimize_iterations=20, selection='tournament', tournament_size=5, parsimony=0.0, complexity='size', init_depth=(2, 5), max_depth=10, max_size=50, p_crossover=0.7, crossover='subtree', p_subtree_mutation=0.4, p_point_mutation=0.25, p_hoist_mutation=0.1, p_constant_mutation=0.15, p_shrink_mutation=0.05, p_insert_mutation=0.05, p_constant=0.2, const_range=(-5.0, 5.0), n_islands=1, migration_interval=10, migration_size=2, elitism=1, constraints=None, units=None, constraint_weight=10.0, seed_equations=None, library=None, p_library=0.05, library_learning=False, library_interval=5, llm_proposer=None, llm_interval=5, llm_n_proposals=5, validation_fraction=0.0, model_selection='best', patience=None, time_limit=None, max_evaluations=None, feature_names=None, random_state=None, verbose=0)[source]#
Bases:
_TreeGP,ClassifierMixinGenetic programming for classification by a symbolic decision function.
Binary problems evolve one expression \(f\); multi-class problems are solved one-versus-rest. With
decision="logistic"the probability of the positive class is \(\sigma(a+bf)\) with \(a, b\) fitted by logistic regression for every candidate, and the loss is the cross-entropy. Withdecision="sign"the classifier is the critical equation \(f(\mathbf{x})>0\) and the loss is the balanced error, as in the GP-based identification of reactor runaway criteria of Kummer, Varga and Abonyi (2019).The parameters are those of
SymbolicRegressor;lossis"log_loss"or"balanced_error"(defaults followdecision),class_weight="balanced"reweights the classes, andoptimize="lbfgs"tunes the parameters of the best offspring by L-BFGS on the cross-entropy (logistic decision).- Attributes: