Machine learning starting with Python Personal memorandum Part1

Introduction

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.

Installation of scikit-learn

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]

Difference between Numpy and SciPy

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.

Iris classification

Iris_virginica.jpg

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.

Impressions

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

Machine learning starting with Python Personal memorandum Part1
Reinforcement learning starting with Python
Machine learning with Python! Preparation
Beginning with Python machine learning
Machine learning with python (1) Overall classification
"Scraping & machine learning with Python" Learning memo
Predict power demand with machine learning Part 2
Amplify images for machine learning with python
Machine learning with python (2) Simple regression analysis
[Shakyo] Encounter with Python for machine learning
Data analysis starting with python (data preprocessing-machine learning)
Build AI / machine learning environment with Python
[Python] Easy introduction to machine learning with python (SVM)
Learning Python with ChemTHEATER 03
"Object-oriented" learning with python
Learning Python with ChemTHEATER 05-1
Python memorandum (personal bookmark)
EV3 x Python Machine Learning Part 2 Linear Regression
Python starting with Windows 7
[Note] Python, when starting machine learning / deep learning [Links]
[Python] Collect images with Icrawler for machine learning [1000 images]
Learning Python with ChemTHEATER 02
Python basic memorandum part 2
Machine learning starting from scratch (machine learning learned with Kaggle)
GRPC starting with Python
Learning Python with ChemTHEATER 01
I started machine learning with Python Data preprocessing
Build a Python machine learning environment with a container
Easy Machine Learning with AutoAI (Part 4) Jupyter Notebook Edition
Run a machine learning pipeline with Cloud Dataflow (Python)
Build a machine learning application development environment with Python
Summary of the basic flow of machine learning with Python
Effective Python Learning Memorandum Day 15 [15/100]
Image processing with Python (Part 2)
Machine learning learned with Pokemon
Studying Python with freeCodeCamp part1
Bordering images with python Part 1
Scraping with Selenium + Python Part 1
Effective Python Learning Memorandum Day 6 [6/100]
Effective Python Learning Memorandum Day 9 [9/100]
Effective Python Learning Memorandum Day 8 [8/100]
Studying Python with freeCodeCamp part2
Image processing with Python (Part 1)
Solving Sudoku with Python (Part 2)
Effective Python Learning Memorandum Day 14 [14/100]
Effective Python Learning Memorandum Day 1 [1/100]
Machine learning Minesweeper with PyTorch
Image processing with Python (Part 3)
Python Machine Learning Programming> Keywords
Python: Supervised Learning: Hyperparameters Part 2
Effective Python Learning Memorandum Day 13 [13/100]
Effective Python Learning Memorandum Day 3 [3/100]
Effective Python Learning Memorandum Day 5 [5/100]
Scraping with Selenium + Python Part 2
Effective Python Learning Memorandum Day 4 [4/100]
Python Iteration Learning with Cheminformatics
Python starting with Hello world!
Try machine learning with Kaggle
Effective Python Learning Memorandum Day 7 [7/100]
Effective Python Learning Memorandum Day 2 [2/100]
I started machine learning with Python Clustering & Dimension Compression & Visualization