Internship Report. - AI&Ml With Python
Internship Report. - AI&Ml With Python
ARJUN DAHIYA(18001007005) 2
TABLE OF CONTENT
S.NO TITLE PAGE NO.
1. CERTIFICATE OF TRAINING 3
2. CERTIFICATE 4
3. DECLARATION 5
4. ACKNOWLEDGMET 6
5. ABOUT INTERNSHALA 7
6. WHAT IS PYTHON? 8
7. HISTORY OF PYTHON 9
8. INSTALLATION OF PYTHON 10-12
9. SALIENT FEATURES OF PYTHON 13-16
10. KEYWORD IN PYTHON 16-17
11. SCOPE OF PYTHON 18
12. TYPE OF OPERATOR IN PYTHON 18
13. VARIABLE IN PYTHON 18-19
14. DATATYPE IN PYTHON 19-28
15 Pandas in Python 29
16 What is Artificial Intelligence 30-31
17 Who is an Artificial Intelligence Engineer 32-40
18 Machine learning 41-42
19 How machine learning works 43
20 Career in artificial intelligence 43-46
ARJUN DAHIYA(18001007005) 3
ARJUN DAHIYA(18001007005) 4
CERTIFICATE
ARJUN DAHIYA(18001007005) 5
DECLARATION
I hearby declare that the work embodied in this Professional training report
was carried by me under the supervision of Mr.Dinesh kr. Atal(Internal
supervisor),DCRUST , Murthal .This work has not been submitted in part
or in full in any other university for any degree.
(ARJUN DAHIYA)
ARJUN DAHIYA(18001007005) 6
ACKNOWLEDGEMENT
I would like to express my deepest appreciation to all those who provided me the
possibility to complete this report. It is with deepest sense of gratitude and reverence
that I express my indebtedness to Internshala who granted to do online six week
training on their website. I take privilege to express my sincere thanks and gratitude to
my internal supervisor Mr. Dinesh kr. Atal who gave me guidance, constructive
criticism, and valuable suggestions. I, feel honoured to have him as my mentor. My
deep and sincere gratefulness is due to Internshala who readily and cheerfully
extended every help required from the beginning till the end of this work. The support
of family and friends are worth mentioning.
I am thankful to all the Teachers of BME dept, DCRUST , Murthal and Internshala
without their support and blessings, this report would not have been possible.
ARJUN DAHIYA
18001007005
Biomedical Engineering
ARJUN DAHIYA(18001007005) 7
ABOUT INTERNSHALA
INTERNSHALA is India's largest Internship and training platform with more than four
lakh Practical listing every year all across streams. Founded in 2010, by a team of IIT
and NIT alumni.
INTERNSHALA helps students to find internships in more than 40,000 organisations
that use the platform to hire intern.
Internshala is a Gurgaon-based web venture providing internship resources and
career services to students and employers.
The site offers Internship searching and posting, and other career services such as
counselling, cover-letter writing, resume building and training programs to students.
ARJUN DAHIYA(18001007005) 8
WHAT IS PYTHON?
HISTORY OF PYTHON
8
ARJUN DAHIYA(18001007005) 9
ARJUN DAHIYA(18001007005) 10
1. If you are using Ubuntu Linux, at the command prompt type:
$ sudo apt-get install python3
2. If you are using Fedora, at the command prompt type:
$ sudo yum install python3
3. The most recent version of Python 3 will be downloaded and installed. To
verify the installation, type:
$ Python
The Python prompt (>>>) will appear.
From source
You can install Python from its source code if you want to really customize the binary
by setting certain options or flags during the build process.
1. Download the source from
https://www.python.org/ftp/python/3.6.2/Python-3.6.2rc1.tgz
2. Type the following commands to extract and install Python from its
source:
$sudo tar xzf python-3.6.2.tar.xz
$./configure
$sudo make install
3. To verify the installation, in the terminal type:
$ Python3
4.The Python prompt (>>>) will appear.
ARJUN DAHIYA(18001007005) 11
2. Run the downloaded file and follow the instructions in the installation
wizard.
Using Home brew
Home brew is a package manager that lets you install, update, and uninstall packages
from the command line on the Mac OS.
1. Home brew depends on Apple’s Xcode package, so run the following command to
install Xcode first:
$ Xcode select --install
2. Next, install Home brew by following the instructions on their website, https://
brew.sh/
3. After installing Home brew, from the prompt in the terminal type the following
command to install Python.
$ brew install python3
4. To verify the installation, type:
$ Python3
The Python prompt (>>>) will appear.
Other platforms
You can install Python for other platforms such as MS-DOS, OS2 or Solaris from the
Python website, https://www.python.org/download/other/
Alternative Python implementations
The standard distribution of Python (available on python.org) is developed in C
Language and is often called CPython. This recommended standard is tweaked to
optimise its performance for specific applications. These implementations combine
ease of development of Python and rich libraries of other platforms such as .net or
Java. Some such alternative implementations are:
● l IronPython (Python running on .NET framework. Developed in C#)
● l Jython (Developed in Java. Python running on the Java Virtual Machine.
Capable
11
ARJUN DAHIYA(18001007005) 12
of using rich Java library in Python program)
● l PyPy (A fast python implementation with a JIT compiler)
● l Stackless Python (Branch of CPython supporting microthreads)
● l MicroPython (Python running on micro controllers)
Commercial distributions of Python
While community versions are open source and intended to use on as is basis,
commercial versions of Python ensure guarantee of service and maintenance of the
products. Also, when modules and packages are installed from repositories, it may
lead to version conflict in a community version. However, commercial versions
ensure that the distribution is self-contained and without compatibility issues. Some of
the commercial distributions of Python include:
● l ActiveState ActivePython (commercial and community versions, including
scientific computing modules)
● l pythonxy (Scientific-oriented Python Distribution based on Qt and Spyder)
● l winpython (WinPython is a portable scientific Python distribution for Windows)
● l Enthought Canopy (a commercial distribution for scientific computing)
● l PyIMSL Studio (a commercial distribution for numerical analysis )
● l Anaconda Python (a full Python distribution for data management, analysis and
visualization of large data sets)
ARJUN DAHIYA(18001007005) 13
In C, C++, Java
if (X%2==0)
{
if (x%3==0)
System.out.println("divisible by 2 and 3");
else
System.out.println("divisible by 2 not divisible by 3");
}
else
{
if (x%3==0)
System.out.println("divisible by 3 not divisible by 2");
else
System.out.println("not divisible by 3 nor by 2");
}
In Python
if num%2 == 0:
if num%3 == 0:
print ("Divisible by 3 and 2")
else:
print ("Divisible by 2 not divisible by 3")
else:
if num%3 == 0:
print ("Divisible by 3 not divisible by 2")
else:
print ("Not divisible by 3 nor by 2")
2. Dynamic typing 13
ARJUN DAHIYA(18001007005) 14
In Python, a variable to be used in a program need not have prior declaration of its
name and type. You will learn details about variables in the next module.
Java is statically typed
String var;
// Variable is explicitly
declared.
var=”Hello”;
var=1234; // Not allowed because the
variable has been declared as a String.
Python is dynamically typed
var=”Hello” # Variable is NOT explicitly
declared.
var=1234 # Allowed although variable
was initially String type
3. Interpreted language
Python is an interpreter-based language. An interpreter executes one instruction at a
time. So if there is an error on line 7 of the code, it will execute instructions till line 6
and then stop. This is unlike a compiler which will not execute any of the instructions
even if there is a single error. Thus, an interpreter is useful if you are new to
programming because it allows you to see partial output of your code and identify the
error location more easily.
Java program (Compiled)
//This program will not display any of the
phrases as there is an error on line 7.
1 public class test
2{
3 public static void main(String args[])
14
ARJUN DAHIYA(18001007005) 15
4 {
5 System.out.println("Welcome to");
6 System.out.println("Python training program");
7 System.out.println(From Internshala);
8 }
9}
Python program (Interpreted)
#This program will display two
phrases but not the third phrase as
there is an error in line 3.
print ("welcome to")
print ("Python training program from")
print (Internshala)4. Extensible language
Python extension modules implement new built-in object types and can call C
libraries and system calls which Python doesn’t have direct access to.
ARJUN DAHIYA(18001007005) 16
Keywords in Python
'False'
'elif'
'lambda'
'None'
'else'
'nonlocal'
'True'
'except'
'not'
'and'
'finally'
'or'
'as'
'for'
'pass'
'assert'
'from'
'raise'
'break'
'global'
'return'
'class'
'if'
'try'
'continue' 16
ARJUN DAHIYA(18001007005) 17
'import'
'while'
'def'
'in'
'with'
'del'
'is'
'yield'
17
ARJUN DAHIYA(18001007005) 18
SCOPE OF PYTHON
Python has consistently ranked in the top ten most popular programming languages in
the TIOBE Programming Community Index where, as of February 2020, it is the
third most popular language (behind Java, and C). It was selected Programming
Language of the Year in 2007, 2010, and 2018.
Large organisations that use Python include Wikipedia, Google,
Yahoo!, CERN, NASA, Facebook, Amazon, Instagram, Spotify and some smaller
entities like ILM and ITA. The social news networking site Reddit is written entirely in
Python.
VARIABLES IN PYTHON
What are variables in python?
A python variable is a reserved memory location to store values. This means that when
you create a variable you reserve some space in memory.
Every value in python has a datatype.
Variables can be declared by any name or even alphabets like a, aa, abc, etc.
18
ARJUN DAHIYA(18001007005) 19
Numeric
Any representation of data which has numeric value. Python identifies three types of
numbers – integer, float and complex number.
We have three numeric data types – integer, float and complex. Let’s see how we can
use arithmetic operators on these data objects.
ARJUN DAHIYA(18001007005) 20
>>> c
31
Example 2
>>> a=-21
>>> b=10
>>> c=a+b
>>> c
-11
Subtracts the operand on the right from the operand on the left.
Example 1
>>> a=21
>>> b=10
>>> c=a-b
>>> c
11
Example 2
>>> a=-21
>>> b=10
>>> c=a-b
>>> c
-31
20
ARJUN DAHIYA(18001007005) 21
ARJUN DAHIYA(18001007005) 22
>>> c
-2.1
Returns the remainder of division of the operand on the left by the operand on the right
of the operator.
Example 1
>>> a=21
>>> b=10
>>> c=a%b
Example 2
>>> a= -21
>>> b=10
>>> c=a%b>>> c
1
>>> c
9
Note: In Python, the modulus is calculated towards negative infinity. Thus, 21%10 is 1
because the closest
multiple of 10 towards negative infinity is 20. But -21%10 is 9 because the closest
multiple of 10 towards
negative infinity is -30 and -30+9 is -21.
22
ARJUN DAHIYA(18001007005) 23
Calculates the value of the operand on the left raised to operand on the right of the
operator.Example 1
>>> a=4
>>> b=3
>>> c=a**b
>>> c
64
Example 2
>>> a=-4
>>> b=3
>>> c=a**b
>>> c
-64
Returns the quotient in which the digits after the decimal point are removed. But if one
of the operands is negative, the result is floored, i.e.,
rounded away from zero (towards negative infinity).
Example 1
Example 2>>> a=9
>>> b=5
23
ARJUN DAHIYA(18001007005) 24
>>> c=a//b
>>> c
1
Explanation: 9/5 = 1.8. So the floor division result
removes the 8 and returns 1.
>>> a=-9
>>> b=5
>>> c=a//b
>>> c
-2
Explanation: -9/5 = -1.8. However, the floor division rounds
this away from 0 and makes it -2
Integer
Positive and negative whole numbers.
Float
24
ARJUN DAHIYA(18001007005) 25
Real numbers with a floating point representation in which the fractional component is
denoted by a decimal or scientific notation
Complex number
A number with a real and imaginary component is represented as a + bj inPython
where a and b are floats and j = √-1
Boolean
Any representation of data which has two values denoted by True and False.
Sequence
An ordered collection of similar or different data types. The built-in Sequence data
types in Python are – String, List and Tuple.
String
A collection of one or more characters put in single, double or triple quotes.
List
25
ARJUN DAHIYA(18001007005) 26
An ordered collection of one or more data items, not necessarily of same type, put in
square brackets.
Tuple
An ordered collection of one or more data items, not necessarily of same type put in
parentheses. The contents of a tuple cannot be modified – it is immutable - after the
tuple is created.
Dictionary
An unordered collection of data in key:value pair form. Collection of such pairs is
enclosed in curly brackets.
26
ARJUN DAHIYA(18001007005) 27
Summary of Python 3's built-in type
Type Mutability Description Syntax examples
True
bool immutable Boolean value
False
bytearray(b'Some ASCII')
Sequence of
bytearray mutable bytearray(b"Some ASCII")
bytes
bytearray([119, 105, 107, 105])
b'Some ASCII'
Sequence of
bytes immutable b"Some ASCII"
bytes
bytes([119, 105, 107, 105])
Complex
number with
complex immutable real and 3+2.7j
imaginary
parts
Associative
array (or
dictionary) of
key and value
pairs; can
{'key1': 1.0, 3: False}
dict mutable contain mixed
{}
types (keys
and values),
keys must be
a hashable
type
An ellipsis
placeholder to
...
ellipsisa immutable be used as an
Ellipsis
index in
NumPy arrays
Double
precision
floating point
number. The
precision is
machine
dependent but
float immutable in practice is 1.414
generally
implemented
as a 64-bit
IEEE 754
number with
53 bits of
precision[89]
27
s
ARJUN DAHIYA(18001007005) 28
Unordered
set, contains
no duplicates;
frozenset immutable frozenset([4.0, 'string', True])
can contain
mixed types, if
hashable
Integer of
int immutable unlimited 42
magnitude[90]
List, can
[4.0, 'string', True]
list mutable contain mixed
[]
types
An object
representing
the absence
NoneTypea immutable of a value, None
often called
null in other
languages
A placeholder
that can be
returned from
overloaded
NotImplementedType
immutable operators to NotImplemented
a
indicate
unsupported
operand
types.
A Sequence
of numbers
commonly
used for
range(1, 10)
range immutable looping
range(10, -5, -2)
specific
number of
times in for
loops[91]
Unordered
set, contains
no duplicates; {4.0, 'string', True}
set mutable
can contain set()
mixed types, if
hashable
A character 'Wikipedia'
string: "Wikipedia"
str immutable sequence of """Spanning
Unicode multiple
codepoints lines"""
28
ARJUN DAHIYA(18001007005) 29
(4.0, 'string', True)
Can contain
tuple immutable ('single element',)
mixed types
()
29
ARJUN DAHIYA(18001007005) 30
Ever since computers were invented, there has been an exponential growth
in their ability and potential to perform various tasks. In order to use
computers across diverse working domains, humans have developed
computer systems while increasing their speed, and reducing size with
respect to time.
Artificial Intelligence pursues the stream of developing the computers or
machines to be as intelligent as humans themselves. In this article we will
scrape the top layer about the concepts of artificial intelligence that will help
understand related concepts like Artificial Neural Networks, Natural
Language Processing, Machine Learning, Deep Learning, Genetic
algorithms etc. Along with this, we will also learn about its implementation in
Python. 30
ARJUN DAHIYA(18001007005) 31
In order to master the eld of Arti cial Intelligence (ai systems) and machine
learning algorithms one has to understand computer science, natural
language processing, python code, math, psychology, neuroscience, data
science, machine learning and many other elds. Start with an introductory
course in AI that will give you an overview of the eld. The course will
update you on the AI research and developments to date. Apart from this,
you can also avail hands-on experience with the AI programming of
intelligent agents like search algorithms, games and logic problems. Once
you’ve done this, you will learn about examples of AI applications today like
self-driving cars, facial recognition systems, military drones and natural
language processors
For those who are willing to venture further, the courses in Data Science,
Robotics and Machine Intelligence course will prove to be helpful. Start
with learning the fundamentals of robotics and how robots operate,
including representation of 2D and 3D spatial relationships, manipulation of
robotic arms and end to end planning of AI robot systems. In Machine
learning, you can explore unsupervised learning techniques related to data
modelling and analysis inclusive of data clustering, computer vision,
reinforcement learning, problem solving, machine learning algorithms,
image recognition, data mining, speech recognition matrix factorisation and
sequential models for order-dependent data , etc
If you are just building up interest, we would highly recommend you to start
with Arti cial Technology and get an overview of this emerging eld of
technology. In case you are unfamiliar with basic computer science and
programming, it will help to consider learning Python, R or other
programming languages which are commonly used in data analysis
31
fi
.
fi
fi
fi
fi
fi
.
fi
.
ARJUN DAHIYA(18001007005) 32
fi
s
fi
fi
ARJUN DAHIYA(18001007005) 33
Development techniques and practices. They need to be knowledgeable
both theoretically and practically about the following topics
• Software Development Life Cycl
• Modularity, OOPS, Classe
• Design Pattern
• Statistics and Mathematic
• Machine Learnin
• Deep Learning & Neural Network
• Electronics, Robotics, and Instrumentation (Not a Mandate
3. Apart from technical Skills there are also must have Business Skills one
must possess while planning on How to Become a Successful Arti cial
Intelligence Engineer. Some of these skills include
• Analytic Problem-Solvin
• Effective Communicatio
• Creative Thinkin
• Industry Knowledg
4. Now, these skills can either be achieved through practice or by opting for
a Master’s Degree. As AI is a newly emerging topic in today’s world, a lot of
recent discoveries and research is going on which can be useful for your
thesis. Going for a Master’s Degree in Data Science, Machine Learning or
Computer Science is advised
Another Option is to go for Industry Certi cations for Machine Learning,
Deep Learning or Data Science. This will add a lot of value to your resume
and will help you get in-depth knowledge of topics both theoretically and
practically. Which will, in turn, help you get an edge over other competitors
Skills Require
In the roadmap of How to Become an Arti cial Intelligence Engineer, we saw
some Technical and Business Skills required. Let’s have a closer look at
those skills. Starting with Technical Skills
Technical Skill
• Programming Languages (R/Java/Python/C++)
One needs to be good at programming languages and not only that it’s
important to have a solid understanding of classes and data structures
33
fi
fi
:
fi
.
ARJUN DAHIYA(18001007005) 34
• Linear Algebra/Calculus/Statistics
You’ll need to be intimately familiar with matrices, vectors, and matrix
multiplication. If you have an understanding of derivatives and integrals, you
should be in the clear. Statistics is going to come up a lot
34
ARJUN DAHIYA(18001007005) 35
At least make sure you’re familiar with Gaussian distributions, means, and
standard deviations. You need to have a rm understanding of Probability to
understand models lik
• Naive Bayes
• Gaussian Mixture Models an
• Hidden Markov Model
All this math might seem intimidating at rst if you’ve been away from it for a
while. Yes, Machine Learning and Arti cial Intelligence is much more math-
intensive than something like front-end development
35
fi
s
fi
fi
fi
.
ARJUN DAHIYA(18001007005) 36
So it’s necessary to have good control over libraries like Gensim, NLTK, and
techniques like word2vec, Sentimental Analysis, and Summarization
We need Machine Learning for tasks that are too complex for humans to
code directly, i.e. tasks that are
36
so complex that it is impractical. Neural
ARJUN DAHIYA(18001007005) 37
networks have been by far the most accurate way of approaching many
problems, like Translation, Speech Recognition, and Image Classi cation,
which plays a very important role in the AI department
Apart from these Technical Skills, there are certain Non-Technical skills or
Business Skills that are also reqiired to become one Successful AI Engineer.
So, let’s continue this How to Become an Arti cial Intelligence Engineer
article to understand what exactly do I mean by Non-Technical Skills
Business/Non-Technical Skill
• Communication
fi
s
fi
.
fi
.
ARJUN DAHIYA(18001007005) 38
AI Engineers must look at the numbers, trends, and data and come to new
conclusions based on the ndings. Questioning established business
practices and brainstorming new approaches to AI
Whether you look at the rise of AI will excitement or trepidation, the robots
are here to stay in one form or another. Combining this new technology with
the strongest traits of the uniquely human mind offers a world of potential
that has yet to be fully explored
• Rapid Prototyping
38
fi
.
ARJUN DAHIYA(18001007005) 39
Iterating on ideas as quickly as possible is mandatory for nding one that
works. In machine learning, this applies to everything from picking the right
model, to working on projects such as A/B testing. You need to do a group
of techniques used to quickly fabricate a scale model of a physical part or
assembly using three-dimensional computer-aided design, especially while
working with 3D models
• Industry Knowledge
The most successful Arti cial Intelligence projects out there are going to be
those that address real pain points. Whichever industry you’re working for.
You should know how that industry works and what will be bene cial for the
business
If an Arti cial Intelligence Engineer does not have business acumen and the
know-how of the elements that make up a successful business model, all
those technical skills cannot be channeled productively
Now, with these Skills, one can surely land a Job as an Arti cial Intelligence
Engineer, but once you are working you need to also know what exactly
you’ll be doing in the day to day life. So here are the key Roles and
Responsibilities of an AI Engineer
39
fi
.
fi
.
fi
fi
fi
ARJUN DAHIYA(18001007005) 40
40
ARJUN DAHIYA(18001007005) 41
Machine Learning
Machine learning (ML) is a type of artificial intelligence (AI) that allows
software applications to become more accurate at predicting outcomes
without being explicitly programmed to do so. Machine
learning algorithms use historical data as input to predict new output values.
Recommendation engines are a common use case for machine learning.
Other popular uses include fraud detection, spam filtering, malware threat
detection, business process automation (BPA) and predictive maintenance.
Types of machine learning
Classical machine learning is often categorised by how an algorithm learns
to become more accurate in its predictions. There are four basic
approaches: supervised learning, unsupervised learning, semi-supervised
learning and reinforcement learning. The type of algorithm a data scientist
chooses to use depends on what type of data they want to predict.
• Supervised learning. In this type of machine learning, data scientists
supply algorithms with labeled training data and define the variables
they want the algorithm to assess for correlations. Both the input and
the output of the algorithm is specified.
• Unsupervised learning. This type of machine learning involves
algorithms that train on unlabelled data. The algorithm scans through
data sets looking for any meaningful connection. Both the data
algorithms train on and the predictions or recommendations they
output are predetermined.
• Semi-supervised learning. This approach to machine learning
involves a mix of the two preceding types. Data scientists may feed an
algorithm mostly labeled training data, but the model is free to explore
the data on its own and develop its own understanding of the data set.
• Reinforcement learning. Reinforcement learning is typically used to
teach a machine to complete a multi-step process for which there are
clearly defined rules. Data scientists program an algorithm to complete
a task and give it positive or negative cues as it works out how to
complete a task. But for the most part, the algorithm decides on its own
what steps to take along the way.
41
ARJUN DAHIYA(18001007005) 42
42
I
fi
ARJUN DAHIYA(18001007005) 43
How ML Works
43
ARJUN DAHIYA(18001007005) 44
So what are the options in front of you when you complete your Python learning? Here
are a few job roles that you can fill:
Python developer:
This is one of the most direct jobs that you can expect to land after acquiring this skill.
The stats that we shared in the last section clearly tell you that you will always have
open Python developer positions to fill. What does a Python developer do? Here are a
few key responsibilities:
1. Build websites
2. Resolve problems related to data analytics
3. Write codes that are both reusable and efficient
4. Optimise data algorithms
5. Implement data protection and security
44
ARJUN DAHIYA(18001007005) 45
Data analyst:
This is a very interesting opportunity. It is especially for those who like working with
huge amounts of data and finding meaning in that data. This is again a very popular job
role. There are many companies that are looking for people who can work with the
large sets of data that they have access to. These companies are looking for people
skilled in Python because Pandas, SciPy, and other Python libraries come in very
handy in accomplishing this task. No wonder more and more companies are looking for
data analysts with experience in python to fill open positions.
Product manager:
Product managers have a very important role to play when it comes to helping
businesses to understand the market and why building one product will be better than
building another. They study the market, research for new features related to a
particular product or category, and advocate the building of certain products with facts.
Data is a very important part of the work they do. This is why most companies today
are looking for product managers that are skilled in python.
fi
fi
fi
ARJUN DAHIYA(18001007005) 46
The eld of machine learning and arti cial intelligence requires experience
with multiple programming languages including Java, C, Python Training ,
R, JavaScript and SQL and experience in data science serves as a big
plus. Some of the top job positions out there in the industry include Arti cial
Intelligence Engineer, AI Project Manager, Researcher and Arti cial
Intelligence Consultant with top companies like Amazon, Google, Apple and
IBM constantly scouting for talent
46
fi
.
fi
fi
fi