Cross validation in R with the caret library

Поділитися
Вставка
  • Опубліковано 1 лис 2024

КОМЕНТАРІ • 13

  • @barbaraellensf2128
    @barbaraellensf2128 3 роки тому +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  3 роки тому

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

  • @MilindaArambawela
    @MilindaArambawela 3 роки тому

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

  • @md.akibal-zubayer2104
    @md.akibal-zubayer2104 2 роки тому

    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 ?

  • @barbaraellensf2128
    @barbaraellensf2128 3 роки тому +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  3 роки тому

      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 2 роки тому

      I believe it’s different numbers of k-neighbors

  • @casualcomputer6544
    @casualcomputer6544 3 роки тому +1

    How do we get the caret snippet ?

    • @MarioCastroPonce
      @MarioCastroPonce  3 роки тому +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 3 роки тому +1

      How to use CV for logistic regression

    • @MarioCastroPonce
      @MarioCastroPonce  3 роки тому +1

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

    • @arungandhi5612
      @arungandhi5612 3 роки тому +1

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

    • @MarioCastroPonce
      @MarioCastroPonce  3 роки тому

      @@arungandhi5612 cheers