I usually do the image of the machine learning experiments, identification and detection and so on. From last year's admission has been the use of MATLAB (both the boss and the laboratory students use). But it seems that many people think numpy+matplotlib+scipy is more convenient than MATLAB, And I also found in the actual experiment that the MEX interface of MATLAB is difficult to debug, and sometimes to use cuda words also feel very difficult to debug, often put Matlab crush need to restart the Matlab debugging, so is to try to use Python.
But I feel python is hard to use. My environment is ubuntu14+pycharm.
Like what:
I often need to set breakpoints in the program to see the point in the image is not right, in MATLAB I can set breakpoints anywhere, and then in the Command Window input command to check the status of variables, this function I feel very convenient
You can also inshow () in the command line to see the state of the image after the Matlab breakpoint breaks down
The working space of MATLAB is very simple and clear, the size and value of variables are all at a glance.
And using Python makes me feel very uncomfortable, set a breakpoint after debugging to stop at the breakpoint (Pycharm), and after the breakpoint stop watch variable also has a lot of redundant information ah, in fact, I want to see a few of the coordinates of a few characteristic value is made sense.
I am the use of Python is not the right way or the image class is originally suitable for MATLAB, or other reasons?
Reply content:
April 7, 2016 update
At present, it is best to combine anaconda with Pycharm.
The pros and cons of Anaconda in the previous answer.
The advantages of Pycharm compared to the Spyder are:
1 debugging more convenient, the Spyder set breakpoints in other files, unexpectedly can not stop, you have to set a breakpoint in the main program, and then "Step into", if nested deep, this method is particularly troublesome. Pycharm There is no such problem.
2 Pycharm "Reformat code" function I particularly like, can automatically put your code layout specifications, such as = Each side empty one, the function ends empty two lines, and so on, not only can work on a file, and can act on the whole project!
Disadvantages of Pycharm:
1 The latest version although support Ipython, but the functional experience is poor, 1, Slow reaction 2 Tab key often cannot pop object properties and methods.
2 No workspace.
So, my advice is to use these two tools together, basically can achieve the use of MATLAB experience.
Supplement of March 14, 2016
After a period of use, but also found the shortcomings of Anaconda. Especially the Spyder.
1 in Workspace, the data volume is a bit larger variables to view, easy to die, and Matlab will not.
2 again workspace, floating-point numbers only show three digits after the decimal point, I often have to manually modify to show as the decimal point after 6 bits, do not know how to modify the default settings.
3 Breakpoint Debugging obviously no matlab convenient.
4 Profiler, which is not as convenient as MATLAB, is used to find code-crunching bottlenecks, and the Spyder does not.
There are other, not listed, in short, in the IDE, the Spyder is far worse than MATLAB, but I use Python, will still use the Spyder, because there is no better alternative.
Original answer:
Words into a word: Install anaconda!
Anaconda is ideal for research. Pycharm is suitable for development, not research.
Why do you say anaconda good?
1 has a lot of libraries suitable for scientific research, such as NumPy, scipy, Pandas, Matplotlib, SymPy, Sklearn and so on.
2 The Spyder interface is very much like the interface of MATLAB, and it also supports single-step debugging. The editor, like Matlab, can create cells (using #%%, similar to MATLAB) for easy viewing and debugging.
3 Inside the Ipython notebook, ideal for interacting and demonstrating results. ... Try Winpython? With it I have not opened Matlab for a long time because of professional! Programmers like me are inherently sick of the bizarre grammar of Matlab, but Matlab is doing well in the field it specializes in! Very good!! As long as you do not take the Matlab as Python use is good.
Python is a universal programming language, not a specialized type of Matlab. Since it's universal, it's OK to take it for scientific calculations, but you'll find that it's not designed specifically for you, and if you don't understand programming, you'll find a lot of places you don't understand.
"In MATLAB I can set breakpoints anywhere, and then enter commands in the command window to check the status of variables, which I think is very convenient.
"matlab can also inshow () to see the state of the image at the command line after it has broken down
Also note that Python is just a programming language. Pycharm is an IDE designed for Python development, but not Python's natural and unique IDE, and not specifically designed for scientific computing. (But a platform called Sagemath is designed for scientific computing, and its main language is Python.) )
Pycharm can't view the image after setting a breakpoint? I didn't use pycharm so I don't know. But I know Python is sure to do that. During my commissioning, I often stop in doubt and open a Python interactive command line to study it carefully. Sometimes I also use pudb as a professional (complex) debugging tool. Python debug has used only log & GDB, breakpoints and the like never use. Have this feeling is right, also not wasted MATLAB sell so expensive! Just to show that you are not good at using Python, if you can skillfully use it will not feel like you. Know programming virgin answer, 0 basic bare learn matlab half-way continue naked learning python, process pain, for why difficult to have experience:
was asked to rectify the original I was from a computer without the hard access to python from the perspective of the study of the pain. This angle may be one-sided, so I have modified the description method and outlined how I overcame it:
1.Matlab support matrix operation, spoil our group of 0 computer-based cabbage. Write a simulation to generate a random number matrix and then. *./even. ^, it's refreshing. And then some of the benefits in Python are gone. *./becomes a complex and more complex cycle, a little nightmare for people who have just turned to python.
2. After solving the first problem with packet matrix, the second one is met. matlab function want to use, continue to spoil our non-computer origin, how beautiful is how beautiful. Then in the various object-oriented languages, first call, then use. To numpy such a large number of functions of the same name is not afraid to call *, must be adjusted. Sometimes you have to distinguish between objects, sub objects, methods. This problem touches the face object always can not escape, has the VBA Foundation may not be so arduous
3. Then just a write loop will come across: indent, indent, indent!
MATLAB automatically indent the outer layer, continue to spoil non-CS simply Beautiful
Python I want to use Vernier calipers! (It's not a stem on the internet, I think spontaneously). I can overcome part of myself by writing short loops of multi-segment and gray-text annotations
4.Matlab function does not understand direct help can tell you how to use the function.
Python can see the source code, for non-computer rough start will have difficulty reading. Fortunately, the web of each package is conscience.
5. A variety of sinkholes on the road that my weak force has not yet met.
I really am not black python, after all, the algorithm is the same simulation of a running MATLAB mask face. At the same time to mask the surface of the same cross-functional MATLAB window, the existence of more than a few.
All of the above are non-CS 0 Basic Learning Multi-lingual is hehe's heartfelt words. Will certainly be the collective contempt of the programmers, so be asked to rectify my no complaints. Just I have a little wishful thinking, expect programmers God can understand us these halfway decent, but also to learn mathematics, and to learn the algorithm, and to learn the language, but also to learn the market to see cases of weak forced gold number students. We often laugh at ourselves as a Druid (finance, Math, statistics, computer) of the Fantastic Four in Wow, four talents, but not enough talent to be equipped. We even have students who do not like computers, the author himself forcibly read a paragraph after paragraph of code. Can accuse us do not like to do not learn, but our gold number of students are aware of the short-board effect of the terrible, as well as learning the financial ignorance of the computer is how naïve. For us, the only purpose of programming is to realize it, and to expect some understanding here. We are weak, not afraid to be sprayed, spray us we can learn something. Read the answer upstairs.
First clear point, the main machine learning, so the following are for machine learning.
The question is divided in two ways.
The first is the grammatical angle. From a purely grammatical perspective, Python is clearly much better than MATLAB, but for machine learning, MATLAB is sufficient to ensure that the ability to be strong on the basis of simple enough to fully meet the needs of researchers. For example, the class and object in MATLAB is a group of Xiang, but it doesn't matter, because researchers do not use. Generally engaged in scientific research, only need to write a prototype, can run through the line, at this time Matlab "to the object-oriented support is very poor" instead became a merit, because only the process can be, and the process-oriented thinking is very natural and intuitive.
Of course, the MEX is not good to write, GPU programming inconvenient, this is really a flawed matlab. In addition, MATLAB operating efficiency is low, memory management is very poor, this is also a big disadvantage.
But the problem of the Lord is clearly not a question of language level. Look at the description, the main feeling Python
not convenient。 From a language perspective, numpy+matplotlib+scipy is powerful enough to meet the needs of researchers, and as a scripting language, Python is much simpler to write than Java C + +. The problem must be on the tool.
Matlab IDE is very suitable for scientific calculations, but pycharm is a general-purpose IDE, style for ordinary programming, not the scientific calculation has a special optimization, non-computer origin may be used slightly inconvenient.
So I suggest that the main topic try other ides. The Spyder is recommended above, which is very similar to MATLAB and can be seamlessly connected. In addition Ipython notebook is also artifact, can write the program can make notes to distribute the display, very easy to use.
But I'm generally using the VS Python plugin PTVs (python Tools for Visual Studio
), there is a strong vs for support, code complement AH, automatic jump Ah, debugging ah, etc. are extremely convenient, recommended to the title and everyone. If MATLAB is not good enough for Python, how worthy of the tens of thousands of dollars. Besides the matrix operation, Python's ability to express more than Matlab does not know much. (recently a MATLAB project by this wonderful syntax to make the pain of the vomit groove)
debugging, whether pycharm or anaconda I only used to look at the log. What's wrong with a breakpoint?
Legend has it that the two leaps of Python programmers take place after learning decorator and unit test, and then with the Almighty import Dafa Plus, you will feel the Metamorphosis ~ ~