You are on page 1of 17

KLS’s VISHWANATHRAO DESHPANDE INSTITUTE OF

TECHNOLOGY, HALIYAL.

DEPT. OF ELECTRONICS AND COMMUNICATION ENGINEERING

Internship Seminar on
“PYTHON AND MACHINE LEARNING”

Presented by
- Milagrin Dsouza
WORLDCLOCK TECHNOLOGIES

'WorldClock Technologies' located at Bangalore is a professional IT services firm specialized


in information technology services and outsourcing. Their area of expertise includes Web
Application development, Mobile Application development, QA and Testing ,animation
development. 
INTRODUCTION TO PYTHON:
Python was conceived in the late 1980’s by Guido Van Rossum at

CWI in Netherlands as a successor to the ABC Language ,capable of

exception handling and interfacing with the Ameoba operating system.

Its implementation began in December 1989.

Why Python???....

•Extensive supporting libraries.


•Open Source and Community Development.
• Learning ease and support available.
• User-friendly Data Structure ,Productivity and speed.

Python operators:
1.Arithmetic operators: +, - , * , / ,% ,** ,// .
2.Assignment operator: = ,+= ,-= ,*= ,/= , %=.
3.Comparison operator: > ,>=, <, <=,==.
4.Logical operator: and, or, not.
5.Bitwise operator: & , | , ^.
6.Membership operator: in , not in .
7.Identity operator: is , is not.
DATATYP
ES

IMMUTABLE MUTABLE

DICTI
NUM STRI TUP ONAR SET
LIST
BER NG LE Y S
FILE

TEXT BINARY

FILE OPERATION

CREATE DELETE UPDATE DELETING


MODES OF OPENING FILE
• ‘r’:(Read) –default value. Opens file for reading.
• ‘a’:(Append) -Opens file for appending. Creates file if doesnot exist.
• ‘w’:(Write) –Opens a file for writing. Deletes the content if file already exists.
• ‘x’:(Create) –Creates the specified file ,returns error if file already exists.

REGULAR EXPRESSION
A sequence of symbols and characters expressing a string or pattern to be
searched for within a longer piece of text.

Ex: [a-zA-z], \d+[\+-x\*]\d+ .


Projects:
1. After the five days of training on basics of python,by the knowledge gained
I could build two small projects one of which performed simple addition
subtraction, multiplication , division and equality depending on the operator
given out of(+,-,*,/,=).
2.The second project is where we used a python module called ludo.cli to
create a ludo game which created a gui where clicking the enter key acted

as a dice rolling.
Machine Learning
The concepts of Machine Learning which we learnt during training are as below

Python Modules:
• Numpy is a library for the python programming language, adding support for large,
multidimensional arrays and matrices, along with the high level mathematical
functions to operate on these arrays.

• Pandas is the most popular python library that is used for data manipulation and data
analysis.It offers data structures and operations for manipulating numerical tables .

• Pandas has two core objects: DataFrame and Series.


• A DataFrame is a table. It contains an array of individual entries, each of which has
certain value. A series is, in essence a single column of a dataframe. Here we created
the DataFrames by importing the pandas library.
Matplotlib basics
• A picture is worth a thousand word and with python’s matplotlib library, its
less than a thousand lines of code to create a product quality graphics.

• Here we imported the matplotlib and used plt as its alias and plotted the
different kind of graphs like bar graphs, pie charts etc representing some
dataset .

a)bar graph using matplotlib (b)pie chart using matplotlib


Supervised learning and Unsupervised learning
introduction
• In this topic we learnt about the supervised and unsupervised algorithm
concepts.Why they are used and how do the algorithm is applied into action on AI
machine.

• In Supervised learning the algorithm analysis the training data given to it and
produces an inferred function which can be used for mapping new examples.

• KNN algorithm-The first machine learning algorithm, simplest of all supervised


learning. It simply calculates the distance of a new datapoint to all other training
data points. It then selects K-nearest data points where K can be any integer.
Finally it assigns the data point to the class to which the majority of the K
datapoints belong.
a)plot for dataset with two variables b) new data point

Our task is to classify a new data point with 'X' into "Blue" class or "Red"
class. The coordinate values of the data point are x=45 and y=50. Suppose the
value of K is 3. The KNN algorithm starts by calculating the distance of point
X from all the points. It then finds the 3 nearest points with least distance to
point X.
This is shown in the fig(b) above. The three nearest points have been
encircled. The final step of the KNN algorithm is to assign new point to the
class to which majority of the three nearest points belong. From the figure
above we can see that the two of the three nearest points belong to the class
"Red" while one belongs to the class "Blue". Therefore,the new data point will
be classified as "Red".

Unsupervised learning is the training of an algorithm using the information


that is neither classified nor labelled and allowing the algorithm to act
accordingly without the guidance.

Here the AI system is presented with the unlabelled, uncategorised data


and the system’s algorithms act on the data without prior training.
The output is dependent on coded algorithm. Subjecting system to unsupervised
learning can be one of the way to test the AI.

Overfitting and underfitting model


Overfitting means our model much better on the training set than on the test
set. It fits the training data too well and generalises bad. Overfitting is caused
due to too powerful model, not enough data or due to too many features.
The green line represents an overfitted model and the black line represents a
regularized model. While the green line best follows the training data, it is too
dependent on that data and it is likely to have a higher error rate on new
unseen data, compared to the black line.

Underfitting refers to a model that can neither model the training data nor
generalize to new data. An underfit machine learning model is not a suitable
model and will be obvious as it will have poor performance on the training
data.  An underfitted model results in problematic or erroneous outcomes on
new data, or data that it wasn’t trained on.
THANK YOU…

You might also like