I am getting the below error when creating a DMatrix from a data in python.
TypeError: can not initialize DMatrix from DataFrame
Exception AttributeError: "'DMatrix' object has no attribute 'handle'" in <bound method DMatrix.__del__ ofrix object at 0x584d210>> ignored
Without accompanying code my best guess is you are passing the pandas data-frame directly, instead you need to pass numpy representation of the dataframe ie., pandas.DataFrame.values as below
X_train = pd.read_csv("train.csv")
y_train = X_train['label']
X_train.drop(['label'],axis=1,inplace=True)
final_GBM.fit(X_train.values,y_train.values)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With