# why do some people don't use scikit-learn library instead of writing long python functions?

The other day I was exploring Kaggle and I found most of them don't use scikit-learn or any other library but instead they write these long python scripts. For example, why they write a function for train/test split when you can just use the scikit-learn library which is hassle free are there any advantages of not using any library and writing python code directly.

p.s: I'm a Data Science Beginner.

• Can you point us to any specific example of such custom function? Oct 14, 2022 at 8:03
• One possible advantage is to acquire a good understanding of what the function does and how it works. We often see people who know which functions to use for standard tasks, but they don't have a good understanding of what the functions do and thus can make serious mistakes. Oct 14, 2022 at 8:38

There can be multiple reasons to write a custom code instead of using a library. For example - you can use the train_test_split from sklearn and that will generate a random split of data for training and validation. But let's assume you want to have a specific distribution of target in training and validation then you need to write a custom function to apply that specific distribution while preparing the training and validation