InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
We have below data with 10 transactions. What is the “Lift Ratio” for “if white then blue”? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Answer» MISSING data in the training data set can reduce the power/fit of a model or can lead to a biased model because we have not analyzed the behavior and relationship with other variables correctly. It can lead to incorrect prediction or classification. Below is a SIMPLE example to illustrate this.
Figure 1
Figure 2 Please NOTE the missing values in the table shown above: in figure1, we have not treated missing values for our analysis in Figure 2. The INFERENCE from this data set is that the chances of playing golf by females and MALES are similar. On the other hand, if you look at Figure. 4, which shows data after treatment of missing values (based on gender), we can see that females have higher chances of playing cricket compared to males.
Figure 3
Figure 4 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. |
Transactions#FaceplateColorsPurchased1redwhitegreen2whiteorange3whiteblue4redwhiteorange5redblue6whiteblue7whiteorange8redwhitebluegreen9redwhiteblue10yellow |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Answer» When variables are categorical and continuous, and there are “many samples”, then we should not use the t-test. If sample size n>=30, then we can go for z-test. When there are too many samples and the mean/average of multiple groups are to be compared, then ANOVA can be chosen. When we don’t have many samples and variance is unknown, then we will use the t-test. In a t-test, the expectation is that the sample size is SMALLER. Typical n<30, where n is the number of observations or sample size. The t-test and z-test can be defined as follows. There is a very subtle difference between the two. z-test is USED for n>=30 and t-test is used for n<30 scenarios mostly. t-test = (x-bar - MU) / (sd / sqrt(n))
z-test = (x-bar - mu) / (sigma / sqrt(n))
ANOVA is an analysis of variance. For example, let’s say we are talking about 3 groups.
Figure ANOVA In the “Figure ANOVA” above, we can consider ANOVA for analysis as there are more than 2 sample groups. i.e. 3 groups of samples. There can be many ROWS in each class. We have considered only 10 each for simple understanding.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3. |
We have below data with 10 transactions. What is the performance measure “Confidence” for “if white then blue”? |
|
Answer» When we want to find out the statistical significance between two variables, then the chi-square test is used to understand the DEVIATION between observed and expected FREQUENCY and divided by the expected frequency.
We use this between two Categorical variables. |
|
| 4. |
Transaction#FaceplateColorsPurchased1redwhitegreen2whiteorange3whiteblue4redwhiteorange5redblue6whiteblue7whiteorange8redwhitebluegreen9redwhiteblue10yellow |
|
Answer» In univariate analysis, variables are explored one by one. Method to perform univariate analysis will depend on whether the variable type is categorical or continuous. In the case of continuous variables, we need to understand the central tendency and spread of the variable. For example- central tendency – mean, median, mode, max, min, etc.; a measure of DISPERSION – range, quartile, IQR, variance, standard deviation, skewness, kurtosis etc; visualization methods – HISTOGRAM, boxplot etc. Univariate analysis is also used to highlight missing and outlier values. The relationship between two variables can be determined USING bivariate analysis. How the two variables are associated and/or dis-associated are looked into considering the significance level of comparison. Typically bivariate analysis can be performed for:
Different approaches/methods need to be used to handle the above scenarios. Scatter plot can be used irrespective of whether a relationship is linear or nonlinear. In order to figure out how loosely or tightly both variables are CORRELATED, correlation can be performed where the correlation values indicate from -1 to 1. If the value indicates 0, then there is no correlation between the two variables. If it is -1, then there is a perfect -ve correlation and if it is a +1 then it is a perfect +ve correlation. |
|
| 5. |
We have below data with 10 transactions. What is the performance measure “Support” for “if white then blue”? |
|
Answer» CRISP-DM stands for Cross Industry Standard Process for DATA Mining. It is a methodology for data science PROGRAMS. It has the following phases:
Some phases are iterative in nature and any data science project or program which is end to end typically follows this methodology. Below is a diagrammatic view for better understanding |
|
| 6. |
UnivSATTop10AcceptSFRatioExpensesGradRateBrown131089221322,70494CalTech141510025663,57581CMU12606259925,02672Columbia131076241231,51088Comell128083331321,86490Dartmouth134089231032,16295Duke131590301231,58595Georgetown125574241220,12692Harvard140091141139,52597JohnHopkins13057544758,69187MIT138094301034,87091Northwestern126085391128,05289NotreDame125581421315,12294PennState108138541810,18580Priceton13759114830,22095Purdue10052890199,06669Stanford136090201236,45093TexasA&M10754967258,70467UCBerkeley124095401715,14078UChicago129075501338,38087UMichigan118065681615,47085UPenn128580361127,55390UVA122577441413,34992UWisconsin108540691511,85771Yale137595191143,51496 |
|
Answer» {white} → {blue} Lift = 0.4 / (0.5 * 0.8) = 0.4 / 0.4 = 1 Lift = confidence / (benchmark confidence) Benchmark assumes independence between ANTECEDENT and consequent P (Consequent & Antecedent) = P (C) * P (A) Benchmark confidence = P (C | A) = P (C & A) / P (A) = P (C) * P (A) / P (A) Lift = Support (C U A) / [Support(C) * Support(A)] Lift > 1 indicates a rule that is useful in FINDING consequent item SETS (i.e. more useful than selecting transactions RANDOMLY) |
|
| 7. |
SATAverageSAT score of new freshmenTop10% new freshmen in top 10% of highschool classAccept% of applicants accepted SFRatioStudent to faculty ratioSExpensesEstimated annual expensesGradRateGraduation Rate(%) |
|
Answer» {WHITE} → {blue} SUPPORT s = 4/10 = 0.4 Hence Support is 40%. Support of a rule is defined as % (or number) of transactions in which antecedent (If) and CONSEQUENT (Then) APPEAR in the data. |
|
| 8. |
Consider universities dataset below. Data for 25 undergraduate programs at business schools in US universities in 1995. The dataset excludes image variables (student satisfaction, employer satisfaction, dean’s opinions, etc.). Given this |
|
Answer» Distance between two UNIVERSITIES can be derived as follows Now simple EUCLIDEAN distance can be derived as per below. In order to get a standardized distance, we have to normalize it. Hence standardized Euclidean distance between CALTECH and Cornell are as follows: |
|
| 9. |
We have trained/executed our model with the given dataset. We have noticed that we have used a regression model and it is suffering from multicollinearity. Is it possible to improvise on our model without losing any information? |
|
Answer» To check multicollinearity, we can create a CORRELATION matrix to identify & remove variables having a correlation above 75% (assuming that deciding a threshold is subjective). In addition, we can USE calculate VIF (variance inflation factor) to check the presence of multicollinearity. VIF VALUE <= 4 suggests no multicollinearity whereas a value of >= 10 IMPLIES serious multicollinearity. Additionally, we can use tolerance as an indicator of multicollinearity. However, removing correlated variables might lead to loss of information. In order to retain those variables, we can use penalized regression models like RIDGE or lasso regression. Additionally, we can add some random noise in a correlated variable so that the variables become different from each other. But, adding noise might affect the prediction accuracy, hence this approach should be carefully used with some balancing effect. |
|
| 10. |
When is Ridge regression used and when is Lasso regression (ideally)? |
|
Answer» It is suggested that in the presence of few variables with MEDIUM / LARGE sized effect, lasso regression can be used. In the presence of many variables with small/medium sized effect, ridge regression can be preferred. Conceptually, lasso regression (L1) does both variable selection and parameter shrinkage, whereas Ridge regression only does parameter shrinkage and end up INCLUDING all the coefficients in the model. In the presence of CORRELATED variables, ridge regression might be the preferred choice. ADDITIONALLY, ridge regression works best in situations where the least square estimates have higher variance. Therefore, it depends on our business goal and model objective as to what is the expectation. Accordingly, decisions can be taken. |
|
| 11. |
What are the key methods for variable selection? Explain briefly. |
|
Answer» We can follow the below steps for variable selection. There could be other ways to accomplish this as well.
|
|
| 12. |
What is the difference between Random Forest and Gradient Boosting algorithms? Explain briefly. |
|
Answer» Both Random Forest (RF) and Gradient BOOSTING (GBM) are tree-based supervised machine learning ALGORITHMS. Both use a tree-based MODELING approach and ENSEMBLE methods are used. RF uses DECISION trees, kind of complex form of a tree-based algorithm, which is inclined to overfitting. GBM instead is a boosting-based algorithm approach, which is based on weak classifiers. Accuracy of RF can be manipulated by modifying variance. GBM will have more hyper-parameters to tune for accuracy and can be planned to play for a tradeoff between bias and variance. |
|
| 13. |
We have got a dataset where a number of variables is greater than the number of observations or rows. Can we use classical Regression techniques here? How would you deal with this situation? |
|
Answer» No, CLASSICAL regression techniques can not be used here. Since a number of variables are greater than a number of observations, it is a high dimension dataset and ordinary least SQUARES cannot be considered for an ESTIMATE as standard DEVIATION and variance will be infinite. We will have to use regression techniques such as Lasso, Ridge, ETC. which will penalize coefficients and will reduce variance and standard deviation. Subset regression and/or stepwise regression can also be explored with a forward step approach. |
|
| 14. |
We have developed a Random Forest model with 10000 trees. We have got training error as 0. However, the validation error seems to be around 34~35. Any thoughts? Do you feel the model has not trained appropriately? |
|
Answer» This is a scenario where the model overfits and we get perfect accuracy or in other words, the error is ALMOST zero or zero. When we divide the dataset into training and TEST and then build our model on the training dataset, our objective is to validate the model that we have built using training dataset, to be fed into a testing dataset which is unseen by the model and new dataset for the model. Based on the features in training dataset that it has learned, if it can perform well in a new dataset with similar features, then that proves the model is performing better with less error. In this context, when we think about RANDOM forest which is a classification algorithm, various hyper parameters are to be considered carefully which is used to build the algorithm and model. The number of trees is one of those parameters and we need to ensure we reduce the number of trees in this case, to enable the model to BEHAVE appropriately and do not overfit. Trees can be reduced using K-fold cross-validation approach where k can be 5, 10 or any fold that we wish to make. |
|
| 15. |
What is the difference between one hot encoding and label encoding? Explain. |
|
Answer» USING one hot encoding, the dimensionality (i.e. FEATURES) in a dataset get increased because it creates a new variable for each level present in categorical variables. For example: let’s say we have a variable ‘color’. The variable has 3 levels NAMELY Red, Blue, and Green. One hot encoding ‘color’ variable will generate three new variables as Color.Red, Color.Blue and Color.Green containing 0 and 1 value. In label encoding, the levels of categorical variables get ENCODED as 0 and 1, so no new variable is created. Label encoding is majorly used for binary variables. |
|
| 16. |
We have time series data provided to us. What cross-validation techniques are to be followed? |
|
Answer» For time SERIES datasets, k fold can be troublesome because there might be some pattern in year 4 or 5 which is not in year 3. Resampling the dataset will separate these trends, and we might end up validation on past YEARS, which is incorrect. Instead, we can use forward chaining strategy with 5 fold cross validation as shown below:
For this, the assumption is to have 6 years of historical DATA available. |
|
| 17. |
We have a dataset comprising of variables having more than 30% missing values. Let’s say, for example, we have 100 variables and 16 variables have missing values of more than 30%. How will you deal with this scenario? |
Answer»
In a nutshell, while handling missing values, we will have to understand data first and BASED on that, various mechanisms can be performed to treat them. There is no specific rule for a particular scenario. It is data-driven and context specific. |
|
| 18. |
What are the parameters to evaluate Logistic Regression? Explain briefly. |
|||||||||||||||
|
Answer» There are various key metrics used for evaluation of a logistic regression model. Key metrics are as follows:
Accordingly, accuracy, specificity, sensitivity parameters can be derived. The area under the curve (AUC), referred to as an index of accuracy(A) or concordance index, is a perfect performance metric for ROC curve. Higher the area under the curve, the better is the prediction power of the model. |
||||||||||||||||
| 19. |
What is the difference between OLS and Maximum Likelihood? Explain briefly. |
|
Answer» OLS stands for Ordinary Least Squares. OLS is a line or estimate which MINIMIZES the error. The sum squared of errors is considered here. Error is the difference between the observed value and its corresponding predicted value. This is typically in a linear regression model scenario. MLE stands for maximum Likelihood Estimate. MLE is an approach for estimating parameters of a statistical model. Here random error is ASSUMED to FOLLOW a DISTRIBUTION, e.g. normal distribution. MLE is more to select a parameter that can maximize the likelihood or log-likelihood (when we try to NORMALIZE based on data values). OLS considers the parameter value that minimizes the error of the model. |
|
| 20. |
What is Bias-Variance trade-off? Explain. |
|
Answer» Mathematically the ERROR emerging from any model can be broken down into 3 major components. Error(X) = Square(Bias) + Variance + Irreducible Error It is important to handle or address the bias error and variance error which is in control. We can’t do much for irreducible error.
When we are trying to build a model with greater accuracy, for better performance of the model, it is critical to strike a balance between bias and variance so that errors can be minimized and the gap between ACTUAL and predicted outcomes can be reduced. Hence balance between Bias and Variance needs to be maintained. |
|
| 21. |
There are multiple algorithms available in machine learning – supervised, unsupervised and other learning. How do you determine which one to use? |
|
Answer» Machine learning can be of types - supervised, unsupervised and others such as semi-supervised, REINFORCEMENT learning, etc. When we look at how to choose which algorithm to SELECT, it depends on input data TYPE primarily and what are we trying to accomplish out of it.
Other types of machine learning also used in different scenarios. Generative, Graph-based and Heuristic approaches are part of semi-supervised learning while reinforcement learning can be active and passive categories. This is how different machine learning algorithms, methods, approaches can be used at different scenarios at a high level. |
|
| 22. |
How is the logistic regression model evaluated? Explain at least 3 points. |
|
Answer» Logistic Regression models can be evaluated as follows:
|
|
| 23. |
What is the difference between Type 1 and Type 2 Error? Explain briefly. |
|
Answer» Type I error is committed when the null hypothesis is true and we reject it, ALSO known as a ‘FALSE Positive’. Type II error is committed when the null hypothesis is false and we accept it, also known as ‘False Negative’. In the context of the confusion matrix, we can SAY Type I error occurs when we classify a value as positive (1) when it is actually negative (0). Type II error occurs when we classify a value as negative (0) when it is actually positive(1). |
|
| 24. |
There is an ask to evaluate a regression model based on parameters such as R square, Adjusted R square, and Tolerance? Explain what will be the criteria. |
|
Answer» In a regression problem, we expect that when we define a solution or mathematical formula, it should explain all possible values or assumption is that most data points should get closer to the line if it is a linear regression. R square is also known as “goodness of fit”. The higher the VALUE of R square, the better it is. R square explains the amount to which input variables explain the variation of the target variable or PREDICTED variable. If R square is 0.75, then it indicates that 75% of the variation in the target variable is explained by input variables. So higher the R-square value, better the explainability of variation in target, hence better the model performance. Now the problem arises, where we add more input variables. The value of R-square keeps increasing. If additional variables do not have an influence in determining the variation of the target variable, then it is a problem and higher R-square value, in this case, is misleading. This is where the adjusted R square is being USED. The Adjusted R square is an UPDATED version of R square. It penalizes if the addition of more input variables does not improve the existing model and can’t explain the variation in target effectively. So if we are adding more input variables, we need to ensure they influence target variable, else the gap between R-square and Adjusted R-square will increase. If there is only one input variable both value will be the same. If there are multiple input variables, it is suggested to consider Adjusted R-square value for the goodness of fit. Tolerance is defined as 1/VIF where VIF stands for Variation Inflation Factor. VIF as the name suggests indicates the inflation in variation. It is a parameter that detects multicollinearity between variables. Based on VIF values, we can determine whether to remove or include all variables without comprising the Adjusted R-square value. Hence 1/VIF or Tolerance can be used to gauge which all parameters to be CONSIDERED in the model to have a better performance. |
|
| 25. |
What is the difference between kNN and k means clustering? |
||||||||||
|
Answer» This can be described in the below table.
For example, let’s consider a dataset of football PLAYERS, their positions, their measurements, etc. We want to assign a position to these players in a new dataset which is unseen by the model which is learned using earlier training data. We may use kNN algorithm since there are measurements, but no positions are KNOWN. At the same time, let’s say we have another scenario where we have a dataset of these football players who are to be grouped into some specific groups based on some similarity between them. In this case, k-means could be used. So, both of these are context specific to the problem we are trying to solve. |
|||||||||||
| 26. |
The model is suffering from low bias and high variance. What approach should be used to tackle this scenario and why? |
|
Answer» There are three types of error in any machine learning approach. They are a biased error, variance error, and irreducible error. Generally, the focus is to look at STRIKING a balance between bias and variance and reducing those errors in the model so that accuracy can be improved. Low Bias - indicates fewer assumptions about the form of the target VARIABLE or function. In this case, when we TEST on new data, it does not give expected results and accuracy can be compromised. High variance - indicates large changes to the estimate of target variable or target function with changes to the training data. It is always tricky to handle scenario to balance between these two as increasing the bias will decrease the variance and increasing the variance will decrease the bias. Hence approach that can be followed are as follows: |
|
| 27. |
What is the Jitter Plot? Explain with an example. |
|
Answer» Jitter PLOT is used for correlation. It provides pretty much all points which scatter plots typically do not show up. We consider mpg dataset with city mileage (CTY) and highway mileage (HWY). The original data has 234 data points but a typical scatter plot seems to display fewer points. This is because there are many overlapping points appearing as a single dot. The fact that both cty and hwy are integers in the source dataset made it all the more convenient to hide this detail.
data(mpg, package="ggplot2") theme_set(theme_bw()) g <- ggplot(mpg, aes(cty, hwy))
g + geom_point() + geom_smooth(method="lm", se=F) + labs(subtitle="mpg: city VS highway mileage", y="hwy", x="cty", title="Scatterplot with overlapping points", caption="Source: midwest") Now we can handle this with a Jitter plot. We can make a jitter plot with jitter_geom(). As the name suggests, the overlapping points are randomly jittered around its original position BASED on a threshold controlled by the width argument.
data(mpg, package="ggplot2")
theme_set(theme_bw()) # pre-set the bw theme. g <- ggplot(mpg, aes(cty, hwy)) g + geom_jitter(width = .5, size=1) + labs(subtitle="mpg: city vs highway mileage", y="hwy", x="cty", title="Jittered Points") |
|
| 28. |
What is the Kolmogorov And Smirnov Test? |
|
Answer» Kolmogorov-Smirnov test is used to check WHETHER 2 samples follow the same distribution. Two-sample Kolmogorov-Smirnov test data: x and y D = 0.52, p-value = 1.581e-06 alternative HYPOTHESIS: two-sided
Two-sample Kolmogorov-Smirnov test data: x and y D = 0.1, p-value = 0.9667 alternative hypothesis: two-sided If p-Value < 0.05 (significance level), we reject the null hypothesis that they are drawn from the same distribution. In other words, p < 0.05 implies x and y from different distributions. |
|
| 29. |
What is the Wilcoxon Signed Rank Test? |
|
Answer» It is a statistical test used to COMPARE two related and matched samples. If a population can not be assumed to be normally distributed, then this test may be useful with the assumption that data are paired and from the same population. Each data PAIR is chosen randomly. It tries to compare between sample median and hypothetical median. The boxplot below in R with the “air quality” sample data demonstrates the interpretation of the analysis using this test.
|
|
| 30. |
How do we test if a time series data stationary or not programmatically? |
|
Answer» We can use the Augmented Dickey-Fuller Test (adf test) to test “stationary” aspect. A p-Value of LESS than 0.05 in adf.test() indicates that it is stationary. Illustrative code snippet: LIBRARY(tseries) adf.test(MYDATA) # p-value < 0.05 indicates the TS is stationary kpss.test(myData) |
|
| 31. |
How will you detrend a time series? |
|
Answer» Linear regression can be used to model the Time Series data with linear indices (Ex: 1, 2,...N). The resulting model’s residuals are a representation of the time series devoid of the TREND. In case, if some trend is left over to be seen in the residuals (like what it seems to be with ‘Figure1’ with MYDATA below as an EXAMPLE), then you MIGHT wish to add few predictors to the lm() call (like a forecast:: seasonal dummy, forecast::Fourier or may be a lag of the series itself), until the trend is filtered. Code snippet: trModel <- lm(myData ~ c(1:length(myData))) plot(resid(trModel), type="l") # resid(trModel) contains the de-trended series |
|
| 32. |
What is auto-correlation and partial auto-correlation? |
|
Answer» Autocorrelation and partial autocorrelation are a type of measures of association between current time series and past time series values. Both of these provide an indication that older time series values are more useful in predicting future values. Autocorrelation is the correlation of a Time Series with lags of itself. This is a significant metric because:
While comparing current time series steps to that of prior time series steps, there can be direct and indirect correlations. The indirect correlations are a linear function of correlation of the observation. There could be INTERVENING time series steps. PACF or Partial autocorrelation tries to remove the EFFECT of correlation due to shorter lags. Both ACF and PACF are useful while trying to understand which model approach could be a RELEVANT and better fit for a prediction solution. |
|
| 33. |
What is a stationary time series? |
|
Answer» A stationary TIME SERIES has the following characteristics:
This type of time series is typically easy to predict as there not much VARIATIONS EXPECTED in the pattern and trend. |
|
| 34. |
Provide five assumptions of Linear regression. |
|
Answer» There COULD be many assumptions. Five of them are described below:
|
|
| 35. |
Provide at least three ways to detect outliers in a dataset? |
|
Answer» There are various methods.
Others could be as follows: DATA points, three or more standard deviations away from the mean are considered as outlier. |
|
| 36. |
What impact outliers have in a dataset? Explain with an example. |
||||
|
Answer» Outliers can have a significant impact BASED on the results of the data analysis and statistical modeling. These are as follows:
Here is an example with a sample dataset.
If we look at above, inclusion of an outlier shows huge difference in mean / average and standard deviation PARAMETERS. |
|||||
| 37. |
What is kNN imputation and what are its pros & cons? |
||||
|
Answer» It is one of the methods to treat missing values other than direct DELETION, IMPUTATION using a mean/median/mode value, etc. In kNN imputation, the missing values of an attribute are imputed using the given number of attributes that are most similar to the attribute whose values are missing. The similarity of two attributes is determined using a distance function. Pros and Cons are DESCRIBED below.
|
|||||
| 38. |
What is the difference between “listwise deletion” and “pairwise deletion”? |
|
Answer» When a PARTICULAR VARIABLE is missing in an observation or row, then we delete an entire row. This is called List wise deletion. When the analysis is performed with all CASES of a variable and then only those variable instances are deleted and not the entire row. This is called PAIRWISE deletion. This works like a CORRELATION matrix. Generally, pairwise deletion is preferred over listwise deletion as listwise deletion removes the entire row for a particular missing variable. |
|
| 39. |
Missing values in data can cause issues and there are different strategies to handle missing values. What are the different types of missing values at the time of data collection? Explain. |
|
Answer» Below are different types of missing values can occur while the data collection process.
|
|
| 40. |
Why missing values treatment is required? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Answer» Missing DATA in the training data set can reduce the power/fit of a model or can LEAD to a biased model because we have not analyzed the behavior and relationship with other variables correctly. It can lead to incorrect prediction or classification. Below is a simple example to illustrate this.
Figure 1
Figure 2 Please NOTE the missing values in the table shown above: in figure1, we have not treated missing values for our analysis in Figure 2. The inference from this data set is that the chances of PLAYING golf by females and males are similar. On the other hand, if you look at Figure. 4, which shows data after treatment of missing values (based on gender), we can SEE that females have higher chances of playing cricket compared to males.
Figure 3
Figure 4 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41. |
What type of bivariate analysis will you perform if variables are categorical and continuous? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Answer» When variables are categorical and continuous, and there are “many samples”, then we should not use the t-test. If sample size n>=30, then we can go for z-test. When there are too many samples and the mean/average of multiple groups are to be compared, then ANOVA can be chosen. When we don’t have many samples and variance is unknown, then we will use the t-test. In a t-test, the expectation is that the sample size is smaller. Typical n<30, where n is the number of observations or sample size. The t-test and z-test can be defined as follows. There is a very subtle difference between the two. z-test is used for n>=30 and t-test is used for n<30 scenarios mostly. t-test = (x-bar - mu) / (sd / sqrt(n))
z-test = (x-bar - mu) / (sigma / sqrt(n))
ANOVA is an analysis of variance. For example, let’s SAY we are talking about 3 groups.
Figure ANOVA In the “Figure ANOVA” above, we can consider ANOVA for analysis as there are more than 2 sample groups. i.e. 3 groups of samples. There can be many rows in each class. We have considered only 10 each for simple understanding.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42. |
What is the chi-square test? When do we use this? |
|
Answer» When we want to find out the statistical significance between two variables, then the chi-SQUARE test is used to UNDERSTAND the deviation between observed and expected frequency and divided by the expected frequency.
We use this between two Categorical variables. |
|
| 43. |
What is the difference between univariate and bivariate analysis? Explain briefly. |
|
Answer» In univariate ANALYSIS, variables are explored one by one. Method to perform univariate analysis will depend on whether the variable type is categorical or continuous. In the case of continuous variables, we need to understand the central tendency and spread of the variable. For example- central tendency – mean, median, mode, max, MIN, etc.; a measure of dispersion – range, quartile, IQR, variance, standard deviation, skewness, kurtosis etc; visualization methods – histogram, boxplot etc. Univariate analysis is also used to highlight missing and outlier VALUES. The relationship between two variables can be determined using bivariate analysis. How the two variables are associated and/or dis-associated are looked into considering the significance level of COMPARISON. Typically bivariate analysis can be performed for:
Different approaches/methods need to be used to handle the above scenarios. Scatter plot can be used irrespective of whether a relationship is linear or nonlinear. In order to figure out how loosely or tightly both variables are CORRELATED, correlation can be performed where the correlation values indicate from -1 to 1. If the value indicates 0, then there is no correlation between the two variables. If it is -1, then there is a perfect -ve correlation and if it is a +1 then it is a perfect +ve correlation. |
|
| 44. |
What is CRISP-DM? Explain various stages |
|
Answer» CRISP-DM stands for Cross Industry Standard Process for Data Mining. It is a methodology for data science programs. It has the following phases:
Some phases are iterative in nature and any data science project or program which is end to end TYPICALLY follows this methodology. Below is a diagrammatic view for BETTER understanding |
|
| 45. |
Which of the following is used to assist the quantitative trader in the development?(a) quantmod(b) quantile(c) quantity(d) mboostI got this question in an interview for internship.This is a very interesting question from Model Based Prediction in chapter Machine Learning of Data Science |
|
Answer» The correct choice is (a) quantmod |
|
| 46. |
Which of the following is not a machine learning algorithm?(a) SVG(b) SVM(c) Random forest(d) None of the mentionedThis question was posed to me during a job interview.This intriguing question originated from Cross Validation topic in portion Machine Learning of Data Science |
|
Answer» The correct OPTION is (a) SVG |
|
| 47. |
Which of the following methods are present in caret for regularized regression?(a) ridge(b) lasso(c) relaxo(d) all of the mentionedThis question was addressed to me at a job interview.My question is based upon Model Based Prediction topic in portion Machine Learning of Data Science |
|
Answer» Right answer is (d) all of the mentioned |
|
| 48. |
Which of the following function can be used to flag predictors for removal?(a) searchCorrelation(b) findCausation(c) findCorrelation(d) none of the mentionedThe question was asked by my college director while I was bunking the class.My doubt stems from caret topic in chapter Machine Learning of Data Science |
|
Answer» Correct ANSWER is (C) findCorrelation |
|
| 49. |
Which of the following can be used to create the most common graph types?(a) qplot(b) quickplot(c) plot(d) all of the mentionedI have been asked this question by my school teacher while I was bunking the class.My enquiry is from Cross Validation in section Machine Learning of Data Science |
|
Answer» The correct CHOICE is (a) QPLOT |
|
| 50. |
Which of the following is a common error measure?(a) Sensitivity(b) Median absolute deviation(c) Specificity(d) All of the mentionedI got this question in an online interview.I'd like to ask this question from Cross Validation topic in portion Machine Learning of Data Science |
|
Answer» Correct OPTION is (d) All of the mentioned |
|