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
Seems like I introduced this in #5184. I don't remember why I changed the condition from length(private$colnames) to ncol(private$raw_data). I'll investigate further.
I experienced the same issue, but it seems like it does not throw the error (i.e. it seems to work) when you specify the 'categorical_feature' vector to be a vector of strings, the names of your features.
i.e. cat_features = c("a","b","c").
I had no issues when I included this both in the train creating using lgb.Dataset() AND in lgb.cv(categorical_feature=cat_features).
Description
Executing a cross-validation with
lgb.cv()
fails when the data contains categorical features.Reproducible example
I'm using the example in the code demo categorical_features_rules:
In that example, a
lgb.Booster
is trained withmodel <- lgb.train( params = params , data = dtrain , nrounds = 100L , valids = list(train = dtrain, valid = dtest) )
after the training and test data had been previously created as
Works perfectly so far. Now, if I want to cross-validate using the training data set, by doing
I'm getting an error
Specifying the
categorical_feature
argument again inlgb.cv()
does not help.The error seems to be related to categorical features. When I'm, running a similar analysis without them,
lgb.cv()
works fine:Environment info
The text was updated successfully, but these errors were encountered: