I decided to learn machine learning with Python, First of all, I wrote it as a personal memorandum when reading the book "Machine learning starting with Python".
I am not affiliated with an IT company, but I will do my best to learn and work from now on. I am leaving a log, hoping that it will be of some help to beginners.
It is read as scikit-learn. There is an instruction manual at the link below. Maybe only some people, but looking at the linked diagram reminds me of gnuplot. -Scikit-learn documentation -Scikit-learn User Guide
I was wondering whether to install Jupyter Notebook, but since it was the first time, I decided to follow the book. It might be convenient to use it. Install Anaconda to install Jupyter Notebook. ・ Download page of Anaconda official website
If you install Anaconda, you can use all the packages used in this book. If you are already using Python, go to the terminal
pip install numpy scipy matplotlib ipython scikit-learn pandas pillow
You can install the library used in this book by typing.
How to use Jupyter Notebook is described in the link below. [Jupyter Notebook] Let's know how to use it effectively [Python / Machine learning]
They are NumPy and SciPy. SciPy is a set of various software, and all the functions of NumPy can be used with SciPy. ・ Differences and relationships between SciPy and its friends (NumPy, IPython, etc.) ・ Numpy and Scipy For beginners like me, I don't really know the difference, so I don't care.
CSR CSR is an abbreviation for Compressed Sparse Row, which is a compressed form of a sparse matrix. Matrix calculation often deals with matrices with 0 components, so I think that it is in a convenient form so that data does not increase unnecessarily.
The COO format is an abbreviation for Coordinate Format and is a method of specifying the matrix number normally.
pandas In the book
from IPython import display
Is written, but after that
display(data_pandas)
At the place of
TypeError: 'module' object is not callable
I get an error. In my environment
from IPython.display import display
Then it worked. Probably because the version is different.
In the book when using the scatter_matrix function
grr = pd.scatter_matrix(iris_dataframe, c=y_train, figsize=(15,15), marker='o', hist_kwds={'bins': 20}, s=60, alpha=.8, cmap=mglearn.cm3)
There is a description, but in my version
grr = pd.plotting.scatter_matrix(iris_dataframe, c=y_train, figsize=(15,15), marker='o', hist_kwds={'bins': 20}, s=60, alpha=.8, cmap=mglearn.cm3)
It worked with.
This time, I wrote what I didn't understand after reading Chapter 1 Introduction. Most of the environment was improved, but at the end I touched on machine learning a little. k-The iris was classified by the nearest neighbor method, but the details of the model are not mentioned. There are various parameters, but it was stated that the parameters to be changed will be introduced in a later chapter. At the moment, I'm not sure because it's full of parameters, but I'd like to keep going.
From the next time, we will learn the contents of machine learning and supervised learning in earnest.
Recommended Posts