Predicting Probabilities for GBM with caret library

前端 未结 3 1834
谎友^
谎友^ 2020-12-10 17:44

A similar question was asked however the link in the answer points to random forest example, it doesn\'t seem to work in my case.

Here is an example what I\'m trying

3条回答
  •  悲&欢浪女
    2020-12-10 18:14

    As topepo explained above, the function is getting confused by the variable names being generated.

    If you run:

    make.names(levels(traintestClass_subset))
    

    and the result is different to how you have labelled the classes in your outcome variable than this issue will occur. Just make sure names generated by the piece of code above align with the class names you have provided to your factor and it should work.

提交回复
热议问题