[PYTHON] Take advantage of validated ideas from other libraries in other languages

When developing a program in a language that is an OS, you may feel that something is missing. In such cases, I refer to the library of another language.

** Reasons to imitate other libraries **

**-I already know what is beneficial. ** ** If you are using languages such as Python or Java, you already know what libraries are useful to you in those languages. I already know the part that I wish the C ++ language library had such a thing, and after that, if the function is not in the standard C ++ language library, it leads to the desire to implement it. In addition to STL, look at Boost's library to see if you need to make your own. **-I know that the implementation of that function will work. ** ** Even if the language changes, the essence that can be achieved with a computer language does not change. The strength of open source is that it has already been shown that the functionality can be achieved and that you can read the implementation details if necessary.

** ・ Don't get lost in external specifications. ** ** It mimics a library that has been validated for usefulness, at least not getting lost in the external spec. If the external specification is familiar to you, you can reduce the need to learn new things to use the library. Example: The library in matplotlib is similar to MATLAB drawing functions. If you've used MATLAB drawing functions (http://jp.mathworks.com/help/matlab/graphics.html), you'll soon be familiar with using matplotlib. Even if you've never used MATLAB, a library of designs that have been validated will be appealing. (Personal opinion: It is a pity that Excel graphs have many restrictions such as no histogram drawing function.)

What kind of library should be used is very important. It's about knowing what implementations are in different languages for the desired processing. It is effective to listen to the voices of people who use other processing systems and libraries in order to know the processing system libraries that you do not normally use.

The external specifications of the library include good design and bad design in terms of method names, argument order, and return data format. For example. One of the reasons why the machine learning library of scikit-learn is useful is to use the same interface regardless of the type of machine learning algorithm. The point is that it is possible.

estimator.fit(X_train, y_train) y_test_predict[name] = estimator.predict(X_test)

If this is different for each method, method name, argument data format, argument order, return value format, scikit-learn Should not gain so much usefulness.

When you create a new library, use the ideas that have already been verified and design.

Reference URL Sample code that fit () and predict () for multiple models with scikit-learn [Face completion with a multi-output estimators] (http://scikit-learn.org/stable/auto_examples/plot_multioutput_face_completion.html)

Recommended Posts

Take advantage of validated ideas from other libraries in other languages
EP 13 Take Advantage of Each Block in try / except / else / finally
Impressions of people with experience in other languages learning Python using PyQ
Trends in programming languages from the perspective of GitHub (updated semi-annual changes)