Closed Rajmehta123 closed 3 years ago
Solved by changing the list of arrays to a data frame.
self.data = [x.reshape(1,-1) for x in self.data]
self.labels = [x.reshape(1,-1) for x in self.labels]
self.data = pd.DataFrame(np.concatenate(self.data))
self.labels = pd.DataFrame(np.concatenate(self.labels))
self.test_data = [x.reshape(1,-1) for x in self.test_data]
self.test_labels = [x.reshape(1,-1) for x in self.test_labels]
self.test_data = pd.DataFrame(np.concatenate(self.test_data))
self.test_labels = pd.DataFrame(np.concatenate(self.test_labels))
Amazing project. Thanks for the contribution.
The code fails during the execution of TrainXGBoost due to the outdated library. XGBoost no longer allows a list of NumPy arrays. It always has to have the input as a 2D array.
https://github.com/dmlc/xgboost/pull/3970
Answer to the XGBoost list input to DMatrix: @markli123 Hi, I actually found the cause of the weird behavior. See https://github.com/dmlc/xgboost/pull/3970 8. The list gets silently converted into scipy.sparse.csr_matrix, which causes unexpected behavior causing wrong prediction. This is why we later disallowed converting list into a DMatrix directly.