"Draw a straight line" our first (minimal) machine learning application

Source: Internet
Author: User

Next

We already have the raw data (x, y), which is shown on the diagram before processing the data, which uses the Matplotlib module.

First of all:

Import Matplotlib.pyplot as Plt

From first import x, y

To mark XY in a coordinate system I started thinking about using the plot () function to try it out:

Plt.plot (x, y)

Plt.show ()

Out of this is the way:

Like the ECG, plot () is to connect the dots, not what we want, or to make a point chart with the discrete function scatter () in the book.

Plt.scatter (x, y)

Plt.show ()

That's it, just the blue dot is a bit big, not very clear change

Plt.scatter (x,y,s=10)

Plt.show ()

Compare yourself to the difference.

"Draw a straight line" our first (minimal) machine learning application

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.