UBC-DSCI / introduction-to-datascience

Open Source Textbook for DSCI100: Introduction to Data Science in R
https://datasciencebook.ca/
Other
51 stars 56 forks source link

Sort+head vs top_n and bottom_n #464

Closed trevorcampbell closed 1 year ago

trevorcampbell commented 1 year ago

In the Python version of the book we teach how to get the K largest / smallest values by using

In the R book we might want to consider mimicking this with top_n and bottom_n (if I recall these are the funcs that do the same thing)

Should come back to this once the Python book is stabilized. Right now we do nlargest/nsmallest in Ch5 (in k-nearest neighbours stuff), but we might move it back to Ch1 and then just use nlargest/smallest in ch5...

trevorcampbell commented 1 year ago

If we do change this in the R version, we should make sure to update the list of K-NN steps (after section on computing distances) to be 3 items instead of 4

trevorcampbell commented 1 year ago

this also comes up in Ch1 -- maybe Ch3 too?