Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /home/emma/.local/lib/python3.6/site-packages/sklearn/linear_model/logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.
- FutureWarning)
- ---------------------------------------------------------------------------
- ValueError Traceback (most recent call last)
- <ipython-input-13-3ea6c0d78a28> in <module>()
- 126 Now, we will apply a genetic algorithm to choose a subset of features that gives a better accuracy than the baseline.
- 127 '''
- --> 128 hof = getHof()
- 129 testAccuracyList, validationAccuracyList, individualList, percentileList = getMetrics(hof)
- 130
- <ipython-input-13-3ea6c0d78a28> in getHof()
- 87
- 88 # Launch genetic algorithm
- ---> 89 pop, log = algorithms.eaSimple(pop, toolbox, cxpb=0.5, mutpb=0.2, ngen=numGen, stats=stats, halloffame=hof, verbose=True)
- 90
- 91 # Return the hall of fame
- /home/emma/.local/lib/python3.6/site-packages/deap/algorithms.py in eaSimple(population, toolbox, cxpb, mutpb, ngen, stats, halloffame, verbose)
- 149 invalid_ind = [ind for ind in population if not ind.fitness.valid]
- 150 fitnesses = toolbox.map(toolbox.evaluate, invalid_ind)
- --> 151 for ind, fit in zip(invalid_ind, fitnesses):
- 152 ind.fitness.values = fit
- 153
- <ipython-input-13-3ea6c0d78a28> in getFitness(individual, X_train, X_test, y_train, y_test)
- 33 cols = [index for index in range(len(individual)) if individual[index] == 0]
- 34 X_trainParsed = X_train.drop(X_train.columns[cols], axis=1)
- ---> 35 X_trainOhFeatures = pd.get_dummies(X_trainParsed)
- 36 X_testParsed = X_test.drop(X_test.columns[cols], axis=1)
- 37 X_testOhFeatures = pd.get_dummies(X_testParsed)
- /home/emma/.local/lib/python3.6/site-packages/pandas/core/reshape/reshape.py in get_dummies(data, prefix, prefix_sep, dummy_na, columns, sparse, drop_first, dtype)
- 859 drop_first=drop_first, dtype=dtype)
- 860 with_dummies.append(dummy)
- --> 861 result = concat(with_dummies, axis=1)
- 862 else:
- 863 result = _get_dummies_1d(data, prefix, prefix_sep, dummy_na,
- /home/emma/.local/lib/python3.6/site-packages/pandas/core/reshape/concat.py in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, sort, copy)
- 226 keys=keys, levels=levels, names=names,
- 227 verify_integrity=verify_integrity,
- --> 228 copy=copy, sort=sort)
- 229 return op.get_result()
- 230
- /home/emma/.local/lib/python3.6/site-packages/pandas/core/reshape/concat.py in __init__(self, objs, axis, join, join_axes, keys, levels, names, ignore_index, verify_integrity, copy, sort)
- 260
- 261 if len(objs) == 0:
- --> 262 raise ValueError('No objects to concatenate')
- 263
- 264 if keys is None:
- ValueError: No objects to concatenate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement