Notes on PyQ machine learning python grammar

Purpose

Leave a note to remember what you learned in pyq

pandas

About drawing

・ When drawing a histogram, `plt.hist``

plt.hist(df[df["y"] == 1]["x"], label="men 16years old", bins=100, range = (140, 187), alpha = 0.3, color = "green") (df is csv data)

  1. df[df["y"] == 1]["x"] In df, the row value when the column is y == 1
  2. label="men 16years old" Label description
  3. bins=100 Class width 1 class = range / bins
  4. alpha=0.3 Graph transparency

plt.xlabel ("height [cm] "): x-axis title plt.legend ();: Show data description

-When drawing a scatter plot, plt.scatter plt.scatter(men["height"], men["weight"], color="green") The first argument is the value on the horizontal axis in the data. The second argument is the value on the vertical axis in the data.

・ When drawing a scatter plot matrix pd.plotting.scatter_matrix(df)

DataFrame · Extract column values Specify the column name as df [[" alcohol content "," density "]] df.iloc (row to retrieve, column to retrieve) Use df.iloc

・ Divide the data for training and evaluation (test) use train_test_split from sklearn.model_selection import train_test_split (X_train, X_test, y_train, y_test) = train_test_split( X, y, test_size=0.3, random_state=0 ) What percentage of the data is test_size = 0.3 for testing? random_state = 0 Random seed value when dividing data (usually not used)

Decision tree

The decision tree is "a series of if statements that automatically learn conditions"

Numpy

** How to create a multidimensional array with the same elements ** zeros (size): A multidimensional array with all zeros ones (size): A multidimensional array with all 1 elements full (size, value): A multidimensional array of values for all elements zeros_like (multidimensional array): Multidimensional array with all zero elements ones_like (multidimensional array): Multidimensional array with all 1 elements full_like (multidimensional array, values): A multidimensional array where all elements are values

** Continuous data ** arange ([start,] stop [, step,], dtype = None): Continuous data creation like range linspace (start, stop, num = 50, endpoint = True, retstep = False, dtype = None): Continuous data creation when the range to be created and the number num are determined

** Identity matrix and diagonal matrix ** numpy.eye: Identity matrix with all 1 diagonals numpy.diag: any diagonal matrix

Evaluation criteria

The evaluation standard is the type of measuring rod The evaluation standard is the scale of the measuring rod

Recommended Posts

Notes on PyQ machine learning python grammar
Python learning notes
Python grammar notes
python learning notes
Notes on running Azure Machine Learning locally
Python ~ Grammar speed learning ~
Notes on machine learning (updated from time to time)
O'Reilly python3 Primer Learning Notes
Basics of Machine Learning (Notes)
Build a machine learning Python environment on Mac OS
Machine learning with Python! Preparation
[Python] Notes on data analysis
Python data analysis learning notes
Notes on installing Python on Mac
Python Machine Learning Programming> Keywords
Beginning with Python machine learning
Notes on installing Python on CentOS
Set up python and machine learning libraries on Ubuntu
Build a python machine learning study environment on macOS sierra
Build an environment for machine learning using Python on MacOSX
Machine learning environment settings based on Python 3 on Mac (coexistence with Python 2)
Notes on Python and dictionary types
Minimum grammar notes for writing Python
Notes on using MeCab from Python
Machine learning with python (1) Overall classification
Machine learning summary by Python beginners
Notes on installing Python using PyEnv
<For beginners> python library <For machine learning>
Python: Preprocessing in Machine Learning: Overview
Notes on using rstrip with python.
Notes on accessing dashDB from python
"Scraping & machine learning with Python" Learning memo
Machine learning
python learning
Python & Machine Learning Study Memo: Environment Preparation
Notes for using OpenCV on Windows10 Python 3.8.3.
Amplify images for machine learning with python
Notes on nfc.ContactlessFrontend () for nfcpy in python
Use machine learning APIs A3RT from Python
Machine learning with python (2) Simple regression analysis
Learning notes from the beginning of Python 1
I installed Python 3.5.1 to study machine learning
[python] Frequently used techniques in machine learning
Why Python is chosen for machine learning
"Python Machine Learning Programming" Summary Note (Jupyter)
Notes on doing Japanese OCR with Python
Python: Preprocessing in machine learning: Data acquisition
Notes on building Python and pyenv on Mac
[Shakyo] Encounter with Python for machine learning
Personal notes and links about machine learning ① (Machine learning)
[Python] First data analysis / machine learning (Kaggle)
[Python] When an amateur starts machine learning
[Python] Web application design for machine learning
Python and machine learning environment construction (macOS)
Machine learning with Pytorch on Google Colab
An introduction to Python for machine learning
[Python] Saving learning results (models) in machine learning
Python: Preprocessing in machine learning: Data conversion
Python & Machine Learning Study Memo ③: Neural Network
Python & Machine Learning Study Memo ④: Machine Learning by Backpropagation
Learning notes from the beginning of Python 2