Machine learning using python

Python: Python is a dynamic, high-level, and interpreted programming language with many uses. It makes utilizing an Object-Oriented programming technique to create apps easier. It's easy to learn and has a variety of high-level data structures.

•Python is a powerful and flexible programming language that is simple to learn. It is ideal for application development.

•Python's syntax, dynamic type, and interpretability make it an excellent language for scripting and rapid application development.

• Python supports object-oriented, imperative, functional, and procedural programming methods.

• Python isn't designed for certain jobs, such as web development. Because it can be used with online, enterprise, 3D CAD, and other applications, it is known as a versatile

High level language: 

• A high-level language is any programming language that enables for the creation of programming in a much more user-friendly programming environment that is unaffected by the system's hardware architecture.

• Unlike a low-level language, a high-level language abstracts from the system more than a low-level language, focusing on application programmes rather than core hardware devices like memory addressing and register use.

• A programmer or a human operator is supposed to use high-level languages. They're regarded as "closer to people." To put it another way, their programming style and context are easier to grasp and apply than low-level languages, and the entire code is focused on the specific programme to be developed.

Machine Learning

• Machine learning is a subset of artificial intelligence that enables software to increase prediction accuracy without being explicitly taught to do so. Machine learning approaches employ previous data as input to anticipate new output values.

•It's now utilized for picture recognition, audio recognition, spam filtering, Facebook auto-tagging, recommendation systems, and a variety of other tasks.

• Machine learning includes a variety of techniques, including supervised, unsupervised, and reinforcement learning. Models for regression and classification, clustering, hidden Dynamic modelling methods, and other sequential models will also be discussed.

One of the most significant disadvantages of machine learning is that it exposes data about the input and the job that the machine assists in solving in more complex models.

How the work done by Machine Learning

• When new data is acquired, a Machine Learning model learns from prior data, develops prediction models, and predicts the outcome. The quantity of data aids in the construction of a better model that more accurately predicts the output; hence, the accuracy of the expected output is reliant on the quantity of data. If we have a complex scenario for which we need to make predictions, we may just enter the data into generic algorithms, and the machine will create the logic based on the data and anticipate the conclusion, rather than creating code for it. Our viewpoint on the problem has altered as a result of machine learning. The Machine Learning algorithm is depicted in the block diagram below:

fig1:Machine Learning works

Types of Machine Learning
There are mainly three types of Machine Learning algorithm such as- 
  1. Supervised learning
  2. Unsupervised learning 
  3.   Reinforcement learning
Supervised Learning:
Supervised learning is a type of machine learning in which a machine learns with the assistance of a human. The supervised learning models are trained using the labelled dataset. The model is evaluated after it has been trained and processed by providing a sample of test data to determine if it accurately predicts the output.
 • Supervised learning's goal is to link the input and output data. When a pupil learns under the supervision of a teacher, this is referred to as supervised learning. Spam filtering is an example of supervised learning in action.
•supervised learning may be used to address two different sorts of problems:
1. Classification
2. Regression

Unsupervised Learning:
• Unsupervised learning is a form of machine learning in which the system learns from data without the need for human intervention. Unsupervised models can be trained using an unlabeled dataset with no classes or categories, and the algorithm must operate on it without being supervised.
• In unsupervised learning, the model does not have a predetermined output and instead attempts to extract useful information from a huge amount of data.
• It can be classified into two groups:
1. Clustering
2. Association

Reinforcement Learning:
• Reinforcement learning is a sort of learning in which an agent interacts with its surroundings by performing actions and then learning from the feedback it gets. The agent receives feedback in the form of rewards, such as a positive reward for each successful activity and a negative reward for each unsuccessful action. The agent is not supervised in any way. The Q-Learning algorithm is used in reinforcement learning.

The top 5 Machine Learning Libraries

PANDAS

• Pandas is an open-source Python tool for data manipulation at fast speeds. Pandas gets its name from the phrase Panel Data, which refers to multidimensional data econometrics. It was designed by Wes McKinney in 2008 for Python data analysis. Data analysis involves extensive processing, including restructuring, cleaning, and combining, among other things. Numpy, SciPy, Cython, and Panda are just a few examples of fast data processing tools. When compared to other tools, working with Pandas is faster, simpler, and more expressive. It has a fast and efficient Data Frame object that may be changed, as well as indexing that is both default and configurable. This tool allows you to reshape and pivot data collections. Data should be used to group aggregations and transformations. It's a tool for aligning data and filling in gaps.

                     fig2:importing pandas

After importing the data we will use "Series method" and DataFrame.

PANDAS SERIES

Creating a DataFrame
fig3: pandas series and creating a DataFrame

Now we will look how to import a data set. which is in CSV file in python.
Importing data set

fig4: importing data set

Numpy

Numpy is a Python package for computing and manipulating multidimensional and single-dimensional array elements. Travis Oliphant built the Numpy package in 2005 by merging the capabilities of the progenitor module Numeric with those of another module Numarray. It's a Python extension module written mostly in C. It has a number of functions that can do high-speed numerical computations. Numpy supports multi-dimensional arrays and matrices, as well as a variety of other useful data structures. The most efficient approach to calculate arrays and matrices is to employ these data structures.

Array

• An array is just a collection of items of the same data type. On a structural level, we should be aware that an array is basically nothing more than a collection of pointers. It includes a memory location, a data type, a shape, and strides.

An array cannot contain both a number and a string. We can use all integers, all texts, or other data types to construct arrays.

• To create an array, we utilized the np.array() function.

• A one-dimensional array is one that contains only one row and one column.

• A numerical array is the most common sort of array we'll come across.

fig5:Importing Numpy
Basically Numpy are 2 types of array, they are
  1. Single Dimension Array
  2. Multi-Dimension Array
fig6:single and multi-dimensional

 SCIKIT-LEARN
• Scikit-learn is a Python library that provides a common interface for supervised and unsupervised learning techniques.
• The primary objective of this library is to aid in the development of models.
• The sklearn library was previously imported.
• Keep in mind that we just need to import the Pythonic function. This is done with the from keyword.
• Supervised learning was utilized to remember nearly all of the real-world models.
fig7: import data set in Scikit learn 
Matplotlib
• Matplotlib is essentially a data visualisation tool, with the line, scatter, and histogram being the most frequent graphs. pyplot is a set of routines that turn matplotlib into a MATLAB-like environment. Each pyplot function modifies a figure in some way, such as creating a figure, adding a plotting area to a figure, or charting.
fig8:importing matplotlib

Line Graph 
A line graph is a form of graph that shows data that changes over time. Line graphs are made by connecting numerous points using straight lines.

fig9:Line graph

Scatter plot 
A scatter plot is a type of visual or mathematical representation that uses Cartesian coordinates to depict values for two variables for a set of data.
fig10:Scatter plot

Histogram
A histogram is a graphical depiction of a group of data points divided into user-defined ranges. It has the appearance of a bar.
fig11:Histogram

NLP

• Natural Language Processing (NLP) stands for Natural Language Processing. This is an area of computer science that deals with human language and artificial intelligence. This technology is used by the machines to understand, analyse, manipulate, and interpret human languages. It aids developers in organising knowledge so that activities such as translation, automated summarization, Named Entity Recognition, audio recognition, relationship extraction, and subject segmentation may be completed.

NLTK

• The Natural Language Toolkit (NLTK) is an acronym for Natural Language Toolkit. The NLTK Library is a set of libraries and tools for statistical language processing. It's one of the most powerful NLP libraries, with modules for teaching robots to interpret and respond to human language. Natural Language Toolkit can assist users in acquiring a new skill while also expanding their understanding of natural language processing. Professionals who want to further their careers in AI and Natural Language Processing with Python should study the NLTK library.

fig12:downloading nltk

TOKENIZATION

  • Tokenization works by replacing important data in your environment with tokens. Whether it's credit card information, medical information, Social Security numbers, or anything else that requires security and protection, most organisations have sensitive data on their networks.


fig13:NLP implementation

Conclusion 

In this blog we learned about Python and high-level languages. Next we discuss what is Machine learning , types Machine Learning, and how does Machine Learning work and we learn about the top 5 Python libraries. such as learn Numpy, Pandas, Nltk, NLP, Matplotlib etc. In depth we can see plot and graphs and tokenization.

References

  1. Python,https://www.udemy.com/course/the-top-5-machine-learning-libraries-in-python/learn/lecture/7046346#overview, accessed on 05/10/2021 at 15:59
  2. MachinLearning,https://www.udemy.com/course/the-top-5-machine-learning-libraries-in-python/learn/lecture/7046346#overview, accessed on 05/10/2021 at 16:00
  3. TypesofMachineLearning,https://www.udemy.com/course/the-top-5-machine-learning-libraries-in-python/learn/lecture/7046346#overview, accessed on 05/10/2021 at 16:00
  4. Top5 Machine Learning libraries,https://www.udemy.com/course/the-top-5-machine-learning-libraries-in-python/learn/lecture/7046346#overview, accessed on 05/10/2021 at 16:01

 

Comments

Popular posts from this blog

Time Series for Actuaries