Further Details
Analysing the Best individuals
{"features": 21, "phenotype": "~x['safety_med'],x['buying_high'],~x['safety_low'],~x['doors_2'],x['lug_boot_big'],~x['persons_2'],~x['persons_4'],x['maint_low'],~x['buying_med'],x['lug_boot_small'],x['doors_2'],x['buying_high'],x['maint_high'],(~x['safety_high']&x['lug_boot_small']),~x['maint_high'],~x['maint_low'],~x['buying_vhigh'],x['lug_boot_small'],(x['maint_vhigh']&~x['maint_high']),x['safety_med'],~x['persons_more']&(x['persons_4']&x['doors_3'])"}from fedora.core.utilities.lib import get_features
individual = Fedora.get_best("car-evaluation-results/", 42)
features = get_features(individual["phenotype"])
print(features)["~x['safety_med']", "x['buying_high']", "~x['safety_low']", "~x['doors_2']", "x['lug_boot_big']", "~x['persons_2']", "~x['persons_4']", "x['maint_low']", "~x['buying_med']", "x['lug_boot_small']", "x['doors_2']", "x['buying_high']", "x['maint_high']", "(~x['safety_high']&x['lug_boot_small'])", "~x['maint_high']", "~x['maint_low']", "~x['buying_vhigh']", "x['lug_boot_small']", "(x['maint_vhigh']&~x['maint_high'])", "x['safety_med']", "~x['persons_more']&(x['persons_4']&x['doors_3'])"]Building a Custom Operator
from fedora.sge.utilities.protected_math import Infix
def MyOpt(series: pd.Series):
return series.apply(lambda x: x.count("i"))
def concatLen(s1: pd.Series, s2: pd.Series):
return pd.Series(s1 + s2).apply(lambda x: x[::-1])
_MyOpt_ = Infix(MyOpt)
_cclen_ = Infix(concatLen)Ephemeral Constants
Tailored Setups
Structured Grammatical Evolution
Last updated