You are on page 1of 9

NAME- Rajat Gupta

Section- B2B2(Marketing and Analytics)


UID – 2019-1706-0001-0007

Q1
QA wall street Journal subscriber survey asked 46 questions about subscriber
characteristic and interest. State whether each of the following question
provides categorical or quantitative data.

A. What is your age?


Ans. Quantitative data

B. Are you male or female?


Ans. Categorical data

C. When did you first start reading the WSJ? High school, College, early career,
mid-career, late Career or retirement?
Ans. Categorical data

D. How long have you been in your present job or position?


Ans. Quantitative

E. What type of vehicle are you considering for your next purchase? Nine
response categories include sedan, sports, car, SUV, and minivan.
Ans. Categorical data

2.1 Write a Python program to add key to a dictionary.


Ans
d = {0:5, 1:10}
d.update ({3:20})
print (d)

2.2 Write a python script to merge two dictionaries?


Ans. Using the method update ()
By using the method update () in Python, one list can be merged into another. But
in this, the second list is merged into the first list and no new list is created.
Example:
# Python code to merge dict using update () method
Def Merge (dict1, dict2):
    Return (dict2.update(dict1))       
Dict1 = {'a': 10, 'b': 8}
Dict2 = {'d': 6, 'c': 4}
  
# This return None
Print (Merge (dict1, dict2))
  
# changes made in dict2
Print(dict2)
Output: None
{'c': 4, 'a': 10, 'b': 8,’d’: 6}

Q3.1 What will be the output of below code?


Set1= {3, 8, 2, 6}
print (“Set1:” set1)
Set2= {7, 8, 5, 1}
print (“Set2:” set2)
Set3=set1.union (set2)
print (“union:” set3)

Ans 3.1 Output= set3 :( 3, 8, 2, 6, 7, 5, 1)


Q 3.3 Write a python code to print ant string 3 times?
Ans3.3 Str = "ant"
Print(str*3)

Q4. The Pima India dataset has 768 observations on 9 variables. The data frame
of data set is as below. Write your observation for data

Preg int64 Number of times pregnant


Plas int64 Plasma glucose concentration a 2 hours in an oral glucose
Tolerance test
Pres int64 Diastolic blood pressure (mm Hg)
Skin int64 Triceps skin fold thickness (mm)
Test int64 2-Hour serum insulin (mu U/ml)
Mass float64 Body mass index (weight in kg/(height in m)^2)
Pedi float64 Diabetes pedigree function
Age int64 Age (years)
Class int64 Class variable (0 or 1) 268 of 768 are 1, the others are 0

Data.describe()

Preg Plas Pres Skin Test Mass Pedi Age Class


Count 768 768 768 768 768 768 768 768 768
120.89 69.10 20.53 31.99 33.24
Mean 3.845 79.799 0.472 0.349
5 5 6 3 1
19.35 15.95 115.24
Std 3.37 31.973 7.884 0.331 11.76 0.477
6 2 4
Min 0 0 0 0 0 0 0.078 21 0
25% 1 99 62 0 0 27.3 0.244 24 0
50% 3 117 72 23 30.5 32 0.372 29 0
75% 6 140.25 80 32 127.25 36.6 0.626 41 1
Max 17 199 122 99 846 67.1 2.42 81 1

Ans4. From this data set can say that


 The total observation data set is 768
 Mean of the 9 variables
 Std of the 9 variables
 How the data is distributed 25%, 50% and 75% i.e. normal
distribution
 The max indicated the maximum value in the 9 categories

Q5. Explain various steps involved in a machine learning project?


Ans 5. Gathering Data
First real step of machine learning: gathering data. This step is very important
because the quality and quantity of data that you gather will directly determine
how good your predictive model can be.
Data preparation
The next step of machine learning: Data preparation, where we load our data
into a suitable place and prepare it for use in our machine learning training.
Choosing a model
The next step is choosing a model. There are many models that researchers and
data scientists have created over the years. Some are very well suited for image
data, others for sequences (like text, or music), some for numerical data, and
others for text-based data.
Training
Now we move onto next step of machine learning — the training. In this step,
we will use our data to incrementally improve our model’s ability to predict the
result of the project. This is similar to someone first learning to drive. At first,
they don’t know how to drive or how to handle the steering or how any of the
pedals, knobs, and switches work, or when any of them should be used.
However, after lots of practice and correcting their mistakes, a licensed driver
emerges.
Evaluation
Once training is complete, it’s time to see if the model is any good,
using Evaluation. This is where that dataset that we set aside earlier comes into
play. Evaluation allows us to test our model against data that has never been
used for training. This metric allows us to see how the model might perform
against data that it has not yet seen. This is meant to be representative of how
the model might perform in the real world.
Prediction
Machine learning use data to answer questions. So, Prediction, or inference, is
the step where we get to answer some questions. This is the point of all this
work, where the value of machine learning is realized

Q6. Explain with examples supervised, unsupervised and re-enforcement


learning.
Ans 6. Supervised Algorithms
In supervised algorithms, the inner relations of the data you are processing, but
you do know very well what is the output that you need from your model. For
example:
“I need to be able to start predicting when users will cancel their subscriptions”.
The output of you model is already defined: “will user X cancel his/her
subscription”. What we may not know yet, is HOW to realise which users will
cancel. So, we can use an existing set of data to “train” a model into predicting
this particular aspect about your user. The training of the model usually uses
part of the data to “learn”, and part of the data to validate and measure how
accurate the model is.
Unsupervised Algorithms
With unsupervised algorithms, you still don’t know what you want to get out of
the model yet. You probably suspect that there hast to be some kinds of
relationships or correlation between the data you have, but data is too complex
to try to guess. So, in this case you normalize your data into a format that makes
sense to compare, and then let the model work its magic and try to find some of
these relationships.
For example, after processing all the data related to all your product’s users
with an unsupervised algorithm, it might come up with a way to group your
users into 2 groups. After inspecting and comparing these two groups, you
might realize that group A is in a geographic location, and group B in another
one. Whether you can act upon this particular segmentation of the data, is up to
you to figure out, and if not, then maybe you can remove or re-arrange the data
about user’s location to force a different segmentation.

Reinforcement Learning
Reinforcement learning is the field that studies the problems and techniques that
try to retro-feed its model in order to improve. In order to accomplish this, RL
needs to able to “sense” signals, automatically decide on an action, and then
compare the outcome against a “reward” definition. RL tries to figure out
WHAT to do to maximize these rewards, but it does this by itself 

Q7. Explain with example how Machine Learning model can be used to solve
business problem from Human resource, Marketing and Finance domain?
Ans7. For human resource
Aapplicant Tracking & Assessment
Applicant tracking and assessment has topped the list in early machine learning
applications, especially for companies and roles that receive high volumes of
applicants. Glint is not an AI company, but they use AI tools to help companies
save money and provide a better work experience. Machine learning tools help HR
and management personnel hire new team members by tracking a candidate’s
journey throughout the interview process and helping speed up the process of
getting streamlined feedback to applicants.
Sentiment analytics
There is also an opportunity to track employee issues using real time analytics and
then apply sentiment analysis to address these issues. Let’s say that a majority of
employees are asking questions about late payments for travel reimbursements.
This data can indicate something in the system isn’t working correctly. Before
things become a full-blown issue, HR leaders can uncover the issue and
communicate a solution.

Chatbots To Answer Frequently Asked Employee Questions


What if a Chatbot provides real time answers to a range of HR questions, including,
“Are we off on Ambedkar Jayanti?” Or “What are my medical benefits?” Chatbots
are capable of answering any question and answer set that can be stored in a
database. They can also be designed to proactively promote benefits to employees
they may not yet know about
For Marketing
Customer behaviour
Marketers use machine learning to monitor customer behaviour. They write
algorithms to track:
 Websites visited
 Emails opened
 Downloads
 Clicks
A consumer’s social score is a factor as well. It monitors and analyses how a user
behaves on social networks, for example
 Accounts they follow
 Posts they like
 Ads they engage with
Using machine learning to qualify prospects is helping businesses create more
accurate customer profiles, improving their marketing.
Easier to predict customer churn
For example, let’s say one customer visits your website twice per month. On the
first visit, they research products, and on the second visit, they buy something. This
pattern goes on for a year. But after a year, the customer visits your site only once
per month and doesn’t buy anything. You could predict they’ll stop using your
business altogether soon.
Machine learning helps analyse this data on a much larger scale.

Audience discovery
Identify your most valuable customers.
Let’s say you’re trying to market your app, and your primary goal is to get your
app in the hands of long-term, paying users. But you’re finding that users aren’t
opening the app that often after initial download. You wouldn’t be the first to
encounter this issue. In fact, only 37% of app installs remain in use after seven
days. So how can you find the right audience?

Machine learning can sort and analyse sources to help you learn which users are
most valuable to your app, and help you get the most out of your budget by only
showing ads to users who are most likely to download and use your app. 

Prioritize ad targeting and customer personalization


AI and machine learning are helping marketers target their ads more effectively.
Right now, your ads might be great, but they can’t be effective if they aren’t being
seen by the right audiences. With the help of AI, you can make sure your target
audience is reached.
In addition to improving the way your ads get targeted, machine learning can
help personalize the customer experience on your platforms.

For finance
Process Automation
Process automation is one of the most common applications of machine learning in
finance. The technology allows to replace manual work, automate repetitive tasks,
and increase productivity.
As a result, machine learning enables companies to optimize costs, improve
customer experiences, and scale up services. Here are automation use cases of
machine learning in finance:
 Chabot’s
 Call-centre automation.
 Paperwork automation.
 Gamification of employee training, and more.

Portfolio Management

The term “robo-advisor” was essentially unheard-of just five years ago, but it is
now commonplace in the financial landscape. The term is misleading and doesn’t
involve robots at all. Rather, robo-advisors are algorithms built to calibrate a
financial portfolio to the goals and risk tolerance of the user. Users enter their goals
(for example, retiring at age 65 with $250,000.00 in savings), age, income, and
current financial assets. The advisor (which would more accurately be referred to as
an “allocator”) then spreads investments across asset classes and financial
instruments in order to reach the user’s goals.

Loan / Insurance Underwriting

Underwriting could be described as a perfect job for machine learning in finance,


and indeed there is a great deal of worry in the industry that machines will replace a
large swath of the underwriting positions that exist today. Especially at large
companies (big banks and publicly traded insurance firms), machine learning
algorithms can be trained on millions of examples of consumer data (age, job,
marital status, etc) and financial lending or insurance results (did this person
default, pay back the loan on time, get in a car accident, etc). 

You might also like