Machine Learning Python Library

Which Python library is used for machine learning? Which Python library is used for AI? The answer will point to NumPy and many others.

Here very briefly we will take a look at a few libraries that we use quite often in machine learning. 

How can we use pandas and matplotlib packages in python and apply it to machine learning?

In this section we will see how we can use pandas and matplotlib together to plot a graph.

As a result, data visualization, which is a key component of not only machine learning but also data science, will be possible.

Pandas and Matplotlib

Consider a relational database where we have stored the scores of students.

For example we have made it as simple as possible so that we can understand the key concepts.


If you are a complete beginner your journey to learn TensorFlow might start from here.

For the TensorFlow beginners we have a dedicated category – TensorFlow for Beginners.
But besides that, you may need to learn several other machine learning and data science libraries.

As a result, you may check these categories as well – NumPy, Pandas, Matplotlib.

However, without learning Python, you cannot learn the usages of these libraries. Why? Because they all use Python as the Programming language.

Therefore please learn Python at the very beginning and start learning TensorFlow.

And, finally please check our Mathematics, Discrete Mathematics and Data Structures categories specially. We have tried to discuss from basic to intermediate level so that you can pick up the core ideas of TensorFlow.

Firstly, as the data structure is relational, the pandas package in python will help us to group and join the data.

As a result we can dig deep into data science primarily.

Secondly, the pandas package provides fast, flexible and expressive data structures which are relational.

Assuming that you’re not a seasoned python programmer, or expert in data science we have made this code simple.

import pandas as panda
import matplotlib.pyplot as plt

data_frame_of_numbers = panda.DataFrame({'name': ['John', 'Emily', 'Json'], 'mark': [99, 100, 98]})

names = data_frame_of_numbers['name']

marks = data_frame_of_numbers['mark']

plt.plot(names, marks)
plt.show()

As an outcome when we run the code in Google Collab. We can get a look below.


Data visualization machine learning
Data visualization machine learning

We see that we have imported the pandas and Matplotlib packages first.

With the help of the pandas package we have first created a relational database of students who have got scores in two subjects. 

Then we have created the columns and rows. 

After that, we have plotted the names of the students as the X axis and the scores as the Y axis.

As a result, matplotlib plots them and builds a nice visualization.

If you are a complete beginner in data science, before using Matplotlib in python for data science, let’s try to understand how this package works.

The matplotlib package in python helps us to visualize scientific data.

On the graph it’s clear who gets the highest scores.

We have seen the same data visualization which is the core of data science.

However, the above graph is a simple example. On the contrary, in data science data could be dense, chaotic, and big.

For example, we could have made this graph a little bit complex.

However, we will discuss that topic in the coming section.

So stay tuned and cheers up.

What Next?

Books at Leanpub

Books in Apress

My books at Amazon

GitHub repository

Flutter, Dart, Python and TensorFlow

C, C++ Java, and Game Development

Twitter

Comments

One response to “Machine Learning Python Library”

  1. […] previous sections we have discussed a few other key concepts, such as Python and scikit-learn, the role of python libraries in machine learning and many […]

Leave a Reply