What Is tuneLength in Knn

# The tuneLength parameter tells the algorithm to try different default values for the main parameter set.seed(123) my_knn_model <- train(Species ~ ., method = “knn”, data = trainSet, tuneLength = 4) # In this case we used 4 default values my_knn_model.

What is tune length?

From the {caret} documentation: tuneLength. an integer denoting the amount of granularity in the tuning parameter grid. By default, this argument is the number of levels for each tuning parameters that should be generated by train.

What is the caret package in R?

The caret package (short for Classification And REgression Training) is a set of functions that attempt to streamline the process for creating predictive models. The package contains tools for: data splitting. pre-processing.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest