Recommender System With Sentiment Analysis: Summer Internship Report

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 58

Recommender System with Sentiment Analysis

A SUMMER INTERNSHIP REPORT

On

(Online Internship)

Submitted by

Bhargav Dobariya (190320132014)


(2022-2023)
Brainy beam Technologies Pvt. Ltd.
Mentor: Sagar Jasani

In fulfilment for the award of degree


of Bachelor of Engineering in Information & Communication Technology

INFORMATION & COMMUNICATION TECHNOLOGY DEPARTMENT


L. J. INSTITUTE OF ENGINEERING AND TECHNOLOGY
GUJARAT TECHNOLOGICAL UNIVERSITY
AHMEDABAD
YEAR, 2021-22

I
L. J. INSTITUTE OF ENGINEERING AND TECHNOLOGY

INFORMATION & COMMUNICATION TECHNOLOGY DEPARTMENT


YEAR, 2021-22

CERTIFICATE
This is to certify that the Summer Internship “Recommender System with Sentiment
Analysis” submitted by Bhargav Dobariya, towards the fulfillment of the requirements for
the degree of Bachelor of Engineering in Information & Communication Technology of L.J.
Institute of Engineering and Technology, Ahmedabad, under the Gujarat Technological
University, Ahmedabad is the record of work carried out by him/her under my supervision
and guidance. In my opinion, the submitted work has reached a level required for being
accepted for examination. The results embodied in this project, to the best of my knowledge,
haven’t been submitted to any other university or institution for award of any degree or
diploma.

Prof. Bhautik Trivedi Prof. Prayag Patel


(Name of Guide) (HOD - IT/ICT)

II
Student’s Declaration

I hereby declare that the Summer Internship Project Report titled


“Dobariya Bhargav Virendra Kumar” in Brainy beam Technologies Pvt. Ltd. is a result
of my own work and my indebtedness to other work publications, references, if any, have
been duly acknowledged. If I am found guilty of copying from any other report or published
information and showing as my original work, or extending the plagiarism limit, I understand
that I shall be liable and punishable by the university, which may include Failing me in
examination or any other punishment that university may deem fit.

Enrolment no. Name Signature


Dobariya Bhargav
190320132014 Virendra Kumar

Place: Ahmedabad Date:

III
Internship Information
Joining Letter

IV
Completion Certificate

V
INDEX

Sr. No Index Page

1 Acknowledgment VII

2 Abstract VIII

3 Table of Contents IX

4 List of Figures X

5 List of Tables XI

VI
ACKNOWLEDGEMENT

I would like to express my deepest gratitude to all those who provided me the
possibility to the completion of the internship. Special gratitude of thanks I give
to our Assistant Professor, Prof. Bhautik Trivedi, whose contribution in
stimulating suggestions and encouragement, helped me to coordinate the
internship especially in drafting this report.

Furthermore, I would also like to acknowledge with much appreciation the crucial
role of the Head of Department, who gave the permission to use all required
equipment and the necessary material to fulfill the task. Last but not the least,
many thanks goto the teachers and my friends and families who have invested
their full effort in guiding us inachieving the goal.

Also, I appreciate the guidance given by the developer at Brainy Beam, Mr. Raj
and the panels, especially for the internship that has advised me and given
guidance at every momentof the internship.

VII
ABSTRACT

Data Science and analysis is playing the most significant role today covering
every industry in the market. For e.g., finance, e-commerce, business, education,
and government.
Now organizations play a 360-degree role to analyse the behaviour and interest
of their customers to make decisions in favour of them. Data is analysed through
programming languages such as python which is one of the most versatile
languages and helps in doing a lot of things through it.
Netflix is a pure data science project that reached at the top through analysing
every single interest of their customers. Key terminology that are used in Data
Science are: Data Visualization, Anaconda Jupyter Notebook, Exploratory Data
Analysis, Machine Learning, Data wrangling, and Evaluation using scikit
library’s surprise module.

VIII
Table of Content

Chapter No. List of Contents Page No.


1 Company Background Information 12
1.1 Company Profile 12
2 System Information 13
2.1 Software Requirements 13
2.2 Hardware Requirements 13
3 Work Responsibilities/ Task 14
3.1 Day 1 14
3.2 Day 2 21
3.3 Day 3 24
3.4 Day 4 28
3.5 Day 5 32
3.6 Day 6 36
3.7 Day 7 38
3.8 Day 8 43
3.9 Day 9 45
3.10 Day 10 48
3.11 Day 11 49
3.12 Day 12 51
3.13 Day 13 53
3.14 Day 14 54
4 Skills Learned 56
5 Conclusion 57
6 References 58

IX
List of Figures

Figures Number Figures Name Page No.


2(a) Task 3 GST Program 22

3(a) Task 4 List Program 25

3(b) Task 4 Set Program 27

4(a) Task 5 Dictionaries Program 29

4(b) Task 6 Random Module Program 31

5(a) Task 7 Student Report card Program 33

5(b) Task 8 Factorial Program 35

6(a) Task 9 ATM Program 37

7(a) Task12 Meta Characters 42

8(a) Task 13 Data frame Program 43

8(b) Task 14 External & Internal library Program 44

9(a) Task 15 Password Generator Program 47

10(a) Task 16 Shape & Datatype Program 48

11(a) Task 17 Stop word Program 49

11(b) Task 18 NLTK Program 50

12(a) Task 20 Json file & Operations Program 52

13(a) Task 21 NLTK & Corpus data Program 53

13(b) Task 22 Label Encoding Program 53

14(a) Task 24 Recommendation Program 55

X
List of Tables

Table Number Table Name Page No


1.1 Python Keywords 14
1.2 Python Arithmetic Operators 15
1.3 Python Assignment Operators 16
1.4 Python Comparison Operators 17
1.5 Python Logical Operators 18
1.6 Python Identity Operators 18
1.7 Python Membership Operators 19
1.8 Python Bitwise Operators 19
7.1 Meta Characters 40

XI
190320132014 CHAPTER 2

Chapter 1 Company Background Information


1.1 Company Profile

Company Name: Brainy Beam Technologies Pvt Ltd

Address: 118, Sukan Mall, Science city road, Ahmedabad


Contact No: +91 9033237336
Email Id : sagar@brainybeam.com

Website: www.brainybeam.com

About Us

At Brainy Beam, we see Innovation as a clear differentiator. Innovation, along with focus
on deep,long-lasting client relationships and strong domain expertise, drives every facet
of our day-to-dayoperations.

Brainy Beam Technologies was founded with a vision to address growing businesses'
needs of reducing the time to market and cost effectiveness required to develop and
maintain unique and customized web and mobile solutions. We are uniquely and
strategically positioned to partner with startups and leading brands to help them expand
their business and offer the most effective and cost-efficient solutions that provide
revenues and value to their business needs.

Vision
To become the most trusted and preferred offshore IT solutions partner for Startups,
SMBs, andEnterprises through innovation and technology leadership. Understanding
your ambitious vision, honing in on its essence, creating a design strategy, and knowing
how to technically execute it is what we do best. Our promise? The integrity of your
vision will be maintained and we'll enhance it to best reach your target customers. With
our primary focus on creating amazing user experiences, we'll help you understand the
tradeoffs, prioritize features, and distill valuable functionality. It's an art form we care
about getting right.

LJIET-ICT
12 | P a g e
190320132014 CHAPTER 2

Chapter 2: System Information

Information system, an integrated set of components for collecting, storing, and processing
data and for providing information, knowledge, and digital products. Business firms and
other organizations rely on information systems to carry out and manage their operations,
interact with their customers and suppliers, and compete in the marketplace. Information
systems are used to run interorganizational supply chains and electronic markets.
The main components of information systems are computer hardware and software,
telecommunications, databases and data warehouses, human resources, and procedures.
The hardware, software, and telecommunications constitute information technology (IT),
which is now ingrained in the operations and management of organizations.

2.1 Software Requirements:


 Operating System: Windows11
 Coding Language: Python
 Text Editor: Visual Studio Code, jupyter notebook.

2.2 Hardware Requirements:


 Processor: Intel core i5.
 Memory: 8GB RAM.
 Hard Disk: 256 GB SSD.
 Refresh Rate: 144Hz.
 Graphic Card: NVIDIA GETFORCE RTX3050Ti 4Gb.

LJIET-ICT 13 | P a g e
190320132014 CHAPTER 3

Chapter 3 Work Responsibilities/ Task

||| 3.1 DAY - 1


BASIC INTRODUCTION AND DOMAIN KNOWLEDGE
Explain the workflow of the internship. Also, discuss some basicdomain knowledge.

Introduction about Field


i. Discuss some basic points about python, working of python, advantages
ofpython for working in data science.

ii. Also explained how to install and run python and jupyter notebook
andother useful tools?

Difference between Data Science, Data Analysis & Machine Learning:


i. Data Science: Use mathematical skills for get desired outcomes from data.
ii. Data Analysis: Analyzing data with different charts and tables.
iii. Machine Learning: Totally based on the mathematics used for
prediction, forbuilding models, etc.

TASK 1:
Python Keywords:

False await else import pass

None break except in raise

True class finally is return

and continue for lambda try

as def from nonlocal while

assert del global not with

async Elif if or yield

Table 1.1 Python Keywords

LJIET-ICT 14 | P a g e
190320132014 CHAPTER 3

Python Operators:
Python divides the operators in the following groups:

 Arithmetic operators
 Assignment operators
 Comparison operators
 Logical operators
 Identity operators
 Membership operators

1. Python Arithmetic Operators:

Arithmetic operators are used with numeric values to perform common mathematical
operations:

Operator Name Example

+ Addition x+y

- Subtraction x–y

* Multiplication x*y

/ Division x/y

% Modulus x%y

** Exponentiation x ** y

// Floor division x // y

Table 1.2 Python Arithmetic Operators

LJIET-ICT 15 | P a g e
190320132014 CHAPTER 3

2. Python Assignment Operators:

Assignment operators are used to assign values to variables:

Operator Example Same As

= x=5 x=5

+= x += 5 x=x+5

-= x -= 5 x=x–5

*= x *= 5 x=x*5

/= x /= 5 x=x/5

%= x %= 5 x=x%5

//= x //= 5 x = x // 5

**= x **= 5 x = x ** 5

&= x &= 5 x=x&5

|= x |= 5 x=x|5

^= x ^= 5 x=x^5

>>= x >>= 5 x = x >> 5

Table 1.3 Python Assignment Operators

LJIET-ICT 16 | P a g e
190320132014 CHAPTER 3

3. Python Comparison Operators:

Comparison operators are used to compare two values:

Operator Name Example

== Equal x == y

!= Not equal x != y

> Greater than x>y

< Less than x<y

>= Greater than or x >= y


equal to

<= Less than or equal x <= y


to

Table 1.4 Python comparison Operators

LJIET-ICT 17 | P a g e
190320132014 CHAPTER 3

4. Python Logical Operators:

Logical operators are used to combine conditional statements:

Operator Description Example

and Returns True if both x < 5 and

statements are true x < 10

or Returns True if one of x < 5 or

the statements is true x<4

not Reverse the result, returns not(x < 5

False if the result is true and

x < 10)

Table 1.5 Python Logical Operators

5. Python Identity Operators:

Identity operators are used to compare the objects, not if they are equal, but if they are
actually the same object, with the same memory location:

Operator Description Example

is Returns True if both x is y

variables are the same object

is not Returns True if both variables x is not y

are not the same object

Table 1.6 Python Identify Operators

LJIET-ICT 18 | P a g e
190320132014 CHAPTER 3

6. Python Membership Operators:

Membership operators are used to test if a sequence is presented in an object:

Description Example
Operator

in Returns True if a sequence with the specified x in y


value is present in the object

not in Returns True if a sequence with the specified x not in y


value is not present in the object

Table 1.7 Python Membership Operators

7. Python Bitwise Operators:

Bitwise operators are used to compare (binary) numbers:

Operator Name Description

& AND Sets each bit to 1 if both bits are 1

| OR Sets each bit to 1 if one of two bits is 1

^ XOR Sets each bit to 1 if only one of two bits is


1

~ NOT Inverts all the bits

<< Zero fill left shift Shift left by pushing zeros in from the
right

and let the leftmost bits fall off

Table 1.8 Python Bitwise Operators

LJIET-ICT 19 | P a g e
190320132014 CHAPTER 3

TASK 2:
Structured, semi structured, Unstructured Data:
Structured data

Structured data is information that has been formatted and transformed into a well-defined
data model. The raw data is mapped into predesigned fields that can then be extracted and
read through SQL easily. SQL relational databases, consisting of tables with rows and
columns, are the perfect example of structured data.

The relational model of this data format utilizes memory since it minimizes data
redundancy. However, this also means that structured data is more inter-dependent and less
flexible. Now let’s look at more examples of structured data.

Semi structured data

Your data sets may not always be structured or unstructured; semi-structured data or
partially structured data is another category between structured and unstructured data.
Semi-structured data is a type of data that has some consistent and definite characteristics.
It does not confine into a rigid structure such as that needed for relational databases.
Organizational properties like metadata or semantics tags are used with semi-structured
data to make it more manageable; however, it still contains some variability and
inconsistency.

Unstructured data

Unstructured data is defined as data present in absolute raw form. This data is difficult to
process due to its complex arrangement and formatting. Unstructured data management
may take data from many forms, including social media posts, chats, satellite imagery, IoT
sensor data, emails, and presentations, to organize it in a logical, predefined manner in a
data storage. In contrast, the meaning of structured data is data that follows predefined data
models and is easy to analyze. Structured data examples would include alphabetically
arranged names of customers and properly organized credit card numbers. After
understanding the definition of unstructured data, let’s look at some examples.

LJIET-ICT 20 | P a g e
190320132014 CHAPTER 3

||| 3.2 DAY – 2


TASK 3:
AIM: Build a GST calculation program with multiple
categories having different percentages.
PROGRAM:
i=0
sum=0
cat = input("Enter Category:")
if cat == "Electronic":
a=int(input("Number of Items :"))
while i<=a:
p=int(input("Enter price:"))
sum = sum + p
i+=1
print(sum)
g = sum * 0.28
print(g)
t = sum + g
print(t)
if cat == "Grocery":
a=int(input("Number of Items :"))
while i<=a:
p=int(input("Enter price:"))
sum = sum + p
i+=1
print(sum)
g = sum * 0.18
print(g)
t = sum + g
print(t)
if cat == "Medicines":

LJIET-ICT 21 | P a g e
190320132014 CHAPTER 3

a=int(input("Number of Items :"))


while i<=a:
p=int(input("Enter price:"))
sum = sum + p
i+=1
print(sum)
g = sum * 0.12
print(g)
t = sum + g
print(t)

Screenshot:

Fig. 2(a) Task 3 GST Program

LJIET-ICT 22 | P a g e
190320132014 CHAPTER 3

Output:

LJIET-ICT 23 | P a g e
190320132014 CHAPTER 3

||| 3.3 DAY – 3

TASK 4:
AIM: List out 5 methods of list, set explain them with
example.
1. List: Lists are the build-in data-types in python that are used to store
multiple items in a single variable. The data is stored in [].
2. Sets are also used to store multiple items in a single variable. In set
there is no orderand no index. Data stored between { }.
3. Dictionary: Storing of values, Ordered, changeable(mutable) , doesn’t
allow changeof values.

LIST:
Example: a= [‘Bha’,’r’,’gav’]
Lists are the build-in data-types in python that are used to store multiple items in a
single variables. The plus point of list is that the order of list does not change, and
the items in thelist are changeable (mutable) and the last point as the list allows
duplicate values too.

LIST Methods:
- . append(x): Add an item to the end of the list
- . insert (i, x): Inserting an item at a given position
- . remove(x): removing the first item from the list whose value is equal to x
- copy (): Copying of the list
- count (): Number of elements with the specified value
- reverse (): reverse the list

CODE:

#LIST = Mutable, Ordered, Repeatable characters allowed

a = ['a', 'b' ,'c' ,'d' ,'e' ,'f']

b = a[-3:-1]
print(b)

c = a[-1:-3]
print(c)

LJIET-ICT 24 | P a g e
190320132014 CHAPTER 3

SCREENSHOT:

Fig. 3(a) Task 4 List Program

SET:
- Sets are also used to store multiple items in a single variables.
- In set there is no order and no index.
- The down point of set data type is the value cannot be changed once
the set is createdimmutable
- Repetition of values are not allowed in set.
Sets Methods:
a) add(): adds element to a set
b) discard(): Removes an Element from The Set
c) union(): Returns the union of sets
d)update(): Add elements to the set
e)clear(): remove all elements from a set

LJIET-ICT 25 | P a g e
190320132014 CHAPTER 3

CODE:
# set of vowels
vowels = {'a', 'e', 'i', 'u'}
print(vowels)
# Adding 'o'
vowels.add('o')
print('Vowels are:',vowels)

#Discarding 'o'
vowels.discard('o')
print('Vowels are:',vowels)

#union
A2 = {'a', 'c', 'd'}
B2 = {'c', 'd', 2 }
print('A U B =', A2.union(B2))

#update
A3 = {'a', 'b'}
B3 = {1, 2, 3}
result = A3.update(B3)
print('A =', A3)

#clear vowels.clear()
print('Vowels (after clear):', vowels)

LJIET-ICT 26 | P a g e
190320132014 CHAPTER 3

SCREENSHOT:

Fig. 3(b) Task 4 Set Program

LJIET-ICT 27 | P a g e
190320132014 CHAPTER 3

||| 3.4 DAY – 4

TASK 5:
AIM: List out 5 methods of dictionary explain them with
example.
Dictionaries:
- Storing of values
- Ordered , changeable(mutable) , doesn’t allow

change of values

Dictionary Methods:

a) get() - Returns the value of the specified key


b) items() - Returns a list containing a tuple for
each key value
c) pairkeys() - Returns a list containing the
dictionary's keys
d) pop() - Removes the element
with the specified key
e) popitem() - Removes the last
inserted key-value pair

CODE:
#get()
person = {'name': 'Jainish', 'age': 21}
print('Name: ', person.get('name'))
print('Age: ', person.get('age'))
#items()
print(person.items())
#keys
print(person.keys())
#setdefault()
age = person.setdefault('age')
print('person = ',person)
print('Age = ',age)
#values()

LJIET-ICT 28 | P a g e
190320132014 CHAPTER 3

print(person.values())
#clear()
person.clear()
print(person)

SCREENSHOT:

Fig. 4(a) Task 5 Dictionaries Program

LJIET-ICT 29 | P a g e
190320132014 CHAPTER 3

TASK 6:

Aim: Random module functions with explanation.


Random module:
1. Random module in python is used to generate pseudo-random variables.
2. It can generate random numbers as well as can select elements randomly from the
list.
3. It can also shuffle elements of the specified list.
4. Following is the example of random module functions and their usage are shown in
task3a.py

Code:

import random as r
print(
"Random Float: ", r.random()
) # it will return random float value between 0.0 & 1.0
print(
"Random Integer: ", r.randint(50, 150)
) # it will print random integer value between specified integers
print(
"Random Range: ", r.randrange(11, 111, 11)
) # it will return an element randomly and it contains arguments (start,stop,step)
print(
"Random Choice: ", r.choice("element to be selected from here")
) # it will choose an element from specified string or variable
a = ["s", "h", "u", "f", "f", "l", "e"]
r.shuffle(a)
print("Random Shuffle: ", a) # it will shuffle the given list

LJIET-ICT 30 | P a g e
190320132014 CHAPTER 3

Output

SCREENSHOT:

Fig. 4(b) Task 6 Random module Program

LJIET-ICT 31 | P a g e
190320132014 CHAPTER 3

||| 3.5 DAY – 5

TASK 7:
AIM: Build a student report card program which can take subject,
marks as input and return the sum of marks of students using functions.
PROGRAM:

def student():
s=int(input("How many Students:"))
stu_name(s)

def stu_name(x):
i=1
n=[]
while i<=x:
name=input("Enter name:")
sub=int(input("How many Subjects:"))
marks(sub)
n.append(name)
i=i+1
return n
def marks(z):
i=1
t=0
while i<=z:
m=int(input("Enter marks:"))
t=t+m
i=i+1
print(t)
student()

LJIET-ICT 32 | P a g e
190320132014 CHAPTER 3

Output:

SCREENSHOT:

Fig. 5(a) Task 7 Student Report card Program

LJIET-ICT 33 | P a g e
190320132014 CHAPTER 3

TASK 8:
AIM: Build a program to find factorial, prime and odd even from user
input.
PROGRAM:
from math import factorial
i = int(input("Enter Number:"))
a=i
#Factorial
fact=1
if i == 0:
print("Factorial Of 0 is 1")
elif i<0:
print("Factorial does'nt exist for negative number")
else:
while(i>0):
fact=fact*i
i=i-1
print("Factorial=",fact)
#Prime
if (a<=1):
print(a,"Not a Prime number.")
else:
for n in range(2,a):
if (a%n) == 0:
print(a,"is not a Prime number.")
break
else:
print(a,"is a Prime number.")
#Odd-Even
if(a%2==0):
print(a,"is Even")

LJIET-ICT 34 | P a g e
190320132014 CHAPTER 3

OUTPUT:

SCREENSHOT:

Fig. 5(b) Task 8 Factorial Program

LJIET-ICT 35 | P a g e
190320132014 CHAPTER 3

||| 3.6 DAY – 6


TASK 9:
AIM: Build an ATM program containing deposit and
withdraw functions with validations and loop using class.
PROGRAM:
class ATM():
balance = 1000
def balance(self,balance):
self.balance=balance
return self.balance
def deposite(self):
d = int(input("Enter amount for deposit:"))
self.balance+=d
return self.balance
def withdraw(self):
w = int(input("Enter amount for withdraw:"))
if self.balance-w <= 0:
return "Not sufficient balance."
self.balance-=w
return self.balance
obj=ATM()
print('1.check balance,2.deposite,3.withdraw')
while True:
c = int(input("Enter Choice:"))
if c==1:
print(obj.balance(1000))
elif c==2:
print(obj.deposite())
elif c==3:
print(obj.withdraw())
else:

LJIET-ICT 36 | P a g e
190320132014 CHAPTER 3

print("Enter proper choice")


break

OUTPUT:

SCREENSHOT:

Fig. 6(a) Task 9 ATM Program

LJIET-ICT 37 | P a g e
190320132014 CHAPTER 3

||| 3.7 DAY – 7


TASK 10:

AIM: List out 5 inbuilt libraries of python and use their 3 methods.
1. Pandas: It is an open source library which is widely used in data
science. Pandas are used for the analysis, manipulation, and cleaning
of data.
2. NumPy: It is defined as ‘Numerical Python’. It is used for
mathematical operations.
3. Matplotlib: This library is used for plotting numerical data used in
data analysis and publishing high-quality figures like graphs, pie
charts, scatterplots, histograms, etc.
4. SciPy: It is defined as ‘Scientific Python’. SciPy is an open-source
python library used for scientific computation, data computation, and
high-performance computation.
5. Beautiful Soup: Beautiful Soup is a library used for the extraction and
collection of information from websites.

TASK 11:
AIM: Explain pandas applications and list out at least 5
methods of pandas and explain them with example.
1. Economics: Economics is in constant demand for data analysis. Analysing data to
form patterns and understanding trends about how the economy in various sectors
is growing, is something very essential for economists. Therefore, a lot of
economists have started using Python and Pandas to analyse huge datasets. Pandas
provide a comprehensive set of tools, like datagrams and file-handling. These
tools help immensely in accessing and manipulating data to get the desired results.
Through these applications of Pandas, economists all around the world have been
able to make breakthroughs like never before.

2. Recommendation Systems: We all have used Spotify or Netflix and been appalled
at the brilliant recommendations provided by these sites. These systems are
a miracle of Deep Learning. Such models for providing recommendations are one
of the most important applications of Pandas. Mostly, these models are made in
python and Pandas being the main libraries of python, used when handling data in
such models. We know that Pandas are best for managing huge amounts of data.
And the recommendation system is possible only by learning and handling huge
masses of data. Functions like group By and mapping help tremendously in
making these systems possible.

3. Stock Prediction: The stock market is extremely volatile. However, that doesn’t
mean that it cannot be predicted. With the help of Pandas and a few other libraries

LJIET-ICT 38 | P a g e
190320132014 CHAPTER 3

like numpy and matplotlib, we can easily make models which can predict how the
stock markets turn out. This is possible because there is a lot of previous data of
stocks which tells us about how they behave. And by learning these data of stocks,
a model can easily predict the next move to be taken with some accuracy. Not only
this, but people can also automate buying and selling of stocks with the help of
such prediction models.

4. Statistics: Pure math’s itself has made much progress with the various applications
of Pandas. Since Statistic deals with a lot of data, a library like Pandas which deals
with data handling has helped in a lot of different ways. The functions of mean,
median and mode are just very basic ones which help in performing statistical
calculations. There are a lot of other complex functions associated with statistics
and pandas plays a huge role in these so as to bring perfect results.

5. Analytics: Analytics has become easier than ever with the use of Pandas. Whether
it is website analytics or analytics of some other platform, Pandas do it all, with
its amazing data manipulation and handling capabilities. The visualization
capabilities of pandas play a big role too in this field. It not only takes in data and
displays it but also helps in applying a lot of functions over the data.

6. Natural Language Processing: NLP or Natural Language processing has taken the
world by a storm and it is creating a lot of buzzes. The main concept is to decipher
human language and several nuances related to it. This is very difficult, but with
the help of the various applications of Pandas and Scikit-learn, it is easier to create
an NLP model which we can be improved continuously with the help of various
other libraries and their functions.

Methods of Pandas: -

1. df=pd.read_csv(‘abc.csv’)

a. This function is used to read a CSV file to a pandas DataFrame format.

2. df.columns

a. When you have a big dataset like that it can be hard to see all the columns.
using . columns function, you can print out all the columns of the dataset:

3. df.drop()

a. We can drop unnecessary columns using df.drop().

4. df.insert()

a. Using this function we can insert a column in the specific position.

LJIET-ICT 39 | P a g e
190320132014 CHAPTER 3

5. .len()

a. This function provides the length of the DataFrame.

TASK 12:

AIM: List out at least 10 meta characters and use them in pattern for
email and phone number validation.

Metacharacter Description Example

[] It represents the set of characters. "[a-z]"

\ It represents the special sequence. "\r"

. It signals that any character is present at some "Ja.v."


specific place.
^ It represents the pattern present at the "^Java"
beginning of the string.
$ It represents the pattern present at the end of "point"
the string.
* It represents zero or more occurrences of a "hello*"
pattern in the string.
+ It represents one or more occurrences of a "hello+"
pattern in the string.
{} The specified number of occurrences of a "java{2}"
pattern the string.
| It represents either this or that character is "java|point"
present.
() Capture and group (javatpoint)
Table 7.1 Meta Characters

LJIET-ICT 40 | P a g e
190320132014 CHAPTER 3

PROGRAM:

import re

for i in range(3):

ip1=input("Enter email address: ")

email_val='^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'

email_match=re.match(email_val, ip1)

if email_match:

print("match")

ip2=input("enter number: ")

num_val='[0-9]{10}'

num_match=re.match(num_val, ip2)

if num_match:

print("number valid")

else:

print("number invalid")

break

else:

continue

Output:

LJIET-ICT 41 | P a g e
190320132014 CHAPTER 3

Screenshot:

Fig. 7(a) Task 12 Meta Characters

LJIET-ICT 42 | P a g e
190320132014 CHAPTER 3

||| 3.8 DAY – 8


TASK 13: -
AIM: Convert multiple Series to Data frame, and find the
shape and datatype of each column.

Program:

Fig. 8(a) Task 13 Data frame Program

LJIET-ICT 43 | P a g e
190320132014 CHAPTER 3

TASK 14:
AIM: Use any external library and inbuilt library in one
python program with user input.
PROGRAM:
import math
from math import sqrt,sin
A=int(input("Enter a number to find its Square Root: "))
B=int(input("Enter a number to find its sine value: "))
print(sqrt(A))
print(math.sin(math.radians(B)))

OUTPUT:

Screenshot:

Fig. 8(b) Task 14 External & Internal Library Program

LJIET-ICT 44 | P a g e
190320132014 CHAPTER 3

||| 3.9 DAY – 9

TASK 15:
Aim: Build a password generator program containing numbers,
alphabets and characters.
PROGRAM:
import random
lsn = [1, 2]
le = int(input("Enter Length: "))
lec = -1
le1 = -1
le2 = -1
leo = -1
le3 = -1
le4 = -1
if random.choice(lsn) == 1:
lec = le // 2
leo = le - lec
else:
leo = le // 2
lec = le - leo
if random.choice(lsn) == 1:
le1 = lec // 2
le2 = lec - le1
else:
le2 = lec // 2
le1 = lec - le2
if random.choice(lsn) == 1:
le3 = leo // 2
le4 = leo - le3
else:
le4 = leo // 2

LJIET-ICT 45 | P a g e
190320132014 CHAPTER 3

le3 = leo - le4


lsc1 = list("qwertyuiopasdfghjklzxcvbnm") * le1
lsc2 = list("qwertyuiopasdfghjklzxcvbnm".upper()) * le2
lss = list("!\]|[/?.,~`-=\";:><@#$%{}&*()_+'") * le3
lsnu = list("123/67890") * le4

password =
( random.sample(lsc1,
le1)
+ random.sample(lsc2, le2)
+ random.sample(lss, le3)
+ random.sample(lsnu, le4)
)
random.shuffle(password)
OUTPUT:
print("Password Generated: " + "".join(password))

LJIET-ICT 46 | P a g e
190320132014 CHAPTER 3

SCREENSHOT:

Fig. 9(a) Task 15 Password Generator Program

LJIET-ICT 47 | P a g e
190320132014 CHAPTER 3

||| 3.10 DAY – 10

TASK 16:
AIM: Convert multiple Series to Data frame, and find the
shape and datatype of each column.

PROGRAM:

Fig. 10(a) Task 16 shape & Datatype Program

LJIET-ICT 48 | P a g e
190320132014 CHAPTER 3

||| 3.11 DAY – 11

TASK 17:

AIM: Clear the Text using stop words and re from


Feedback column.

Fig. 11(a) Task 17 Stop word Program

LJIET-ICT 49 | P a g e
190320132014 CHAPTER 3

TASK 18:
AIM: Download and use the nltk packages and corpus
data with example.
PROGRAM:

Fig. 11(b) Task 18 NLTK Program

LJIET-ICT 50 | P a g e
190320132014 CHAPTER 3

||| 3.12 DAY – 12

TASK 19:
AIM: Explanation TF IDF Text Vectorization with
equation.

 TF-IDF Vectorization
It helps us in dealing with most frequent words. Using it we
can penalize them. Tf-idf Vectorizer weights the word counts
by a measure of how often they appear in the documents.

 TF-IDF
The term frequency(i.e.,tf) for cat is then(3/100) = 0.03. Now,
assume we have 10 million documents and the word cat
appears in one thousand of these. Then the inverse document
frequency(i.e.,idf) is calculated as log(10,000,000/1,000)=4.

LJIET-ICT 51 | P a g e
190320132014 CHAPTER 3

TASK 20:
AIM: Load data from json file and find total words and
sentences from that.
PROGRAM:

Fig. 12(a) Task 20 Json file & Operations Program

LJIET-ICT 52 | P a g e
190320132014 CHAPTER 3

||| 3.13 DAY – 13


TASK 21:
AIM: Download and use the nltk packages and corpus data with example.

Fig. 13(a) Task 21 Nltk & Corpus data Program


TASK 22:
AIM: Use Label encoding on user id and product id in dataset.
PROGRAM:

Fig. 13(b) Task 22 Label Encoding Program

LJIET-ICT 53 | P a g e
190320132014 CHAPTER 3

||| 3.14 DAY – 14

TASK 23: -
AIM: Explain radius and neighbours parameter of KNN.
Radius & neighbours parameter of KNN:
Radius Neighbours Classifier is a classification machine learning algorithm.

It is an extension to the k-nearest neighbours algorithm that makes predictions using all
examples in the radius of a new example rather than the k-closest neighbours.

As such, the radius-based approach to selecting neighbours is more appropriate for sparse data,
preventing examples that are far away in the feature space from contributing to a prediction.
In this tutorial, you will discover the Radius Neighbours Classifier classification machine
learning algorithm.
After completing this tutorial, you will know:

 The Nearest Radius Neighbours Classifier is a simple extension of the k-nearest


neighbours classification algorithm.
 How to fit, evaluate, and make predictions with the Radius Neighbours Classifier model
with Scikit-Learn.
How to tune the hyperparameters of the Radius Neighbours Classifier algorithm on a given
dataset

LJIET-ICT 54 | P a g e
190320132014 CHAPTER 3

TASK 24:
AIM: Convert the Recommendation in Dataframe
containing product and their distance.
PROGRAM:

Fig. 14(a) Task 24 Recommendation Program

LJIET-ICT 55 | P a g e
CHAPTER 4 SKILLS LEARNED

During these 15 days of Internship. I learned so many new things about the Python. I was
having the intermediate knowledge about the Python, after doing this Internship I came to
know about that using python we can also make Recommendation system just by adding
some In-built library.
In Python I came to know about how to set-up and use language for the required project.
Then to add library and to integrate it with our code to work in the way we want and then also
learned about the Anaconda navigator which is the most important part in the project work
where we can push our project on the jupyter notebook, also to create different branches for
projects and to merge them.
Overall, it was great, creative and challenging experience where I find lots of errors during
project, learned about something new and creative new ideas which surely helps me in the
future for creating some new project.

56| P a g e
190320132014 CHAPTER 3

CHAPTER 5 CONCLUSION

I can honestly say that my time spent interning with Brainy beam and Company resulted in one
of the best summers of my life. Not only did I gain practical skills but I also had the opportunity
to meet many fantastic people. The atmosphere was always welcoming which made me feel
right at home. Additionally, I felt like I was able to contribute to the company by assisting and
working on projects throughout the summer. In addition to these projects, I also helped many
of the CPAs with document organization, trial balance reviews, and many other day-to-day
needs.

While I was able to learn a lot from normal collage life, my two most memorable days were
events in which Brainy beam organized outside of work.

Overall, my internship at Brainy beam has been a success. I was able to gain practical skills,
work in a fantastic environment, and make connections that will last a lifetime. I could not be
more thankful.

LJIET-ICT
57 | P a g e
CHAPTER 6 REFERENCES

 Python - https://www.python.org/downloads/release/python-3912/
 Jupyter notebook - https://jupyter.org/install
 Anaconda navigator - https://docs.anaconda.com/anaconda/navigator/
 Visual studio code - https://code.visualstudio.com/download

LJIET-ICT 58| P a g e

You might also like