epl-prediction-2017 icon indicating copy to clipboard operation
epl-prediction-2017 copied to clipboard

ValueError: setting an array element with a sequence.

Open rentaro619 opened this issue 7 years ago • 5 comments

Hi there, love the work you did on this project, was able to follow your guide to the core but i am getting errors in predicting the results for knn and XGB.

This is what i get:

ValueErrorTraceback (most recent call last) in () ----> 1 y_pred_XGB = clf_XGB.predict(X_predict) 2 y_pred_knn = clf_knn.predict(X_predict)

/usr/local/lib/python2.7/dist-packages/xgboost/sklearn.pyc in predict(self, data, output_margin, ntree_limit) 460 461 def predict(self, data, output_margin=False, ntree_limit=0): --> 462 test_dmatrix = DMatrix(data, missing=self.missing) 463 class_probs = self.booster().predict(test_dmatrix, 464 output_margin=output_margin,

/usr/local/lib/python2.7/dist-packages/xgboost/core.pyc in init(self, data, label, missing, weight, silent, feature_names, feature_types) 253 data, feature_names, feature_types = _maybe_pandas_data(data, 254 feature_names, --> 255 feature_types) 256 label = _maybe_pandas_label(label) 257

/usr/local/lib/python2.7/dist-packages/xgboost/core.pyc in _maybe_pandas_data(data, feature_names, feature_types) 179 msg = """DataFrame.dtypes for data must be int, float or bool. 180 Did not expect the data types in fields """ --> 181 raise ValueError(msg + ', '.join(bad_fields)) 182 183 if feature_names is None:

ValueError: DataFrame.dtypes for data must be int, float or bool. Did not expect the data types in fields HAS, HDS, AAS, ADS

i have tried to convert the data frame to .astype(np.float64) but it is still not working please help.

Thanks.

rentaro619 avatar Oct 24 '17 15:10 rentaro619