注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
kaggle最近的一个Kernal,总结的还不错,大家学习的时候可以参考一下:
Six steps to more professional data science code
. .и
详情在上面的链接里,不想点的下面是前面的总结介绍:. 1point 3acres
The single best thing you can do to make your code more professional is to make it reusable.. From 1point 3acres bbs
What does “reusable” mean? At some point in your data science career, you’re going to write code that will be used more than just once or twice. Maybe you’re running the same preprocessing pipeline on some different sets of image files, or you’ve got a suite of evaluation techniques that you use to compare models. We’ve all copied and pasted the same code, but once you find yourself copying the same code more than once or twice, it’s time to sink some time into making your code reusable. Reusing well-written code isn’t cheating or slacking: it’s an efficient use of your time and it’s considered a best practice in software engineering.. Waral dи,
There are six central principles that I think 1) make it easy for you or your colleagues to reuse your code, 2) make your code look really polished and professional and, above all, 3) save you time.
📦 Modular: Code is broken into small, independent parts (like functions) that each do one thing. Code you’re reusing lives in a single central place.
✔️ Correct: Your code does what you say/think it does..
📖 Readable: It’s easy to read the code and understand what it does. Variable names are informative and code has up-to-date comments and docstrings.. .и
💅 Stylish: Code follows a single, consistent style (e.g. the Tidyverse style guide for R, PEP 8 for Python code)
🛠️ Versatile: Solves a problem that will happen more than once and anticipates variation in the data.
💡 Creative: Solves a problem that hasn’t already been solved or is a clear improvement over an existing solution.
Let’s go through each of these steps in a bit more detail.with a bit of sample code and see how they work in practice. |