Cross validation in R with the caret library

Sdílet
Vložit
  • čas přidán 27. 09. 2020
  • Download the code at:
    github.com/mariocastro73/ML20...

Komentáře • 13

  • @MilindaArambawela
    @MilindaArambawela Před 2 lety

    How can I use loocv for the Stacking Algorithms using R? Need to save prediction and I use caretList with 'rpart', 'knn', 'nb'

  • @barbaraellensf2128
    @barbaraellensf2128 Před 3 lety +1

    Also, Do you know if it is possible to change de parameter "distance" of knn while I'm still using the function train() to build the model as you did? I would like to test different distances in the algorithm like for example, euclidian, manhattan..

    • @MarioCastroPonce
      @MarioCastroPonce  Před 3 lety

      I don't know either, but it's a good point. Manhattan distance is sometimes the best choice.

  • @md.akibal-zubayer2104
    @md.akibal-zubayer2104 Před 2 lety

    This video is really helpful. Can you help me a little bit more ?. I am trying different method at the same time. How can I use repeated cv for random forest, svm and neural network here ?

  • @casualcomputer6544
    @casualcomputer6544 Před 3 lety +1

    How do we get the caret snippet ?

    • @MarioCastroPonce
      @MarioCastroPonce  Před 3 lety +1

      Download it here: github.com/mariocastro73/ML2020-2021/blob/master/scripts/caret.snippet and plug it into the section for snippets in Rstudio

    • @arungandhi5612
      @arungandhi5612 Před 3 lety +1

      How to use CV for logistic regression

    • @MarioCastroPonce
      @MarioCastroPonce  Před 3 lety +1

      @@arungandhi5612 Same as in minute 2:40 but knn -> glm and add familiy='binomial'

    • @arungandhi5612
      @arungandhi5612 Před 3 lety +1

      @@MarioCastroPonce thanks Mario , this snippet is of great help

    • @MarioCastroPonce
      @MarioCastroPonce  Před 3 lety

      @@arungandhi5612 cheers

  • @barbaraellensf2128
    @barbaraellensf2128 Před 3 lety +1

    The parameter:
    "tuneGrid =data.frame(k=seq(5,100,by=15))) # Try only these values in the CV step
    # tuneLength = 25) # Use 25 sequential numbers instead"
    you are testing different numbers of k-folds for cross-validation, or different numbers of k-neighbors? sorry I didn't understand the difference..

    • @MarioCastroPonce
      @MarioCastroPonce  Před 3 lety

      tuneGrid allows you to choose the values explicitly. tuneLength only tries with 25 values in the default interval (that varies from function to function and sometimes doesn't span all the "interesting" parameters).

    • @daryladopo9215
      @daryladopo9215 Před 2 lety

      I believe it’s different numbers of k-neighbors