Python & Machine Learning Study Memo ②: Introduction of Library

https://qiita.com/yohiro/items/04984927d0b455700cd1 Continued

matplotlib and numpy

matplotlib is a graph drawing library. It seems that he often uses pyplot. numpy is a numerical calculation library. You will be able to draw mathematical graphs by combining these two.

How to import

import matplotlib.pyplot as plt
import numpy as np

How to draw a graph

If $ y = 2x + 1 $

x = np.arange(0, 10, 0.1) #0 to 10 0.Create 1-step list x
y = 2*x + 1 #x 2x for each element+Create y as a map of 1

plt.plot(x, y) # (x, y)Draw a graph of
plt.show() #graph display

You can draw the following graph by writing capn.jpg

Sigmoid function

A function that draws the following curve. The expression is represented by $ y = \ frac {1} {1 + e ^ x} $. Figure_1.png

It has a high affinity with the property of neurons that "fires when the input exceeds the threshold", and is often used as an activation function (probably). The implementation example by Python is as follows.

import math
def sigmoid(a):
    return (1.0 / (1.0 + math.exp(-a)))

Recommended Posts

Python & Machine Learning Study Memo ②: Introduction of Library
Python & Machine Learning Study Memo ⑤: Classification of irises
Python & Machine Learning Study Memo: Environment Preparation
Python & Machine Learning Study Memo ③: Neural Network
Python & Machine Learning Study Memo ④: Machine Learning by Backpropagation
Python & Machine Learning Study Memo ⑥: Number Recognition
Python & Machine Learning Study Memo ⑦: Stock Price Forecast
<For beginners> python library <For machine learning>
Introduction to Machine Learning Library SHOGUN
"Scraping & machine learning with Python" Learning memo
[Memo] Machine learning
Introduction of Python
[Learning memo] Basics of class by python
I installed Python 3.5.1 to study machine learning
Python standard library: second half (Python learning memo ⑨)
An introduction to Python for machine learning
Python standard library: First half (Python learning memo ⑧)
Introduction to Python Basics of Machine Learning (Unsupervised Learning / Principal Component Analysis)
Python learning memo for machine learning by Chainer Chapter 10 Introduction to Cupy
Python learning memo for machine learning by Chainer Chapter 9 Introduction to scikit-learn
[Python] Easy introduction to machine learning with python (SVM)
Machine learning memo of a fledgling engineer Part 1
Python class (Python learning memo ⑦)
Python module (Python learning memo ④)
Introduction of Python Imaging Library (PIL) using HomeBrew
Machine learning course memo
Machine learning library dlib
[Translation] scikit-learn 0.18 Tutorial Introduction of machine learning by scikit-learn
Machine learning memo of a fledgling engineer Part 2
Python learning memo for machine learning by Chainer Chapter 13 Basics of neural networks
Get a glimpse of machine learning in Python
Python learning memo for machine learning by Chainer until the end of Chapter 2
Machine learning library Shogun
Introduction to machine learning
Free version of DataRobot! ?? Introduction to "PyCaret", a library that automates machine learning
Python learning memo for machine learning by Chainer from Chapter 2
Python learning memo for machine learning by Chainer Chapters 1 and 2
Installation of TensorFlow, a machine learning library from Google
Introduction to Mathematics Starting with Python Study Memo Vol.1
Summary of the basic flow of machine learning with Python
[Introduction to Python] Basic usage of the library matplotlib
Memo for building a machine learning environment using Python
DEEP PROBABILISTIC PROGRAMMING --- "Deep Learning + Bayes" Library --- Introduction of Edward
Python exception handling (Python learning memo ⑥)
Recommendation of binpacking library of python
An introduction to machine learning
Basics of Machine Learning (Notes)
Machine learning with Python! Preparation
Machine Learning Study Resource Notepad
Introduction of activities applying Python
Practical machine learning system memo
Python Machine Learning Programming> Keywords
Importance of machine learning datasets
Beginning with Python machine learning
Super introduction to machine learning
Build a python machine learning study environment on macOS sierra
The result of Java engineers learning machine learning in Python www
Python learning memo for machine learning by Chainer Chapter 7 Regression analysis
A beginner's summary of Python machine learning is super concise.
University of Tsukuba Machine Learning Course: Study sklearn while creating the Python script part of the task (17)
University of Tsukuba Machine Learning Course: Study sklearn while creating the Python script part of the task (5)