I am implementing random forest classifier in python and is stuck in training my model.
ValueError Traceback (most recent call last)
<ipython-input-20-740c890799b1> in <module>()
19 )
20 print("herer")
---> 21 modelRF.fit(X = featureNames, y = dependentVar)#, sample_weight=None) #training_frame = train, validation_frame = valid)
22
23 # Variable Importance
/usr/local/lib/python3.6/dist-packages/h2o4gpu/solvers/xgboost.py in fit(self, X, y, sample_weight)
315
316 def fit(self, X, y=None, sample_weight=None):
--> 317 res = self.model.fit(X, y, sample_weight)
318 self.set_attributes()
319 return res
/usr/local/lib/python3.6/dist-packages/xgboost/sklearn.py in fit(self, X, y, sample_weight, eval_set, eval_metric, early_stopping_rounds, early_stopping_threshold, early_stopping_limit, verbose, xgb_model, sample_weight_eval_set)
516 xgb_options.update({"eval_metric": eval_metric})
517
--> 518 self._le = XGBLabelEncoder().fit(y)
519 training_labels = self._le.transform(y)
520
/usr/local/lib/python3.6/dist-packages/sklearn/preprocessing/label.py in fit(self, y)
93 self : returns an instance of self.
94 """
---> 95 y = column_or_1d(y, warn=True)
96 self.classes_ = np.unique(y)
97 return self
/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py in column_or_1d(y, warn)
612 return np.ravel(y)
613
--> 614 raise ValueError("bad input shape {0}".format(shape))
615
616
ValueError: bad input shape ()