Author: Liu algorithm

Source: Hang Seng LIGHT Cloud Community

One, foreword

In the previous several articles, the author described some methods and skills about algorithm learning and entry, including some of their own learning experience and practice methods. However, it is inevitable to talk about the method of some empty, so from the beginning of the system about the introduction of the algorithm should be necessary skills and algorithm principles, ideas.

This will be a series of courses, starting with a text version. We will continue to update details or add code implementation details as time progresses.

This article starts with the Basic Python programming environment by using jupyter Notebook as the code development environment.

Install the Jupyter Notebook

In the article “AI Algorithm Xiaobai Introduction Series” – How to learn to become an AI algorithm engineer? One, I mentioned the steps to install the Jupyter Notebook, and I’ll briefly describe them here.

1. First, install the Anaconda parse environment. After the installation, you can enter the Jupyter Notebook in the Anaconda Prompt window and press Enter to start it.

Or you can go in there and CD it to a particular path and then type in jupyter Notebook to start up.

2. After startup, you can run Python code normally in the web edition editing environment. For example, the following figure shows importing a simple package in Python and printing out the prompt statement.

3. Jupyter Notebook Basics

1. Text cells use markdown syntax, you can refer to

Guides.github.com/features/ma…

2. Code cell execution:

4. Python Basics

1. List generator and index function, including index, filter, slice and length

Lists do not require the same type of data to be stored, creating efficiency problems.

Numpy array data type. The data structure must be the same. Otherwise, an error will be displayed. The disadvantage is that the data is not made into vectors or matrices and does not support operations.

3. Create NUMpy and its basic functions

1. Create arrays in different ways and common techniques.

2. Generate an array of different sizes and initialize it:

3. The generation is generated at a certain interval, but floating point spacing is not supported.

4. Generate a finite number of values within a certain range:

5. Generate random numbers within a specific interval

6. Generate a random number of a specific size

4. Numpy merge and split

1. The merger:

2. The division:

5. Matplotlib basis

1. The parameters of color can be referred to:

Matplotlib.org/2.0.2/api/c…

2. About linestyle parameters:

Matplotlib.org/devdocs/gal…

3. Scatter Plot:

4. Machine learning algorithm practice

Among the current classical machine learning algorithms, we select KNN as the process of simple code practice. KNN algorithm belongs to the model of unsupervised classification algorithm. I will describe the principle and details of the algorithm in detail in the following courses. At present, I only use jupyter to simply realize its process.

Firstly, the training data sample raw_data_X and the corresponding label data RAW_data_Y are defined, and the test sample is tentatively defined as x

The specific code is as follows:

Modeling, training, and reasoning

The above is Python code and simple application based on jupyter Notebook implementation. More related courses will be updated in the future.