Quantcast
Viewing all articles
Browse latest Browse all 4448

Xgb.importance() unable to plot sparse.model.matrix()!

@sunnysingha wrote:

Hi,
After successfully building XGBoost model on sparse.model.matrix(~.-1, data=train_set)
I get below error on the R console while attempting to plot feature importance matrix :

Error in readLines(filenamedump) : 'con' is not a connection_

Code:
names_ <- train_matrix@Dimnames[[2]]
xgb.importance(names_ , model=xg_mod)

If you had experienced this issue, how did you resolve it ? Is it because I had applied one hot encoding using 'sparse.model.matrix' ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles