Skip to content

Instantly share code, notes, and snippets.

@DMTSource
DMTSource / hypervol_man_dim_test.py
Last active November 26, 2020 05:11
Deap Hypervolume comparison for varying population size and number of objectives, testing for use with high dimensional NSGA III with many objectives (over 8).) Discussion here: https://groups.google.com/g/deap-users/c/XLfLa3at6pw
# Derek Tishler
# Deap Hypervolume comparison for varying population size and number of objectives,
# testing for use with high dimensional NSGA III with many objectives (over 8).)
# Discussion here, also required fitness_values.txt with 212x14 array of fitness values per ind in pop:
# https://groups.google.com/g/deap-users/c/XLfLa3at6pw
import numpy as np
@DMTSource
DMTSource / normalized_individual_deap_example.py
Created December 12, 2020 02:16
Example of a Deap GA problem, working with normalized individuals only
# Based on https://raw.githubusercontent.com/DEAP/deap/master/examples/ga/onemax_mp.py
# Using onemax(ignore the problem sorta) to show how to work with only normalized individuals
# Can Uses numpy individuals but no multiproc: https://deap.readthedocs.io/en/master/examples/ga_onemax_numpy.html
# Derek M Tishler, Dec 2020
import multiprocessing
import random
import sys
@DMTSource
DMTSource / deap_heuristic_random_hybrid_init.py
Created January 16, 2021 21:11
Deap python example showing how population lists can be combined for use with hybrid initialization methods such as heuristic + random.
import array
import random
import numpy
from deap import algorithms
from deap import base
from deap import creator
from deap import tools
@DMTSource
DMTSource / baikal_readme_long_gridsearchcv_example.py
Last active March 24, 2021 21:33
Modified version of the readme_long_example from baikal. Attempting to make it work for multiple inputs: https://github.com/alegonz/baikal/issues/50
import sklearn.decomposition
import sklearn.ensemble
import sklearn.linear_model
import sklearn.preprocessing
import sklearn.svm
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from baikal import Input, Model, make_step
from baikal.plot import plot_model
@DMTSource
DMTSource / deap_node_plot.py
Last active June 1, 2021 15:44
Deap Pretty Node Plot Example Code Example (Need to bring your own deap Individuals in)
# Derek M. Tishler
# nx plot example deap individual
# For post: https://groups.google.com/g/deap-users/c/nZFZpm5OPZA
import matplotlib.pyplot as plt
import networkx as nx
from networkx.drawing.nx_agraph import graphviz_layout
## May need is resuming session
#from deap import creator