Azure Notebook is a jupyter notebook environment available for Microsoft accounts. It seemed convenient, so I tried it.
Click here for the theme Learn by programming with Ayaka Ikezawa! Mathematics Course for Machine Learning [Bayes' Theorem] https://codeiq.jp/magazine/2017/03/49158/
Recommended for those who are not good at math, cannot step into the contents of machine learning, and have hurdles in building a python environment. You can run python code with just an MS account. It takes about 5 minutes.
If you access https://notebooks.azure.com/ and register the necessary information (Get Start), this screen will appear. Create a new Notebook with + new. I chose Python 3.5 as the language and bayes the file name.
When you select the created file, a screen like this will appear.
Try running the first python program. Paste it in the text box that says in: You can do it with the button. The result is as follows. Since print is not required in jupyter (* 1), I removed the print statement and executed it.
It will be done like this, so let's try it. Other than print, the last application in the tutorial is as follows. 1.from janome.tokenizer import Tokenizer → The missing library could be installed with the following. !pip install janome
In jupyter, you can execute commands by prefixing with!. For example, you can get a list of files by typing! Ls -l.
The last application needs to create files and folders before it works. I executed the following command.
!mkdir train_data
!mkdir train_data/baseball
!mkdir train_data/soccer
!echo baseball > train_data/baseball/baseball.txt
!echo soccer> train_data/soccer/soccer.txt
!echo baseball > test.txt
Click here for the one that was executed to the end (print is removed)
The error in the print statement is due to Python3, not Python2.
This is because the print statement is a function in the Python3 series.
If you modify print to Python3 type description, the result will be as follows. Since jupyter notebook is a specification that outputs the result as out when only the variable value is described, For convenience, we often do not use print.
Have a good jupyter life! !!
Recommended Posts