5 Machine Learning Libraries in Python.

Aastha
4 min readOct 5, 2021

--

What is Python?

It’s a high level programming language. For Rapid Application Development it is combined with dynamic typing and dynamic binding which makes it attractive.High level in programming language means the code is more human readable. It has a huge collection of libraries. Because of it simplicity and easiness it is a beginner’s level programming language.Compactness is another reason for huge popularity of Python.

Machine Learning:

It is a type of artificial intelligence(AI) that provides computer with ability to learn without being explicitly programmed. In a very layman manner, Machine Learning(ML) can be explained as automating and improving the learning process of computers based on their experiences without being actually programmed i.e. without any human assistance. The process starts with feeding a good quality of data and then by building machine learning models using the data and different algorithms, we train our machines(computers). The choice of algorithms depends on what type of data do we have and what kind of task we are trying to automate.

5 machine learning libraries in Python

1) Pandas: Pandas stands for “Python Data Analysis Library”. A pandas Series is a one-dimensional array of indexed data.Pandas is a Python library that is used for faster data analysis, data cleaning and data pre-processing.

Importing CSV in pandas:

Fig.1

Fig.2

Fig. 3

Fig.4

NumPy: It stands for “Numerical Python”. For large multi-dimensional array and matrix processing, numpy is used with the help of a large collection of high-level mathematical functions. Using NumPy, we can perform the following operations: 1)Mathematical and logical operations on arrays.

2)Fourier transforms and routines for shape manipulation.

3)Operations related to linear algebra. NumPy has in-built functions for linear algebra and random number generation. Creating some arrays in python:

Fig.5

3)Scikit Learn: At consistent interface in Python Scikit learn provides a range of supervised and unsupervised learning algorithms.The library is focused on model building. The library we use to import is called sklearn. Scikit learn is an open source Python library that has powerful tools for data analysis and data mining. In this,a data set refers to a dictionary-like object that has all the details about the data. All the data is stored using the .data key, which is an array list.

The very basic Scikit Learn model building process is:

1)Importing the library objects you need(the model or data… etc).

2)Load our data.

3)Define the model.

4)We fit the model to our data (tell the algorithm what our data looks like)

5)Predict

4)Matplotlib:Matplotlib is simply a library for data visualization.

The three most common graphs you’ll see in matplotlib are:

Line, scatter and histogram.For importing matplotlib we use: from matplotlib import pyplot as plt.We import pyplot from matplotlib, we use pyplot to plot some data to the canvas in memory, then we use plt, which is pyplot, to show what we’ve created.

NLP(Natural Language Processing):

Natural language processing (NLP)is the branch of computer science. And more concretely, the branch of artificial intelligence or AI-concerned with giving computers the ability to understand text and spoken words in the same way as human beings can.

NLTK(Natural Language Tool Kit):It is one of the most powerful NLP libraries, which contains packages to make machines understand human language and reply to it with an appropriate response. It assists the research work in NLP, Artificial Intelligence, Machine learning, and more.

Tokenization means break things into smaller parts such as sentences and words. It works by separating words using spaces and punctuation.

For example:

Fig.6

--

--

No responses yet