0% found this document useful (0 votes)
243 views52 pages

Nptel Assignment Answers

The document contains answers to NPTEL assignments for computer science, covering various topics in data analytics, probability, and hypothesis testing. It includes multiple-choice questions with correct answers and explanations for each, spanning four weeks of assignments. Key concepts discussed include descriptive and predictive analytics, sampling methods, probability distributions, and hypothesis testing principles.

Uploaded by

K. VIJAY KUMAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
243 views52 pages

Nptel Assignment Answers

The document contains answers to NPTEL assignments for computer science, covering various topics in data analytics, probability, and hypothesis testing. It includes multiple-choice questions with correct answers and explanations for each, spanning four weeks of assignments. Key concepts discussed include descriptive and predictive analytics, sampling methods, probability distributions, and hypothesis testing principles.

Uploaded by

K. VIJAY KUMAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

lOMoARcPSD|36945582

Nptel assignment Answers

Computer science (Malla Reddy Group of Institutions)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Vijay Kumar ([email protected])
lOMoARcPSD|36945582

NPTEL Assignment Answers

Week 1 – Answers

1) Statement: Descriptive Analytics, is the conventional form of Business Intelligence


and data analysis.
a) True––
b) False
Ans) (a)True.
Descriptive analytics is the branch of analytics that focuses on understanding
historical data and analyzing past performance to identify trends and patterns. It
is the most basic and widely used form of business intelligence and data analysis.
2) Which of the following is not an example of predictive analytics?
a) Linear regression
b) Time series analysis and forecasting
c) Bar Graphs
d) Data mining
Ans) (c) Bar Graphs
Data Visualization( bar graphs) is an example of descriptive analytics
3) State true or False: Statement: Data can be numerical and categorical but
cannot be continuous or discrete
a) True
b) False
Ans) (b)False. Data can be continuous and discrete
4) Which of the following is not an example of Ratio Data?
a) Height
b) Year
c) Age
d) Weight
Ans) (b) Year. Year is an interval scale. An interval scale is an ordered scale in
which the difference between measurements are a meaningful quantity but the
measurements do not have a true zero point.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

5) Which of the following is a command to have a message appear on the


screen?
a) Print
b) Input
c) Write
d) Msg
Ans) (a) Print. Command print is used to print the message
6) What is the output from this print() function call: print( '$100 $200
$300'.count('$'), '$100 $200 $300'.count('$', 5, 10), '$100 $200
$300'.count('$', 5) )
a) 3 1 0
b) 3 1 1
c) 3 1 2
d) 3 1 3
Ans) (c) 3 1 2
str.count() counts occurrences of the given substring within the specified
string. The second and third parameters indicate <start> and <end> values,
interpreted as for string
slicing: the method applies to the portion of the string beginning with
character position <start> up to but not including <end>.

7) Median is not applicable to


a) Ordinal
b) Interval
c) Nominal
d) None of the above
Ans) (c) Nominal. Median is not applicable to nominal data

8) State True or false: Statement: data can be generated by machines but


not by humans.
a) True
b) False
Ans) (b) False. Data can be generated by both machines and humans.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

9) Which one of the following is not a classification of Data Analytics?


a) Diagnostic analytics
b) Deceptive analytics
c) Predictive analytics
d) Prescriptive analytics
Ans) (b) Deceptive analytics
10) For getting 2nd, 4th & 7th row of a datafile “df”in Python
programming, we can write:
a) df.loc[[2,3,5]]
b) df.loc[[1,3,6]]
c) df.iloc[2,4,7]
d) None of the above
Ans) (b) df.loc[[1,3,6]]

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week 2 – Answers
1) Which of the following is not a method for describing a sample space?
a) Roster or listing
b) Tree diagram
c) Offset builder notation
d) Venn Diagram
Ans) (c) Offset builder notation.
Set builder notation is used for describing sample space not Offset
builder notation
2) A club of 4 is to be selected from a group of 12 people. How many
possible clubs can be selected?
a) 395
b) 425
c) 495
d) 525
Ans) (c) 495
12C = 12!/4!8! = 12x 11x10x9/4x3x2 = 495
4

3) Eight individuals are candidates for positions of president, vice president,


and treasurer of an organization. How many possibilities of selections
exist?
a) 300
b) 330
c) 336
d) 339
Ans) (c) 336. It is a problem of choosing from sample without replacement.
np 8X7X6 = 336
r :

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

4) A college plans to interview 8 students for possible offers of graduate


assistantships. The college has three assistantships available. How many
groups of three can the college select?
a) 126
b) 56
c) 136
d) 130
Ans) (b) 56
8x7x6!/(5!x 3!) = 56
5) company plans to interview 10 recent graduates for possible
employment. The company has three positions open. How many groups
of three can the company select?
a) 90
b) 100
c) 120
d) 130
Ans) (c) 120
10C = 10!/7!x3! = 120
3
6) Individual outcome of an experiment is called?
a) the sample space
b) a sample point
c) an experiment
d) an individual
Ans) (b) a sample point.
An individual outcome is sample point, however the collection of all
possible outcome is sample space.

7) Two events having nonzero probabilities


a) can be both mutually exclusive and independent
b) cannot be both mutually exclusive and independent
c) are always mutually exclusive
d) are always independent
Ans) (b) cannot be both mutually exclusive and independent

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

8) On an average 5 % items supplied by manufacturer X are defectives. If a


batch of 10 items is inspected: what is the probability that 2 items are
defective
a) 0.065
b) 0.075
c) 0.085
d) 0.095
Ans) (b) 0.075
To solve this problem, we can use the binomial distribution formula:
P(X = k) = (nCx) * p^x * (q)^(n-x)
n = 10, k = 2, and p = 0.05, since 5% of the items are defective.
P(x=2) = 10C2 * P2 * q8
= 10C2 * (0.05)2 * (0.95)10-2
= 0.075
9) A question paper contains 90 multiple choice questions. There are 4
alternative answers (A, B, C or D) out of which only one is correct. Mr X
answers these questions randomly (i.e. without preparation). What is the
probability that X gets a score of at least 10 marks?
a) 0.9997
b) 0.7894
c) 0
d) 0.001
Ans) (a) 0.9997
The probability of answering a multiple-choice question with 4
alternatives correctly by guessing is 1/4 or 0.25.

Let X be the number of questions Mr X answers correctly. Since there


are 90 questions in total, X can be modeled as a binomial distribution
with n=90 trials and p=0.25 probability of success (i.e. answering a
question correctly).

The probability of getting at least 10 questions correct can be


calculated using the cumulative distribution function (CDF) of the
binomial distribution:
P(X ≥ 10) = 1 - P(X< 10)

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

10) State true or False: Statement: A distribution can either be discrete or


continuous, it can’t be both at the same time.
a) True
b) False
Ans) (a) True

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week – 3 Answers
1) State True or False: Statement: The specific value of a random variable is
called estimator.
a) True
b) False
Ans) (b) False. The specific value of a random variable is called estimate

2) If the true proportion of customers who are below 100 kg weight is 0.4,
what is the probability that a sample size 100 yields a sample proportion
between 0.3 to 0.4
a) 0.961
b) 0.827
c) 0.706
d) 0.479
Ans) (d) 0.479

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

3) Stratified random sampling is a method of selecting a sample in which


a) the sample is first divided into strata, and then random samples are
taken from each stratum
b) various strata are selected from the sample
c) the population is first divided into strata, and then random samples
are drawn from each stratum
d) None of these alternatives is correct.
Ans) (c) the population is first divided into strata, and then random samples
are drawn from each stratum

4) The Poisson probability distribution is which of the following type?


a) Continuous probability distribution
b) Discrete probability distribution
c) Uniform probability distribution
d) Normal probability distribution
Ans) (b) Discrete Probability Distribution
Poisson probability distribution is a discrete distribution. It is a
probability distribution that assigns probabilities to a set of discrete
outcomes.
In the case of the Poisson distribution, the outcomes are the number of
events that occur in a fixed interval of time or space. These outcomes
can only take on integer values, such as 0, 1, 2, 3, and so on, and there
are an infinite number of possible outcomes.
5) Assuming a binomial experiment with p = 0.5 and a sample size of 100.
The expected value of this distribution is?
a) 0.50
b) 0.30
c) 100
d) 50
Ans) (d) 50
Expected value = n * p
= 0.5 x 100
= 50

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

6) A hypergeometric probability distribution is identical to


a) the Poisson probability distribution
b) the binomial probability distribution
c) the normal distribution
d) None of these alternatives is correct
Ans) (d) None of these alternatives is correct

7) Why one should not go for sampling?


a) Less costly to administer than a census.
b) The person authorizing the study is comfortable with the sample.
c) Because the research process is sometimes destructive
d) None of the above
Ans) (d) None of the above
All the first three options are benefit of sampling

8) A car distributor in city Y experiences on an average 2.5 car sales per day.
Find the probability that on a randomly selected day, they will sell 5 car:
a) 0.0668
b) 0.544
c) 0.082
d) 0.205
Ans) (a) 0.0668

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

9) In question 8, Find the probability that on a randomly selected day, they


will sell no cars:
a) 0.0668
b) 0.544
c) 0.082
d) 0.205
Ans) (c) 0.082

10) In question 8, Find the probability that on a randomly selected day, they
will sell at most 2 cars:
a) 0.0668
b) 0.544
c) 0.082
d) 0.205
Ans) (b) 0.544

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week – 4 Answers
1) In hypothesis testing if the null hypothesis is rejected
a) no conclusions can be drawn from the test
b) The alternative hypothesis is true
c) the data must have been accumulated incorrectly
d) the sample size has been too small
Ans) (b) The alternated hypothesis is true if null hypothesis is rejected

2) The level of significance is the


a) maximum allowable probability of Type II error
b) maximum allowable probability of Type I error
c) same as the confidence coefficient
d) same as the p-value
Ans) (b) maximum allowable probability of Type I error

3) When the following hypotheses are being tested at a level of significance


of alpha
H0: Mu ≥ 500
Ha: Mu < 500
the null hypothesis will be rejected if the p-value is
a) ≤ alpha
b) alpha
c) Beta/2
d) 1 - (alpha/2)
Ans) (a) ≤ alpha
If the p-value is less than or equal to alpha, we reject the null hypothesis.
If the p-value is greater than alpha, we fail to reject the null hypothesis.

When testing the hypothesis H0: Mu ≥ 500 vs. Ha: Mu < 500 at a
significance level of alpha, we reject the null hypothesis if the p-value is
less than or equal to alpha. Therefore, the answer is ≤ alpha.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

4) In a two-tailed hypothesis test situation, the test statistic is determined


to be t = -2.692. The sample size has been 45. The p-value for this test is
a) -0.005
b) +0.005
c) -0.01
d) +0.01
Ans) (d) +0.01

5) In a lower one-tail hypothesis test situation, the p-value is determined to


be 0.2. If the sample size for this test is 51, the t statistic has a value of
a) 0.849
b) -0.849
c) 1299
d) -1299
Ans) (b) -0.849
In a lower one-tailed hypothesis test, the p-value represents the area to
the left of the observed test statistic. Therefore, if the p-value is 0.2, it
means that the area to the left of the test statistic is 0.2.

Since the sample size is 51, we can use a t-distribution with 50 degrees
of freedom (df = n - 1). We can find the test statistic that corresponds to
a left-tailed area of 0.2 using a t-distribution table or software.

Using a t-distribution table or software, we find that the t-value that


corresponds to a left-tailed area of 0.2 and 50 degrees of freedom is
approximately -0.849.

Therefore, the answer is b) -0.849.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

6) A machine is designed to fill toothpaste tubes with 5.8 ounces of


toothpaste. The manufacturer does not want any underfilling or
overfilling. The correct hypotheses to be tested are
a) H0: Mu not equals to 5.8, Ha: Mu = 5.8
b) H0: Mu = 5.8, Ha: Mu not equals to 5.8
c) H0: Mu > 5.8, Ha: Mu =< 5.8
d) H0: Mu >= 5.8, Ha: Mu < 5.8
Ans) (b) H0: Mu = 5.8, Ha: Mu not equals to 5.8
• H0: Mu = 5.8 (null hypothesis) - The mean amount of toothpaste
filled in the tubes is equal to 5.8 ounces.
Ha: Mu not equals to 5.8 (alternative hypothesis) - The mean
amount of toothpaste filled in the tubes is not equal to 5.8 ounces.
• This hypothesis test is a two-tailed test because the alternative
hypothesis states that the true population mean is not equal to the
hypothesized value of 5.8 ounces. We are testing for the possibility of
both underfilling and overfilling, so the null hypothesis is that the
true population mean is equal to 5.8 ounces.
Therefore, the correct answer is b) H0: Mu = 5.8, Ha: Mu not equals to 5.8

7) The quality-control manager at a Li-BATTERY factory needs to determine


whether the mean life of a large shipment of Li-Battery is equal to the
specified value of 375 hours. The process standard deviation is known to
be 100 hours. A random sample of 64 batteries indicates a sample mean
life of 350 hours. State the null hypotheses
a) Mu = 375
b) Mu ≤ 375
c) Mu = 350
d) Mu ≥ 350
Ans) (a) Mu = 375

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

8) In question 7, At the alpha = 0.05 level of significance is there any


evidence that the mean life is different from 375 hours?
a) Yes, there is
b) No, there is not
c) None of the above
Ans) (a)Yes, there is

9) In question 7, Computed the p-value is:


a) 0.0456
b) 0.456
c) 0.0228
d) 0.228
Ans) (a) 0.0456

10) In question 7, at 95% confidence interval estimate of the population


mean life of the battery is:
a) 325.5 to 379.5
b) 325.5 to 374.5
c) 320.5 to 379.5
d) 320.5 to 374.5

Ans) (b) 325.5 to 374.5

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week-5 Answers

1)The ‘F’ ratio in a completely randomized ANOVA is the ratio of


a) MST/MSE
b)MSTR/MSE
c) MSE/MSTR
d) MSE/MST
Ans(b) MSTR/MSE
The 'F' ratio in a completely randomized ANOVA (Analysis of Variance) is the
ratio of the between-group variability (or treatment effect) to the within-
group variability (or error variance). It is used to test the null hypothesis that
the means of all groups or treatments are equal, against the alternative
hypothesis that at least one of the means is different from the others.

2)A term that means the same as the term "variable" in an ANOVA
procedure is
a)factor
b)treatment
c)replication
d)variance within
Ans(a) factor

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

3)An ANOVA procedure is used for four samples, each comprising 30


observations, were taken from the four populations. The numerator and
denominator (respectively) degrees of freedom for the critical value of F are
a) 3 and 30
b)4 and 30
c)3 and 119
d) 3 and 116
Ans(d)For The numerator DF = c – 1 = 4-1 = 3
For denominator DF = n- c = (4x 30) – 4 = 116
4)Which of the following is not a required assumption for the analysis of
variance?
a)The random variable of interest for each population has a normal
probability distribution
b)The variance associated with the random variable must be the same for
each population
c)At least 2 populations are under consideration
d)Populations have equal means
Ans(d)We test in ANOVA whether the population has equal means or not.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

5)If, sum of square between treatments (SSTR) = 6,750 H0: m1=m2=m3=m4


Sum of square of error (SSE) = 8,000 Ha: at least one mean is different Total
number of elements (nT )= 20 The mean square between treatments
(MSTR) equals
a)400
b)500
c)1,687.5
d)2,250
Ans(d)MSTR = SSTR/ (c-1) = 6750/3 = 2250

6)Refer to Q 5. The mean square within treatments (MSE) equals


a)400
b)500
c)1687.5
d)2250
Ans(b)MSE = SSE/n-c = 8000/16 = 500

7)Refer to Q 5. The test statistic to test the null hypothesis is equals


a)0.22
b)0.84
c)4.22
d)4.5
And(d)F = MSTR/MSE = 2250/500 = 4.5

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

8)An ANOVA procedure is applied to data obtained from 6 samples where


each sample contains 20 observations. The degrees of freedom for the
critical value of F are
a)6 numerator and 20 denominator degrees of freedom
b)5 numerator and 20 denominator degrees of freedom
c)5 numerator and 114 denominator degrees of freedom
d)6 numerator and 114 denominator degrees of freedom
And(c)
For The numerator DF = c – 1 = 6-1 = 5
For denominator DF = n- c = (6x 20) – 6 = 114

9)The critical F value with 6 numerator and 60 denominator degrees of


freedom at alpha = .05 is
a)3.74
b)2.25
c)2.37
d)1.96
Ans(b)From using F table at alpha = 0.05

10)The ANOVA procedure is a statistical approach for determining whether


or not
a)the means of two samples are equal
b)the means of two or more samples are equal
c)the means of more than two samples are equal
d)the means of two or more populations are equal
Ans(d)

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week-6 Answers

a)0.887
b)0.956
c)0.945
d)0.932
Ans(b)

2)With reference to the data given in question no. 1, test the null
hypothesis: "There is no significant relationship between the variables". we
will:
a)Accept the null hypothesis
b)Reject the null hypothesis
c)Can’t state any conclusion
d)None of the above
Ans(b)There is a significant relationship between the variables

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

3)State TRUE or FALSE, in context to regression analysis –


Statement: "The variance of error, is same for all values of the independent
variable"
a)True
b)False
Ans(a)True

4)A regression analysis between sales (Y in $1000) and advertising (X in


dollars) resulted in the following equation
Y = 30,000 + 5 X
The above equation implies that an:
a)increase of $5 in advertising is associated with an increase of $5,000 in
sales
b)increase of $1 in advertising is associated with an increase of $5 in sales
c)increase of $1 in advertising is associated with an increase of $35,000 in
sales
d)increase of $1 in advertising is associated with an increase of $5,000 in
sales

Ans(d)The Y variable is in $1000, if the x value increases by 1, it is multiplied


by 5. So the increase is y
The variable is 5 in units of 1000 dollars. So it’s $5000

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

5)In a regression and correlation analysis if r2 = 1, then Sum of square of


Error (SSE)
a)SSE must also be equal to one
b)SSE must be equal to zero
c)SSE can be any positive value
d)SSE must be negative
Ans(b)) SSE must be equal to zero
6)In a regression analysis if Sum of square of Error (SSE) = 200 and Sum of
square of Regression (SSR) = 300, then the coefficient of determination is
a)0.6667
b)0.4000
c)0.6000
d)1.5000
Ans(c)
7)Regression analysis was applied between demand for a product (Y) and
the price of the product (X), and the following estimated regression
equation was obtained.
Y = 120 - 10 X
Based on the above estimated regression equation, if price is increased by 2
units, then demand is expected to
a)increase by 120 units
b)increase by 100 units
c)increase by 20 units
d)decrease by 20 units
Ans(d)

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

8)Regression analysis was applied between sales (Y in $1,000) and


advertising (X in $100), and the following estimated regression equation
was obtained.
Y = 80 + 6.2 X
Based on the above estimated regression line, if advertising is $10,000,
then the point estimate for sales (in dollars) is
a)$62,080
b)$142,000
c)$700
d)$700,000
Ans(d)
Y = 80 + 6.2 X
Y = 80 + 6.2 (100 unit of $100)
Y = 700 (unit of $1000)
= 700000 dollars

9)In regression analysis if the dependent variable is measured in dollars,


the independent variable
a)must also be in dollars
c)must be in some units of currency
d)can be any units
d)cannot be in dollars
Ans(c)

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

10)If the coefficient of correlation is 0.90, then the coefficient of


determination
a)is also 0.9
b)is either 0.81 or -0.81
c)can be either negative or positive
d)must be 0.81
Ans(d)Coefficient of determination = R sq. = 0.9 x 0.9 = 0.81

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week-7 Answers

1) In a regression analysis, the error term is a random variable with a mean or


expected value of
a) zero
b) one
c) any positive value
d) any value

Ans(a) zero

2) If the coefficient of determination is a positive value, then the coefficient of


correlation
a) must also be positive
b) must be zero
c) can be either negative or positive
d) must be larger than 1

Ans(c) can be either negative or positive

3) The interval estimate of the mean value of y for a given value of x is


a) prediction interval estimate
b) confidence interval estimate
c) average regression
d) x versus y correlation interval

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Ans(b) confidence interval estimate

4) Larger values of r2 imply that the observations are more closely grouped about the
a) average value of the independent variables
b) average value of the dependent variable
c) least squares line
d) origin

Ans(c) The least squares line

5) In a regression analysis, the coefficient of determination is 0.4225. The coefficient


of correlation
in this situation is
a)±0.65
b) ±0.1785
c) any positive value
d) any value

Ans. A. ±0.65

6) In a regression and correlation analysis if r2 = 1, then


a) SSE must also be equal to one
b) SSE must be equal to zero
c) SSE can be any positive value
d )SSE must be negative

Ans. SSE must be equal to zero

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

7) If the coefficient of correlation is 0.8, the percentage of variation in the dependent


variable
explained by the variation in the independent variable is
a) 0.80%
b) 80%
c) 0.64%
d) 64%

Ans. D. 64%

8) If the coefficient of determination is equal to 1, then the coefficient of correlation


a) must also be equal to 1
b) can be either -1 or +1
c) can be any value between -1 to +1
d) must be -1

Ans. Can be either -1 or +1

9) If all the points of a scatter diagram lie on the least squares regression line, then
the coefficient of
determination for these variables based on these data is
a) 0
b) 1
c) either 1 or -1, depending upon whether the relationship is positive or negative
d) could be any value between -1 and 1

Ans. B. 1

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

10)A simple linear regression equation (y = mx + c ) will always pass through the point
_____
a)(0,0)
b)(1,1)
c)( Ymean , Xmean )
d)(Xmean , Ymean)

Ans(d) (Xmean , Ymean)

Week-8 Answers

1) Which of the following methods do we use to best fit the data in Logistic Regression?
a) Least Square Error
b) Maximum Likelihood
c) Jaccard distance
d) All of these

Ans(b) Maximum Likelihood

2) Which of the following evaluation metrics can not be applied in case of logistic
regression output
to compare with the target?
a) AUC-ROC
b) Accuracy

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

c) Log Loss
d) Mean-Squared-Error

Ans(d) Mean Squared Error

3) Let f(x) denote the logistic function. The range of f(x) for any real value of x is
a) (0,1)
b) (-1 , 1)
c) All positive integers
d) All negative integers

Ans(a) (0, 1)

4) Which of the following options is true?


a) Linear Regression errors values has to be normally distributed but in case of Logistic
Regression it
is not the case
b) Logistic Regression errors values has to be normally distributed but in case of
Linear Regression it
is not the case
c) Both Linear Regression and Logistic Regression error values have tc be normally
distributed
d) Both Linear Regression and Logistic Regression error values have not to be
normally distributed

Ans(a) Linear Regression errors values has to be normally distributed but in case of
Logistic
Regression it is not the case

5)For the figure given below, which decision boundary is overfitting the training data?

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

a) A
b) B
c) C
d) None of these

Ans(c) C

6) Select the correct alternatives from the following based on the figure

1. The training error in the first plot is maximum as compared to second and third plot.
2. The best model for this regression problem is the last (third) plot because it has
minimum
training error (zero).
3. The second model is more robust than first and third because it will perform best on
unseen
data.
4. The third model is overfitting more as compared to first and second.
5. All will perform the same because we have not seen the testing data.

a) 1 and 3
b) 1 and 4
c) 1, 3 and 4

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

d) 5

Ans(c) 1, 3 and 4

7) For categorical data with ‘n’ categories, the number of dummy variables will
be________
a) n
b) n-1
c) n+1
d) 2n

Ans(b) n – 1

8)In binary logistic regression,


a) The dependent variable is continuous
b) The dependent variable is divided into two equal subcategories
c) The dependent variable consists of two categories
d) There is no dependent variable

Ans(c) The dependent variable consists of two categories

9) If the number of False negatives is 5 and number of True Positives is 20, the value of
recall will be
equal to _______
a) 0.2
b) 0.6
c) 0.8
d) 0.3
Ans(c) 0.8

Explanation: Recall = True Positives/(True Positives + False Negatives) = 20/(20 + 5) =


0.8

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

10) If the precision is 0.6 and the recall value is 0.4, the value of f-measure will be
a) 0.48
b) 1
c) 0.24
d) None of these
Ans(a) 0.48

Explanation: F-measure = 2*precision*recall/(precision + recall) = 2*0.6*0.4/1 = 0.48

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week 9 Assignment

1 point
1. The following confusion matrix was obtained from a classifier.
Confusion Matrix. What is the accuracy of the classifier?
35%
27%
75%
80%
Sol:

2. For the given confusion matrix, what is the number of False


Positives for the Apple class?
17
8
7
4
Sol:
Ans. 17
Explanation: FP = 8 + 9 = 17

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

3. For the above given confusion matrix, what is the number of


True Negatives for the Apple class?
4
10
8
36
Sol:
Ans 8
Explanation: True Negative refers to the no. of predictions where
classifier correctly predicts the
negative class as negative. Here, we look for all the times the
classifier correctly predicted a
datapoint as Not Apple i.e. 2 + 3 + 2 + 1 = 8

4. For the above given confusion matrix, what is the number of


False Negatives for the Apple class?
3
1
2
4
Sol:
Ans. 4
Explanation: False Negative refers to the number of predictions
where the classifier incorrectly predicts the
positive class (Apple) as negative i.e. 1 + 3 = 4

5. For the above given confusion matrix, what is the F1-score of the
classifier for the Apple class?

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

0.5
0.4
0.2
0.6
Sol:
Ans. 0.4
Explanation: F1-score = 2*TP / (2TP + FP + FN) = 2*7/(2*7 + 17 + 4) =
0.4

6. In ROC analysis, a classifier is called ‘good’ if it has ______


Low TPR and Low FPR
Low TPR and High FPR
High TPR and Low FPR
High TPR and High FPR
Sol:
In ROC analysis, a classifier is called "good" if it has a high true positive rate (TPR) and a low
false positive rate (FPR) at a given threshold. TPR, also known as sensitivity or recall, is the
proportion of positive cases that are correctly identified as positive by the classifier, while
FPR is the proportion of negative cases that are incorrectly classified as positive. Therefore, a
good classifier is one that correctly identifies a high proportion of positive cases while
minimizing the number of false positives.

7. State True or False: Standardization of features is not required


before training a Logistic regression model
True
False
Sol:
Standardization isn’t required for logistic regression. The main goal of
standardizing features is to help convergence of the technique used
for optimization.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

8. For the given confusion matrix, determine the sensitivity for the
model. Confusion Matrix: 33%
67%
50%
None of these
Sol

9. For the given confusion matrix, determine the specificity for the
model

Confusion Matrix:
53%
67%
47%
33%
Sol:
Specificity = TN / (TN + FP) = 45/(45 + 40) = 0.53 .i.e. 53%

10. According to the ROC Curve and AUC below, choose the
correct alternative for the effectiveness of classifiers A and B.
ROC Curve:

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

A=B
A <B
A>B
None of these
Sol:

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week 10 Assignment

1. State True or False: Statement: Null hypothesis for chi square test
of independence assumes that all the proportions are equal.
A. True
B. False
Ans. a. True
The null hypothesis for the chi-square test of independence assumes that there is no
association between the two variables being analysed. In other words, the proportions of one
variable are independent of the proportions of the other variable. This means that all the
proportions are equal, and any observed differences are due to chance.

2. Statistical test conducted to determine whether to reject or not


reject a hypothesized probability distribution for a population is
known as a ________
a. contingency test
b. probability test
c. goodness of fit test
d. None of these alternatives is correct.
Ans. c. Goodness of fit

3. What is the minimum number of variables/features required to


perform clustering?
a. 0
b. 1
c. 2
d. 3
Ans. 1

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

4. An important application of the chi-square distribution is


a. making inferences about a single population variance
b. testing for goodness of fit
c. testing for the independence of two variables
d. All of these alternatives are correct.
Ans. D. All of these are correct

5. The bigger the chi-square statistic, _________ the p-value


a. bigger
b. smaller
c. does not vary
d. None of these
Ans. Smaller

6. State True or False: The shape of Chi-square distribution is left-


skewed
a. True
b. False
Ans. False
The shape of the Chi-square distribution is not left-skewed, but it is right-skewed. The Chi-
square distribution is a continuous probability distribution that depends on a parameter
called the degrees of freedom (df). As the degrees of freedom increase, the shape of the
distribution becomes more symmetric and approaches a normal distribution. However, for
smaller degrees of freedom, the distribution is skewed to the right.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

7. Determine the chi-square statistic for the following data.

a. 0
b. 52.75
c. 32
d. None of these
Ans. 52.75

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

8. For the above data, if significance level is 5% and degrees of


freedom = 4, what is the chi-square
value?
A. 11.07
B. 12.592
C. 9.488
D. 7.815
Ans. 9.488
To find the chi-square value with a significance level of 5% and degrees of freedom =
4, we need to use a chi-square distribution table.

The critical value of chi-square for a significance level of 5% and degrees of freedom
= 4 is 9.488.

Since the calculated chi-square statistic of 52.75 is greater than the critical value of
9.488, we can reject the null hypothesis of no association between the two variables
and conclude that there is a significant association between the flavour of candy and
the number of pieces of candy.

Therefore, the answer is (C) 9.488.


9. The degrees of freedom for a contingency table with 6 rows and 3
columns is
a. 18
b. 15
c. 6
d. 10
Ans. D. 10
The degrees of freedom for a contingency table can be calculated using the formula:

df = (number of rows - 1) * (number of columns - 1)

Using the values given in the question, we have:

df = (6 - 1) * (3 - 1) = 5 * 2 = 10

Therefore, the answer is (d) 10.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

10. In K-means clustering, K stands for _________


a. Number of data points
b. Error function parameters
c. Number of clusters
d. None of these
Ans. C. Number of clusters

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week 11 Assignment

1. What is the most appropriate no. of clusters for the data


points represented by the following dendrogram:

A. 2
B. 4
C. 6
D. 8
Ans. 4
https://www.youtube.com/watch?v=3BzfOLnIY9w(reference)
There are several methods for determining the appropriate number of clusters in a
dendrogram. Here are some common ones:

1. Visual inspection: One way to determine the number of clusters is to look at


the dendrogram and identify the point where the clusters start to become
visually distinct. This is often referred to as the "elbow point" or "knee point"
and represents a natural break in the data.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

2. What is the advantage of Hierarchical clustering over K-means


clustering?
A. Hierarchical clustering is computationally faster than K-means
B. You don’t have to assign the number of clusters from the
beginning in the case of hierarchical clustering
C. Both are equally proficient
D. None of these
Ans. B.

3.For the given dendrogram, what would be the threshold value for
a total number of clusters equal to 4?

A. 10000
B. 15000
C. 20000
D. 5000
Ans. 15000
https://www.youtube.com/watch?v=3BzfOLnIY9w(reference)
The threshold value for a dendrogram to produce a specific number of clusters, such as 4 in
this case, will depend on the structure of the dendrogram and the clustering method used.
The threshold value determines the level at which the dendrogram is "cut" to create the
desired number of clusters.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

4. Which clustering technique requires a merging approach?


A. partitional
B. hierarchical
C. naïve bayes
D. None of these
Ans. Hierarchical
Hierarchical clustering is a clustering technique that uses a merging approach, where clusters
are successively merged or divided based on their similarity or distance, until a stopping
criterion is met. In contrast, partitional clustering methods such as k-means require a
partitioning approach, where the data points are assigned to a fixed number of non-
overlapping clusters. Naive Bayes, on the other hand, is a classification algorithm that uses
probabilistic models to predict the class of new observations based on the input features.

5. The Euclidean and Manhattan distance between X ( 3,4) and the


origin is _________ respectively
A. 5 and 1
B. 1 and 5
C. 5 and 7
D. None of these
Ans. C. 5 and 7
The Euclidean distance between point X (3, 4) and the origin (0, 0) is:

sqrt((3-0)^2 + (4-0)^2) = sqrt(9 + 16) = sqrt(25) = 5

The Manhattan distance (also known as taxicab distance or L1 norm) between point
X (3, 4) and the origin (0, 0) is:

|3-0| + |4-0| = 3 + 4 = 7

Therefore, the correct answer is C. 5 and 7.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

6. The Iris dataset contains information about Iris setosa and


versicolor. What is the Euclidean distance between these two
objects?

a. 2.8
b. 4.6
c. 22.6
d. -3.6
Ans. 2.8

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

7. Which of the following is required by K-means clustering?


a. defined distance metric
b. number of clusters
c. initial guess as to cluster centroids
d. All of these
Ans. All of these

8. Considering the K-means algorithm, after current iteration, we


have 3 clusters A, B and C with centroids (0, 1) (2, 1), (-1, 2)
respectively. Which cluster will the points (2, 3) and (2, 0.5) be
assigned to in the next iteration?
A. Cluster A
B. Cluster B
C. Cluster C
D. None of these
Ans. Cluster B
The points (2, 3) and (2, 0.5) will be assigned to Cluster B in the next iteration because the
Euclidean distance between point (2,3) and centroids of Cluster A, B, and C are:

• Distance between (2,3) and (0,1) = sqrt((2-0)^2 + (3-1)^2) = sqrt(8)


• Distance between (2,3) and (2,1) = sqrt((2-2)^2 + (3-1)^2) = 2
• Distance between (2,3) and (-1,2) = sqrt((2+1)^2 + (3-2)^2) =sqrt(10)

Similarly, the Euclidean distance between point (2,0.5) and centroids of Cluster A, B, and C
are:

• Distance between (2,0.5) and (0,1) = sqrt((2-0)^2 + (0.5-1)^2) = sqrt(5.25)


• Distance between (2,0.5) and (2,1) = sqrt((2-2)^2 + (0.5-1)^2) = 0.5
• Distance between (2,0.5) and (-1,2) = sqrt((2+1)^2 + (0.5-2)^2) = sqrt(10.25)

Therefore, both points (2, 3) and (2, 0.5) will be assigned to Cluster B in the next iteration as
it has the smallest distance from both points.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

9. State True or False: The K-means algorithm is sensitive to outliers


A. True
B. False
Ans. True
True. The K-means algorithm is sensitive to outliers as it tries to minimize the sum of squared
distances between the data points and their assigned cluster centroids. Outliers, being far away
from the rest of the data points, can significantly increase this sum of squared distances and thus,
affect the clustering results. In some cases, outliers may even form their own cluster.

10. State True or False: Irrespective of the initial choice of


parameters, K-means algorithm will always converge to the same
final clusters
A. True
B. False
Ans. False
False. The K-means algorithm is sensitive to the initial choice of parameters, and the final
clusters can vary depending on the initial centroids. In some cases, the algorithm may
converge to a suboptimal solution, especially when the data is complex or the number of
clusters is not well-defined. To mitigate this problem, K-means is often run multiple times
with different initial centroids, and the best result is chosen based on a defined criterion,
such as minimizing the sum of squared distances or maximizing the silhouette score.

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

Week 12 Assignment

1. Choose from the following that are Decision Tree nodes?


a. Decision Nodes
b. End Nodes
c. Chance Nodes
d. All of these
Ans. All of these

2. What are the advantages of Classification and Regression Trees (CART)?


(A) Decision trees require relatively less effort from users for data preparation
(B) Nonlinear relationships between parameters do not affect tree
performance.
(C) Both (A) and (B)
(D) None of these
Ans. C. Both (A) and (B)

3. What are the disadvantages of Classification and Regression Trees (CART)?


(A) Decision trees can be unstable because small variations in the data might
result in a completely
different tree being generated
(B) Decision trees require relatively less effort from users for data preparation
(C) Nonlinear relationships between parameters do not affect tree
performance.
(D) Decision trees implicitly perform variable screening or feature selection
Ans. A. Decision trees can be unstable because small variations in the data
might result in a completely different tree being generated

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

4. Suppose, your target variable is whether a passenger will survive or not


using Decision Tree. What
type of tree do you need to predict the target variable?
(A) classification tree
(B) regression tree
(C) clustering tree
(D) dimensionality reduction tree
Ans. Classification tree

5. What is the maximum depth in a decision tree?


(A) the length of the longest path from a root to a leaf
(B) the length of the shortest path from a root to a leaf
(C) the length of the longest path from a root to a sub-node
(D) None of these
Ans. The length of the longest path from a root to a leaf

6. Suppose in a classification problem, you are using a decision tree and you
use the Gini index as the
criterion for the algorithm to select the feature for the root node. The feature
with the _____ Gini
index will be selected.
(A) maximum
(B) highest
(C) least
(D) None of these
Ans. Least

Downloaded by Vijay Kumar ([email protected])


lOMoARcPSD|36945582

7. In Decision Trees, for predicting a class label, the algorithm starts from
which node of the tree?
(A) Root
(B) Leaf
(C) Terminal
(D) Sub-node
Ans. Root

8. What is splitting in the decision tree?


(A) Dividing a node into two or more sub-nodes based on if-else conditions
(B) Removing a sub-node from the tree
(C) Balance the dataset prior to fitting
(D) All of the above
Ans. Dividing a node into two or more sub-nodes based on if-else conditions

9. State True or False: Leaf node in a decision tree will have entropy value
equal to 0
A. True
B. False
Ans. True

10. State True or False: Entropy is the measure of uncertainty of a random


variable
A. True
B. False
Ans. True

Downloaded by Vijay Kumar ([email protected])

You might also like