Data Science Final Exam | 76 Questions with
100% Verified Answers
What is bagging? - ✔️✔️used to reduce variance which helps avoid overfitting. The
idea is that once you have your sample from bootstrapping, you can then build a
series of models. This ensemble of models, will carry votes with equal weight and
you're able to use that average.
Difference between bagging and boosting? - ✔️✔️Bagging splits data and runs
seperate models with the data then votes on it. Boosting runs each model then
tracks which data samples are successful/not successful. The least successful data
is given heavier weights, which means it'll be iterated on more often to properly
train the model
What is a gini index in random forests? - ✔️✔️This is used to calculate the nodes
purity, gini scores of 0 are perfect splits, you don't want the split to be evenly split
(i.e. gini=0.5)
The impurity (or purity) measure used in building decision tree in CART is Gini
Index. The decision tree built by CART algorithm is always a binary decision tree
(each node will have only two child nodes
What is boosting? - ✔️✔️Refers to any Ensemble method that can combine several
weak learners into a strong learner and is used to reduce bias and variance. It
does this through a weighted majority vote (classification) or a weighted sum
(regression). Ada boost and Gradient boost are two popular methods.
It trains the models sequentially
,What is bootstrapping - ✔️✔️A sampling technique with replacement. This ends up
leaving some data unselected (on average 63% are sampled), while the remaining
37% of the training instances that are not sampled are called out-of-bag
instances. Since the predictor never sees the out of bag instances during training,
it can be evaluated on these instances without the need for a separate validation
set or cross validation.
What is root mean squared error? - ✔️✔️the standard deviation of the residuals
(prediction errors). Residuals are a measure of how far from the regression line
data points are; RMSE is a measure of how spread out these residuals are. In
other words, it tells you how concentrated the data is around the line of best fit.
sqroot(sum(actual - predicted)^2 / n)
When should you use mean squared error vs root mean squared error? - ✔️✔️MSE
is useful for comparing models, RMSE is useful for understanding the data
What is specificity? - ✔️✔️true negative / (true negative + false positive)
measures the proportion of actual negatives that are correctly identified as such
(e.g., the percentage of healthy people who are correctly identified as not having
the condition).
What is accuracy? - ✔️✔️(tp + tn) / (tp + fp + fn + tn)
, What is an f-1 score? - ✔️✔️is the harmonic mean of precision and sensitivity
f1 = 2TP / (2tp + fp + fn)
F1 score (also F-score or F-measure) is a measure of a test's accuracy. It considers
both the precision p and the recall r of the test to compute the score
What is stacking? - ✔️✔️A way of combining multiple models, that introduces the
concept of a meta learner. It is less widely used than bagging and boosting. Unlike
bagging and boosting, stacking may be (and normally is) used to combine models
of different types. The procedure is as follows:
1. Split the training set into two disjoint sets.
2. Train several base learners on the first part.
3. Test the base learners on the second part.
4. Using the predictions from 3) as the inputs, and the correct responses as the
outputs, train a higher level learner.
What is curse of dimensionality? - ✔️✔️Lots of features makes training very slow,
high dim datasets at risk of being sparse
What is the difference for reporting normal vs non normal data? - ✔️✔️When
reporting normal data you can report mean & confidence interval.
However for non-normal data you should report median & 1st/3rd quartile since
asymmetry of non-normal prevents reporting of CI, StDev, etc.
100% Verified Answers
What is bagging? - ✔️✔️used to reduce variance which helps avoid overfitting. The
idea is that once you have your sample from bootstrapping, you can then build a
series of models. This ensemble of models, will carry votes with equal weight and
you're able to use that average.
Difference between bagging and boosting? - ✔️✔️Bagging splits data and runs
seperate models with the data then votes on it. Boosting runs each model then
tracks which data samples are successful/not successful. The least successful data
is given heavier weights, which means it'll be iterated on more often to properly
train the model
What is a gini index in random forests? - ✔️✔️This is used to calculate the nodes
purity, gini scores of 0 are perfect splits, you don't want the split to be evenly split
(i.e. gini=0.5)
The impurity (or purity) measure used in building decision tree in CART is Gini
Index. The decision tree built by CART algorithm is always a binary decision tree
(each node will have only two child nodes
What is boosting? - ✔️✔️Refers to any Ensemble method that can combine several
weak learners into a strong learner and is used to reduce bias and variance. It
does this through a weighted majority vote (classification) or a weighted sum
(regression). Ada boost and Gradient boost are two popular methods.
It trains the models sequentially
,What is bootstrapping - ✔️✔️A sampling technique with replacement. This ends up
leaving some data unselected (on average 63% are sampled), while the remaining
37% of the training instances that are not sampled are called out-of-bag
instances. Since the predictor never sees the out of bag instances during training,
it can be evaluated on these instances without the need for a separate validation
set or cross validation.
What is root mean squared error? - ✔️✔️the standard deviation of the residuals
(prediction errors). Residuals are a measure of how far from the regression line
data points are; RMSE is a measure of how spread out these residuals are. In
other words, it tells you how concentrated the data is around the line of best fit.
sqroot(sum(actual - predicted)^2 / n)
When should you use mean squared error vs root mean squared error? - ✔️✔️MSE
is useful for comparing models, RMSE is useful for understanding the data
What is specificity? - ✔️✔️true negative / (true negative + false positive)
measures the proportion of actual negatives that are correctly identified as such
(e.g., the percentage of healthy people who are correctly identified as not having
the condition).
What is accuracy? - ✔️✔️(tp + tn) / (tp + fp + fn + tn)
, What is an f-1 score? - ✔️✔️is the harmonic mean of precision and sensitivity
f1 = 2TP / (2tp + fp + fn)
F1 score (also F-score or F-measure) is a measure of a test's accuracy. It considers
both the precision p and the recall r of the test to compute the score
What is stacking? - ✔️✔️A way of combining multiple models, that introduces the
concept of a meta learner. It is less widely used than bagging and boosting. Unlike
bagging and boosting, stacking may be (and normally is) used to combine models
of different types. The procedure is as follows:
1. Split the training set into two disjoint sets.
2. Train several base learners on the first part.
3. Test the base learners on the second part.
4. Using the predictions from 3) as the inputs, and the correct responses as the
outputs, train a higher level learner.
What is curse of dimensionality? - ✔️✔️Lots of features makes training very slow,
high dim datasets at risk of being sparse
What is the difference for reporting normal vs non normal data? - ✔️✔️When
reporting normal data you can report mean & confidence interval.
However for non-normal data you should report median & 1st/3rd quartile since
asymmetry of non-normal prevents reporting of CI, StDev, etc.