slim_gsgp.algorithms.SLIM_GSGP

slim_gsgp.algorithms.SLIM_GSGP.slim_gsgp

SLIM_GSGP Class for Evolutionary Computation using PyTorch.

class slim_gsgp.algorithms.SLIM_GSGP.slim_gsgp.SLIM_GSGP(pi_init, initializer, selector, inflate_mutator, deflate_mutator, ms, crossover, find_elit_func, p_m=1, p_xo=0, p_inflate=0.3, p_deflate=0.7, pop_size=100, seed=0, operator='sum', copy_parent=True, two_trees=True, settings_dict=None)[source]

Bases: object

solve(X_train, X_test, y_train, y_test, curr_dataset, run_info, n_iter=20, elitism=True, log=0, verbose=0, test_elite=False, log_path=None, ffunction=None, max_depth=17, n_elites=1, reconstruct=True, n_jobs=1)[source]

Solve the optimization problem using SLIM_GSGP.

Parameters:
  • X_train (array-like) – Training input data.

  • X_test (array-like) – Testing input data.

  • y_train (array-like) – Training output data.

  • y_test (array-like) – Testing output data.

  • curr_dataset (str or int) – Identifier for the current dataset.

  • run_info (dict) – Information about the current run.

  • n_iter (int) – Number of iterations. Default is 20.

  • elitism (bool) – Whether elitism is used during evolution. Default is True.

  • log (int or str) – Logging level (e.g., 0 for no logging, 1 for basic, etc.). Default is 0.

  • verbose (int) – Verbosity level for logging outputs. Default is 0.

  • test_elite (bool) – Whether elite individuals should be tested. Default is False.

  • log_path (str) – File path for saving log outputs. Default is None.

  • ffunction (function) – Fitness function used to evaluate individuals. Default is None.

  • max_depth (int) – Maximum depth for the trees. Default is 17.

  • n_elites (int) – Number of elite individuals to retain during selection. Default is True.

  • reconstruct (bool) – Indicates if reconstruction of the solution is needed. Default is True.

  • n_jobs (int) – Maximum number of concurrently running jobs for joblib parallelization. Default is 1.