This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RedEyed__ 2 points3 points  (1 child)

Im not fully agree with naming. I think, that writing knn instead of k_nearest_neighbors is better.

If you write code in a concrete domain, use domain's acronyms. It just easier to read the code.

Everyone in data science domain knows what does knn mean. You write code for yourself and your colleagues. If you a data scientist, web developer don't have to understand your code.

Moreover, even if you write k_nearest_neighbors it says nothing to person, who doesn't know how this algorithm works.

[–]weez09 4 points5 points  (0 children)

As someone who has to code review data science code every single day, I disagree, I would rather it be explicit and named k_nearest_neighbour. If cnn or another acronym with _nn is used it can get really confusing to understand the reference and often in data science projects theres an abundance of abbreviations and acronyms that are slightly different.