You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a lightgbm model trained with pandas dataframes some columns of it have the type "category" (and are underlying strings)
All of the steps for loading and compiling this model work well. But when I try to make a prediction, I always get an error:
Either, I pass the dataframe, and I get the error: TypeError: Cannot initialize DMatrix from DataFrame
Either, I pass the associated ndarray and I get the error: ValueError: Unrecognized NumPy type: object
The code is a copy paste of the quick start example, and the error is on the line : dmat = treelite_runtime.DMatrix(X.values)
The data is load with :
X = pd.read_csv("french_motors_test.csv")
for column, typ in X.dtypes.iteritems():
if not is_numeric_dtype(typ):
X[column] = X[column].astype('category')
Data is coming from open data, so I could share the data and the model (but where?).
The text was updated successfully, but these errors were encountered:
I have a lightgbm model trained with pandas dataframes some columns of it have the type "category" (and are underlying strings)
All of the steps for loading and compiling this model work well. But when I try to make a prediction, I always get an error:
The code is a copy paste of the quick start example, and the error is on the line :
dmat = treelite_runtime.DMatrix(X.values)
The data is load with :
Data is coming from open data, so I could share the data and the model (but where?).
The text was updated successfully, but these errors were encountered: