Python libraries for Machine Learning

There are a lot of python libraries for machine learning. In this section we will take a look at three major libraries which we need the most.

Firstly we will discuss NumPy. It is one of the fundamental libraries that we need for machine learning as well as data science. 

What can we do with NumPy?

A lot of things, in fact.

We can do scientific computing with NumPy. Therefore NumPy is essential for data science. 

What other things does NumPy do?


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.

NumPy provides a multidimensional array object and many more that we will discuss one after another.

For example we can take a look at the following instance.

# first example
import numpy as np

first = np.array(['Sanjib', 'John'])

print(first.shape)
print(first.dtype)
print(first.size)


second = np.array([2.5, 3.56, 4.47, 5.1, 6.78])

print(second.shape)
print(second.dtype)
print(second.size)

Take a look at the code. What do we see? 

We have first imported the library. Right? 

After that we have declared two NumPy arrays and searched for the size, shape and type of the array.

As a result, we have found that for the first instance, it is a sequence of characters. 

For the second instance we have seen an instance of float 64.

(2,)
<U6
2
(5,)
float64
5

Another collection-based good Python library is Pandas. In the coming sections, we will see a lot of examples where we will use Pandas.

In any kind of relational data structure, we need Pandas library.

Let us see an example first.

import pandas as panda

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

print(data_frame_of_numbers)

The Pandas library provides us a clear picture of how this data structure is organized in a column and row format. 

Let’s get a look at the output.

    name  mark
0   John    98
1  Emily    99
2   Json    98

What Next?

Books at Leanpub

Books in Apress

My books at Amazon

GitHub repository

TensorFlow, Machine Learning, AI and Data Science

Flutter, Dart and Algorithm

C, C++, Java and Game Development

Twitter

Comments

Leave a Reply