SHARE
TWEET

output error

a guest Sep 15th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /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.
  2.   FutureWarning)
  3. ---------------------------------------------------------------------------
  4. ValueError                                Traceback (most recent call last)
  5. <ipython-input-13-3ea6c0d78a28> in <module>()
  6.     126         Now, we will apply a genetic algorithm to choose a subset of features that gives a better accuracy than the baseline.
  7.     127     '''
  8. --> 128         hof = getHof()
  9.    129         testAccuracyList, validationAccuracyList, individualList, percentileList = getMetrics(hof)
  10.    130
  11.  
  12. <ipython-input-13-3ea6c0d78a28> in getHof()
  13.     87
  14.     88         # Launch genetic algorithm
  15. ---> 89         pop, log = algorithms.eaSimple(pop, toolbox, cxpb=0.5, mutpb=0.2, ngen=numGen, stats=stats, halloffame=hof, verbose=True)
  16.     90
  17.     91         # Return the hall of fame
  18.  
  19. /home/emma/.local/lib/python3.6/site-packages/deap/algorithms.py in eaSimple(population, toolbox, cxpb, mutpb, ngen, stats, halloffame, verbose)
  20.    149     invalid_ind = [ind for ind in population if not ind.fitness.valid]
  21.    150     fitnesses = toolbox.map(toolbox.evaluate, invalid_ind)
  22. --> 151     for ind, fit in zip(invalid_ind, fitnesses):
  23.    152         ind.fitness.values = fit
  24.    153
  25.  
  26. <ipython-input-13-3ea6c0d78a28> in getFitness(individual, X_train, X_test, y_train, y_test)
  27.     33         cols = [index for index in range(len(individual)) if individual[index] == 0]
  28.     34         X_trainParsed = X_train.drop(X_train.columns[cols], axis=1)
  29. ---> 35         X_trainOhFeatures = pd.get_dummies(X_trainParsed)
  30.     36         X_testParsed = X_test.drop(X_test.columns[cols], axis=1)
  31.     37         X_testOhFeatures = pd.get_dummies(X_testParsed)
  32.  
  33. /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)
  34.    859                                     drop_first=drop_first, dtype=dtype)
  35.    860             with_dummies.append(dummy)
  36. --> 861         result = concat(with_dummies, axis=1)
  37.    862     else:
  38.    863         result = _get_dummies_1d(data, prefix, prefix_sep, dummy_na,
  39.  
  40. /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)
  41.    226                        keys=keys, levels=levels, names=names,
  42.    227                        verify_integrity=verify_integrity,
  43. --> 228                        copy=copy, sort=sort)
  44.    229     return op.get_result()
  45.    230
  46.  
  47. /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)
  48.    260
  49.    261         if len(objs) == 0:
  50. --> 262             raise ValueError('No objects to concatenate')
  51.    263
  52.    264         if keys is None:
  53.  
  54. ValueError: No objects to concatenate
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top