Skip to content
Generic filters
Exact matches only

Applying Darwinian Evolution to feature selection with Kydavra GeneticAlgorithmSelector | by Vasile Păpăluță | Aug, 2020

Vasile Păpăluță
pip install kydavra
from kydavra import GeneticAlgorithmSelectorselector = GeneticAlgorithmSelector()new_columns =, df, ‘target’)
import pandas as pddf = pd.read_csv(‘cleaned.csv’)
df = df.sample(frac=1).reset_index(drop=True)
from kydavra import GeneticAlgorithmSelectorfrom sklearn.metrics import precision_scorefrom sklearn.ensemble import RandomForestClassifierselector = GeneticAlgorithmSelector(scoring_metric=precision_score)model = RandomForestClassifier()
selected_cols =, df, 'target')
['age', 'sex', 'cp', 'fbs', 'restecg', 'exang', 'slope', 'thal']