Top Machine Learning Interview Questions and Answers

Last updated on Feb 18 2022
Shankar Shankar Trivedi

Table of Contents

Top Machine Learning Interview Questions and Answers

Explain the terms Artificial Intelligence (AI), Machine Learning (ML and Deep Learning?

Artificial Intelligence (AI) is the domain of producing intelligent machines. ML refers to systems that can assimilate from experience (training data) and Deep Learning (DL) states to systems that learn from experience on large data sets. ML can be considered as a subset of AI. Deep Learning (DL) is ML but useful to large data sets. The figure below roughly encapsulates the relation between AI, ML, and DL.

In summary, DL is a subset of ML & both were the subsets of AI.

Additional Information. ASR (Automatic Speech Recognition) & NLP (Natural Language Processing) fall under AI and overlay with ML & DL as ML is often utilized for NLP and ASR tasks.

What are the different types of Learning/ Training models in ML?

ML algorithms can be primarily classified depending on the presence/absence of target variables.

  1. Supervised learning.[Target is present]
    The machine learns using labelled data. The model is trained on an existing data set before it starts making decisions with the new data.
    The target variable is continuous.Linear Regression, polynomial Regression, quadratic Regression.
    The target variable is categorical. Logistic regression, Naive Bayes, KNN, SVM, Decision Tree, Gradient Boosting, ADA boosting, Bagging, Random forest etc.
  2. Unsupervised learning.[Target is absent]
    The machine is trained on unlabeled data and without any proper guidance. It automatically infers patterns and relationships in the data by creating clusters. The model learns through observations and deduced structures in the data.
    Principal component Analysis, Factor analysis, Singular Value Decomposition etc.
  3. Reinforcement Learning.
    The model learns through a trial-and-error method. This kind of learning involves an agent that will interact with the environment to create actions and then discover errors or rewards of that action.

What is the difference between deep learning and machine learning?

Machine Learning involves algorithms that learn from patterns of data and then apply it to decision making. Deep Learning, on the other hand, is able to learn through processing data on its own and is quite similar to the human brain where it identifies something, analyse it, and makes a decision.
The key differences are as follow.

  • The manner in which data is presented to the system.
  • Machine learning algorithms always require structured data and deep learning networks rely on layers of artificial neural networks.

What is the main key difference between supervised and unsupervised machine learning?

Supervised learning technique needs labeled data to train the model. For example, to solve a classification problem (a supervised learning task), you need to have label data to train the model and to classify the data into your labeled groups. Unsupervised learning does not need any labelled dataset. This is the main key difference between supervised learning and unsupervised learning.

How do you select important variables while working on a data set? 

There are various means to select important variables from a data set that include the following.

  • Identify and discard correlated variables before finalizing on important variables
  • The variables could be selected based on ‘p’ values from Linear Regression
  • Forward, Backward, and Stepwise selection
  • Lasso Regression
  • Random Forest and plot variable chart
  • Top features can be selected based on information gain for the available set of features.

There are many machine learning algorithms till now. If given a data set, how can one determine which algorithm to be used for that?

Machine Learning algorithm to be used purely depends on the type of data in a given dataset. If data is linear then, we use linear regression. If data shows non-linearity then, the bagging algorithm would do better. If the data is to be analyzed/interpreted for some business purposes, then we can use decision trees or SVM. If the dataset consists of images, videos, audios then, neural networks would be helpful to get the solution accurately.

So, there is no certain metric to decide which algorithm to be used for a given situation or a data set. We need to explore the data using EDA (Exploratory Data Analysis) and understand the purpose of using the dataset to come up with the best fit algorithm. So, it is important to study all the algorithms in detail.

State the differences between causality and correlation?

Causality applies to situations where one action, say X, causes an outcome, say Y, whereas Correlation is just relating one action (X) to another action(Y) but X does not necessarily cause Y.

We look at machine learning software almost all the time. How do we apply Machine Learning to Hardware?

We have to build ML algorithms in System Verilog which is a Hardware development Language and then program it onto an FPGA to apply Machine Learning to hardware.

Explain One-hot encoding and Label Encoding. How do they affect the dimensionality of the given dataset?

One-hot encoding is the representation of categorical variables as binary vectors. Label Encoding is converting labels/words into numeric form. Using one-hot encoding increases the dimensionality of the data set. Label encoding doesn’t affect the dimensionality of the data set. One-hot encoding creates a new variable for each level in the variable whereas, in Label encoding, the levels of a variable get encoded as and .

Deep Learning is a part of machine learning that works with neural networks. It involves a hierarchical structure of networks that set up a process to help machines learn the human logics behind any action. We have compiled a list of the frequently asked deep leaning interview questions to help you prepare.

What is overfitting?

Overfitting is a type of modelling error which results in the failure to predict future observations effectively or fit additional data in the existing model. It occurs when a function is too closely fit to a limited set of data points and usually ends with more parameters

What is Multilayer Perceptron and Boltzmann Machine?

The Boltzmann machine is a simplified version of the multilayer perceptron. This is a two layer model with a visible input layer and a hidden layer which makes stochastic decisions for the

When does regularization come into play in Machine Learning?

At times when the model begins to underfit or overfit, regularization becomes necessary. It is a regression that diverts or regularizes the coefficient estimates towards zero. It reduces flexibility and discourages learning in a model to avoid the risk of overfitting. The model complexity is reduced and it becomes better at predicting.

What is Bias, Variance and what do you mean by Bias-Variance Tradeoff?

Both are errors in Machine Learning Algorithms. When the algorithm has limited flexibility to deduce the correct observation from the dataset, it results in bias. On the other hand, variance occurs when the model is extremely sensitive to small fluctuations.

If one adds more features while building a model, it will add more complexity and we will lose bias but gain some variance. In order to maintain the optimal amount of error, we perform a tradeoff between bias and variance based on the needs of a business.

Source. Understanding the Bias-Variance Tradeoff. Scott Fortmann – Roe

Bias stands for the error because of the erroneous or overly simplistic assumptions in the learning algorithm. This assumption can lead to the model underfitting the data, making it hard for it to have high predictive accuracy and for you to generalize your knowledge from the training set to the test set.

Variance is also an error because of too much complexity in the learning algorithm. This can be the reason for the algorithm being highly sensitive to high degrees of variation in training data, which can lead your model to overfit the data. Carrying too much noise from the training data for your model to be very useful for your test data.

The bias-variance decomposition essentially decomposes the learning error from any algorithm by adding the bias, the variance and a bit of irreducible error due to noise in the underlying dataset. Essentially, if you make the model more complex and add more variables, you’ll lose bias but gain some variance — in order to get the optimally reduced amount of error, you’ll have to trade off bias and variance. You don’t want either high bias or high variance in your model.

How can we relate standard deviation and variance?

Standard deviation refers to the spread of your data from the mean. Variance is the average degree to which each point differs from the mean i.e., the average of all data points. We can relate Standard deviation and Variance because it is the square root of Variance.

A data set is given to you and it has missing values which spread along standard deviation from the mean. How much of the data would remain untouched?

It is given that the data is spread across mean that is the data is spread across an average. So, we can presume that it is a normal distribution. In a normal distribution, about % of data lies in standard deviation from averages like mean, mode or median. That means about % of the data remains uninfluenced by missing values.

Is a high variance in data good or bad?

Higher variance directly means that the data spread is big and the feature has a variety of data. Usually, high variance in a feature is seen as not so good quality.

If your dataset is suffering from high variance, how would you handle it?

For datasets with high variance, we could use the bagging algorithm to handle it. Bagging algorithm splits the data into subgroups with sampling replicated from random data. After the data is split, random data is used to create rules using a training algorithm. Then we use polling technique to combine all the predicted outcomes of the model.

A data set is given to you about utilities fraud detection. You have built a classifier model and achieved a performance score of .%. Is this a good model? If yes, justify. If not, what can you do about it?

Data set about utilities fraud detection is not balanced enough i.e., imbalanced. In such a data set, accuracy score cannot be the measure of performance as it may only be predicting the majority class label correctly but in this case our point of interest is to predict the minority label. But often minorities are treated as noise and ignored. So, there is a high probability of misclassification of the minority label as compared to the majority label. For evaluating the model performance in case of imbalanced data sets, we should use Sensitivity (True Positive rate) or Specificity (True Negative rate) to determine class label wise performance of the classification model. If the minority class label’s performance is not so good, we could do the following.

  1. We can use under sampling or over sampling to balance the data.
  2. We can change the prediction threshold value.
  3. We can assign weights to labels such that the minority class labels get larger weights.
  4. We could detect anomalies.

Explain the handling of missing or corrupted values in the given dataset.

An easy way to handle missing values or corrupted values is to drop the corresponding rows or columns. If there are too many rows or columns to drop then we consider replacing the missing or corrupted values with some new value.

Identifying missing values and dropping the rows or columns can be done by using IsNull() and dropna( ) functions in Pandas. Also, the Fillna() function in Pandas replaces the incorrect values with the placeholder value.

What is Time series?

A Time series is a sequence of numerical data points in successive order. It tracks the movement of the chosen data points, over a specified period of time and records the data points at regular intervals. Time series doesn’t require any minimum or maximum time input. Analysts often use Time series to examine data according to their specific requirement.

What is a Box-Cox transformation?

Box-Cox transformation is a power transform which transforms non-normal dependent variables into normal variables as normality is the most common assumption made while using many statistical techniques. It has a lambda parameter which when set to implies that this transform is equivalent to log-transform. It is used for variance stabilization and also to normalize the distribution.

What is the difference between stochastic gradient descent (SGD) and gradient descent (GD)?

Gradient Descent and Stochastic Gradient Descent are the algorithms that find the set of parameters that will minimize a loss function.
The difference is that in Gradient Descend, all training samples are evaluated for each set of parameters. While in Stochastic Gradient Descent only one training sample is evaluated for the set of parameters identified.

What is the exploding gradient problem while using back propagation technique?

When large error gradients accumulate and result in large changes in the neural network weights during training, it is called the exploding gradient problem. The values of weights can become so large as to overflow and result in NaN values. This makes the model unstable and the learning of the model to stall just like the vanishing gradient problem.

Can you mention some advantages and disadvantages of decision trees?

The advantages of decision trees are that they are easier to interpret, are nonparametric and hence robust to outliers, and have relatively few parameters to tune.
On the other hand, the disadvantage is that they are prone to overfitting.

Explain the differences between Random Forest and Gradient Boosting machines.

Random forests are a significant number of decision trees pooled using averages or majority rules at the end. Gradient boosting machines also combine decision trees but at the beginning of the process unlike Random forests. Random forest creates each tree independent of the others while gradient boosting develops one tree at a time. Gradient boosting yields better outcomes than random forests if parameters are carefully tuned but it’s not a good option if the data set contains a lot of outliers/anomalies/noise as it can result in overfitting of the model. Random forests perform well for multiclass object detection. Gradient Boosting performs well when there is data which is not balanced such as in real time risk assessment.

What is a confusion matrix and why do you need it?

Confusion matrix (also called the error matrix) is a table that is frequently used to illustrate the performance of a classification model i.e., classifier on a set of test data for which the true values are well-known.

It allows us to visualize the performance of an algorithm/model. It allows us to easily identify the confusion between different classes. It is used as a performance measure of a model/algorithm.

A confusion matrix is known as a summary of predictions on a classification model. The number of right and wrong predictions were summarized with count values and broken down by each class label. It gives us information about the errors made through the classifier and also the types of errors made by a classifier.

 What’s a Fourier transform?

Fourier Transform is a mathematical technique that transforms any function of time to a function of frequency. Fourier transform is closely related to Fourier series. It takes any time-based pattern for input and calculates the overall cycle offset, rotation speed and strength for all possible cycles. Fourier transform is best applied to waveforms since it has functions of time and space. Once a Fourier transform applied on a waveform, it gets decomposed into a sinusoid.

What do you mean by Associative Rule Mining (ARM)?

Associative Rule Mining is one of the techniques to discover patterns in data like features (dimensions) which occur together and features (dimensions) which are correlated. It is mostly used in Market-based Analysis to find how frequently an itemset occurs in a transaction. Association rules have to satisfy minimum support and minimum confidence at the very same time. Association rule generation generally comprised of two different steps.

  • “A min support threshold is given to obtain all frequent item-sets in a database.”
  • “A min confidence constraint is given to these frequent item-sets in order to form the association rules.”

Support is a measure of how often the “item set” appears in the data set and Confidence is a measure of how often a particular rule has been found to be true.

Describe a hash table.

Hashing is a technique for identifying unique objects from a group of similar objects. Hash functions are large keys converted into small keys in hashing techniques. The values of hash functions are stored in data structures which are known hash table.

List the advantages and disadvantages of using neural networks.

Advantages.

We can store information on the entire network instead of storing it in a database. It has the ability to work and give a good accuracy even with inadequate information. A neural network has parallel processing ability and distributed memory.

Disadvantages.

Neural Networks requires processors which are capable of parallel processing. It’s unexplained functioning of the network is also quite an issue as it reduces the trust in the network in some situations like when we have to show the problem we noticed to the network. Duration of the network is mostly unknown. We can only know that the training is finished by looking at the error value but it doesn’t give us optimal results.

You have to train a GB dataset using a neural network with a machine which has only GB RAM. How would you go about it?

We can use NumPy arrays to solve this issue. Load all the data into an array. In NumPy, arrays have a property to map the complete dataset without loading it completely in memory. We can pass the index of the array, dividing data into batches, to get the data required and then pass the data into the neural networks. But be careful about keeping the batch size normal.

What is Marginalization? Explain the process.

Marginalisation is summing the probability of a random variable X given joint probability distribution of X with other variables. It is an application of the law of total probability.

P(X=x) = ∑YP(X=x,Y)

Given the joint probability P(X=x,Y), we can use marginalization to find P(X=x). So, it is to find distribution of one random variable by exhausting cases on other random variables.

Explain the phrase “Curse of Dimensionality”.

The Curse of Dimensionality refers to the situation when your data has too many features.

The phrase is used to express the difficulty of using brute force or grid search to optimize a function with too many inputs.

It can also refer to several other issues like.

  • If we have more features than observations, we have a risk of overfitting the model.
  • When we have too many features, observations become harder to cluster. Too many dimensions cause every observation in the dataset to appear equidistant from all others and no meaningful clusters can be formed.

Dimensionality reduction techniques like PCA come to the rescue in such cases.

What is the Principle Component Analysis?

The idea here is to reduce the dimensionality of the data set by reducing the number of variables that are correlated with each other. Although the variation needs to be retained to the maximum extent.

The variables are transformed into a new set of variables that are known as Principal Components’. These PCs are the eigenvectors of a covariance matrix and therefore are orthogonal.

Why is rotation of components so important in Principle Component Analysis (PCA)?

Rotation in PCA is very important as it maximizes the separation within the variance obtained by all the components because of which interpretation of components would become easier. If the components are not rotated, then we need extended components to describe variance of the components.

What are outliers? Mention three methods to deal with outliers.

A data point that is considerably distant from the other similar data points is known as an outlier. They may occur due to experimental errors or variability in measurement. They are problematic and can mislead a training process, which eventually results in longer training time, inaccurate models, and poor results.

The three methods to deal with outliers are.
Univariate method – looks for data points having extreme values on a single variable
Multivariate method – looks for unusual combinations on all the variables
Minkowski error – reduces the contribution of potential outliers in the training process

What is the difference between regularization and normalisation? 

Normalisation adjusts the data; regularisation adjusts the prediction function. If your data is on very different scales (especially low to high), you would want to normalise the data. Alter each column to have compatible basic statistics. This can be helpful to make sure there is no loss of accuracy. One of the goals of model training is to identify the signal and ignore the noise if the model is given free rein to minimize error, there is a possibility of suffering from overfitting. Regularization imposes some control on this by providing simpler fitting functions over complex ones.

Explain the difference between Normalization and Standardization.

Normalization and Standardization are the two very popular methods used for feature scaling. Normalization refers to re-scaling the values to fit into a range of [,]. Standardization refers to re-scaling data to have a mean of and a standard deviation of (Unit variance). Normalization is useful when all parameters need to have the identical positive scale however the outliers from the data set are lost. Hence, standardization is recommended for most applications.

List the most popular distribution curves along with scenarios where you will use them in an algorithm.

The most popular distribution curves are as follows- Bernoulli Distribution, Uniform Distribution, Binomial Distribution, Normal Distribution, Poisson Distribution, and Exponential Distribution.
Each of these distribution curves is used in various scenarios.

Bernoulli Distribution can be used to check if a team will win a championship or not, a newborn child is either male or female, you either pass an exam or not, etc.

Uniform distribution is a probability distribution that has a constant probability. Rolling a single dice is one example because it has a fixed number of outcomes.

Binomial distribution is a probability with only two possible outcomes, the prefix ‘bi’ means two or twice. An example of this would be a coin toss. The outcome will either be heads or tails.

Normal distribution describes how the values of a variable are distributed. It is typically a symmetric distribution where most of the observations cluster around the central peak. The values further away from the mean taper off equally in both directions. An example would be the height of students in a classroom.

Poisson distribution helps predict the probability of certain events happening when you know how often that event has occurred. It can be used by businessmen to make forecasts about the number of customers on certain days and allows them to adjust supply according to the demand.

Exponential distribution is concerned with the amount of time until a specific event occurs. For example, how long a car battery would last, in months.

How do we check the normality of a data set or a feature? 

Visually, we can check it using plots. There is a list of Normality checks, they are as follow.

  • Shapiro-Wilk W Test
  • Anderson-Darling Test
  • Martinez-Iglewicz Test
  • Kolmogorov-Smirnov Test
  • D’Agostino Skewness Test

What is Linear Regression?

Linear Function can be defined as a Mathematical function on a D plane as,  Y =Mx +C, where Y is a dependent variable and X is Independent Variable, C is Intercept and M is slope and same can be expressed as Y is a Function of X or Y = F(x).

At any given value of X, one can compute the value of Y, using the equation of Line. This relation between Y and X, with a degree of the polynomial as is called Linear Regression.

In Predictive Modeling, LR is represented as Y = Bo + Bx + Bx
The value of B and B determines the strength of the correlation between features and the dependent variable.

Example. Stock Value in $ = Intercept + (+/-B)*(Opening value of Stock) + (+/-B)*(Previous Day Highest value of Stock)

Differentiate between regression and classification.

Regression and classification are categorized under the same umbrella of supervised machine learning. The main difference between them is that the output variable in the regression is numerical (or continuous) while that for classification is categorical (or discrete).

Example. To predict the definite Temperature of a place is Regression problem whereas predicting whether the day will be Sunny cloudy or there will be rain is a case of classification.

What is target imbalance? How do we fix it? A scenario where you have performed target imbalance on data. Which metrics and algorithms do you find suitable to input this data onto? 

If you have categorical variables as the target when you cluster them together or perform a frequency count on them if there are certain categories which are more in number as compared to others by a very significant number. This is known as the target imbalance.

Example. Target column – ,,,,,,,,, [s. %, . %, .%] are in majority. To fix this, we can perform up-sampling or down-sampling. Before fixing this problem let’s assume that the performance metrics used was confusion metrics. After fixing this problem we can shift the metric system to AUC. ROC. Since we added/deleted data [up sampling or downsampling], we can go ahead with a stricter algorithm like SVM, Gradient boosting or ADA boosting.

List all assumptions for data to be met before starting with linear regression.

Before starting linear regression, the assumptions to be met are as follow.

  • Linear relationship
  • Multivariate normality
  • No or little multicollinearity
  • No auto-correlation
  • Homoscedasticity

When does the linear regression line stop rotating or finds an optimal spot where it is fitted on data? 

A place where the highest RSquared value is found, is the place where the line comes to rest. RSquared represents the amount of variance captured by the virtual linear regression line with respect to the total variance captured by the dataset.

Why is logistic regression a type of classification technique and not a regression? Name the function it is derived from? 

Since the target column is categorical, it uses linear regression to create an odd function that is wrapped with a log function to use regression as a classifier. Hence, it is a type of classification technique and not a regression. It is derived from cost function.

What could be the issue when the beta value for a certain variable varies way too much in each subset when regression is run on different subsets of the given dataset?

Variations in the beta values in every subset implies that the dataset is heterogeneous. To overcome this problem, we can use a different model for each of the clustered subsets of the dataset or use a non-parametric model such as decision trees.

What does the term Variance Inflation Factor mean?

Variation Inflation Factor (VIF) is the ratio of variance of the model to variance of the model with only one independent variable. VIF gives the estimate of volume of multicollinearity in a set of many regression variables.

VIF = Variance of model Variance of model with one independent variable

Which machine learning algorithm is known as the lazy learner and why is it called so?

KNN is a Machine Learning algorithm known as a lazy learner. K-NN is a lazy learner because it doesn’t learn any machine learnt values or variables from the training data but dynamically calculates distance every time it wants to classify, hence memorises the training dataset instead.

Is it possible to use KNN for image processing? 

Yes, it is possible to use KNN for image processing. It can be done by converting the -dimensional image into a single-dimensional vector and using the same as input to KNN.

Differentiate between K-Means and KNN algorithms?

KNN is Supervised Learning where-as K-Means is Unsupervised Learning. With KNN, we predict the label of the unidentified element based on its nearest neighbour and further extend this approach for solving classification/regression-based problems.

K-Means is Unsupervised Learning, where we don’t have any Labels present, in other words, no Target Variables and thus we try to cluster the data based upon their coordinates and try to establish the nature of the cluster based on the elements filtered for that cluster.

How does the SVM algorithm deal with self-learning? 

SVM has a learning rate and expansion rate which takes care of this. The learning rate compensates or penalizes the hyperplanes for making all the wrong moves and expansion rate deals with finding the maximum separation area between classes.

What are Kernels in SVM? List popular kernels used in SVM along with a scenario of their applications.

The function of kernel is to take data as input and transform it into the required form. A few popular Kernels used in SVM are as follows. RBF, Linear, Sigmoid, Polynomial, Hyperbolic, Laplace, etc.

What is Kernel Trick in an SVM Algorithm?

Kernel Trick is a mathematical function which when applied on data points, can find the region of classification between two different classes. Based on the choice of function, be it linear or radial, which purely depends upon the distribution of data, one can build a classifier.

What are ensemble models? Explain how ensemble techniques yield better learning as compared to traditional classification ML algorithms? 

Ensemble is a group of models that are used together for prediction both in classification and regression class. Ensemble learning helps improve ML results because it combines several models. By doing so, it allows a better predictive performance compared to a single model.
They are superior to individual models as they reduce variance, average out biases, and have lesser chances of overfitting.

What are overfitting and underfitting? Why does the decision tree algorithm suffer often with overfitting problem?

Overfitting is a statistical model or machine learning algorithm which captures the noise of the data. Underfitting is a model or machine learning algorithm which does not fit the data well enough and occurs if the model or algorithm shows low variance but high bias.

In decision trees, overfitting occurs when the tree is designed to perfectly fit all samples in the training data set. This results in branches with strict rules or sparse data and affects the accuracy when predicting samples that aren’t part of the training set.

What is OOB error and how does it occur? 

For each bootstrap sample, there is one-third of data that was not used in the creation of the tree, i.e., it was out of the sample. This data is referred to as out of bag data. In order to get an unbiased measure of the accuracy of the model over test data, out of bag error is used. The out of bag data is passed for each tree is passed through that tree and the outputs are aggregated to give out of bag error. This percentage error is quite effective in estimating the error in the testing set and does not require further cross-validation.

Why boosting is a more stable algorithm as compared to other ensemble algorithms? 

Boosting focuses on errors found in previous iterations until they become obsolete. Whereas in bagging there is no corrective loop. This is why boosting is a more stable algorithm compared to other ensemble algorithms.

How do you handle outliers in the data?

Outlier is an observation in the data set that is far away from other observations in the data set. We can discover outliers using tools and functions like box plot, scatter plot, Z-Score, IQR score etc. and then handle them based on the visualization we have got. To handle outliers, we can cap at some threshold, use transformations to reduce skewness of the data and remove outliers if they are anomalies or errors.

List popular cross validation techniques.

There are mainly six types of cross validation techniques. They are as follow.

  • K fold
  • Stratified k fold
  • Leave one out
  • Bootstrapping
  • Random search cv
  • Grid search cv

Is it possible to test for the probability of improving model accuracy without cross-validation techniques? If yes, please explain.

Yes, it is possible to test for the probability of improving model accuracy without cross-validation techniques. We can do so by running the ML model for say n number of iterations, recording the accuracy. Plot all the accuracies and remove the % of low probability values. Measure the left [low] cut off and right [high] cut off. With the remaining % confidence, we can say that the model can go as low or as high [as mentioned within cut off points].

Name a popular dimensionality reduction algorithm.

Popular dimensionality reduction algorithms are Principal Component Analysis and Factor Analysis.
Principal Component Analysis creates one or more index variables from a larger set of measured variables. Factor Analysis is a model of the measurement of a latent variable. This latent variable cannot be measured with a single variable and is seen through a relationship it causes in a set of y variables.

How can we use a dataset without the target variable into supervised learning algorithms? 

Input the data set into a clustering algorithm, generate optimal clusters, label the cluster numbers as the new target variable. Now, the dataset has independent and target variables present. This ensures that the dataset is ready to be used in supervised learning algorithms.

List all types of popular recommendation systems? Name and explain two personalized recommendation systems along with their ease of implementation. 

Popularity based recommendation, content-based recommendation, user-based collaborative filter, and item-based recommendation are the popular types of recommendation systems.
Personalized Recommendation systems are- Content-based recommendation, user-based collaborative filter, and item-based recommendation. User-based collaborative filter and item-based recommendations are more personalized. Ease to maintain. Similarity matrix can be maintained easily with Item-based recommendation.

How do we deal with sparsity issues in recommendation systems? How do we measure its effectiveness? Explain. 

Singular value decomposition can be used to generate the prediction matrix. RMSE is the measure that helps us understand how close the prediction matrix is to the original matrix.

Name and define techniques used to find similarities in the recommendation system. 

Pearson correlation and Cosine correlation are techniques used to find similarities in recommendation systems.

State the limitations of Fixed Basis Function.

Linear separability in feature space doesn’t imply linear separability in input space. So, Inputs are non-linearly transformed using vectors of basic functions with increased dimensionality. Limitations of Fixed basis functions are.

  1. Non-Linear transformations cannot remove overlap between two classes but they can increase overlap.
  2. Often it is not clear which basis functions are the best fit for a given task. So, learning the basic functions can be useful over using fixed basis functions.
  3. If we want to use only fixed ones, we can use a lot of them and let the model figure out the best fit but that would lead to overfitting the model thereby making it unstable.

Define and explain the concept of Inductive Bias with some examples.

Inductive Bias is a set of assumptions that humans use to predict outputs given inputs that the learning algorithm has not encountered yet. When we are trying to learn Y from X and the hypothesis space for Y is infinite, we need to reduce the scope by our beliefs/assumptions about the hypothesis space which is also called inductive bias. Through these assumptions, we constrain our hypothesis space and also get the capability to incrementally test and improve on the data using hyper-parameters. Examples.

  1. We assume that Y varies linearly with X while applying Linear regression.
  2. We assume that there exists a hyperplane separating negative and positive examples.

Explain the term instance-based learning.

Instance Based Learning is a set of procedures for regression and classification which produce a class label prediction based on resemblance to its nearest neighbors in the training data set. These algorithms just collect all the data and get an answer when required or queried. In simple words they are a set of procedures for solving new problems based on the solutions of already solved problems in the past which are similar to the current problem.

Keeping train and test split criteria in mind, is it good to perform scaling before the split or after the split? 

Scaling should be done post-train and test split ideally. If the data is closely packed, then scaling post or pre-split should not make much difference.

Define precision, recall and F Score?

The metric used to access the performance of the classification model is Confusion Metric. Confusion Metric can be further interpreted with the following terms. –

True Positives (TP) – These are the correctly predicted positive values. It implies that the value of the actual class is yes and the value of the predicted class is also yes.

True Negatives (TN) – These are the correctly predicted negative values. It implies that the value of the actual class is no and the value of the predicted class is also no.

False positives and false negatives, these values occur when your actual class contradicts with the predicted class.

Now,
Recall, also known as Sensitivity is the ratio of true positive rate (TP), to all observations in actual class – yes
Recall = TP/(TP+FN)

Precision is the ratio of positive predictive value, which measures the amount of accurate positives model predicted viz a viz number of positives it claims.
Precision = TP/(TP+FP)

Accuracy is the most intuitive performance measure and it is simply a ratio of correctly predicted observation to the total observations.
Accuracy = (TP+TN)/(TP+FP+FN+TN)

F Score is the weighted average of Precision and Recall. Therefore, this score takes both false positives and false negatives into account. Intuitively it is not as easy to understand as accuracy, but F is usually more useful than accuracy, especially if you have an uneven class distribution. Accuracy works best if false positives and false negatives have a similar cost. If the cost of false positives and false negatives are very different, it’s better to look at both Precision and Recall.

Plot validation score and training score with data set size on the x-axis and another plot with model complexity on the x-axis.

For high bias in the models, the performance of the model on the validation data set is similar to the performance on the training data set. For high variance in the models, the performance of the model on the validation set is worse than the performance on the training set.

What is Bayes’ Theorem? State at least use case with respect to the machine learning context?

Bayes’ Theorem describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For example, if cancer is related to age, then, using Bayes’ theorem, a person’s age can be used to more accurately assess the probability that they have cancer than can be done without the knowledge of the person’s age.
Chain rule for Bayesian probability can be used to predict the likelihood of the next word in the sentence.

What is Naive Bayes? Why is it Naive?

Naive Bayes classifiers are a series of classification algorithms that are based on the Bayes theorem. This family of algorithm shares a common principle which treats every pair of features independently while being classified.

Naive Bayes is considered Naive because the attributes in it (for the class) is independent of others in the same class.  This lack of dependence between two attributes of the same class creates the quality of naiveness.

Explain how a Naive Bayes Classifier works.

Naive Bayes classifiers are a family of algorithms which are derived from the Bayes theorem of probability. It works on the fundamental assumption that every set of two features that is being classified is independent of each other and every feature makes an equal and independent contribution to the outcome.

What do the terms prior probability and marginal likelihood in context of Naive Bayes theorem mean?

Prior probability is the percentage of dependent binary variables in the data set. If you are given a dataset and dependent variable is either or and percentage of is % and percentage of is %. Then, the probability that any new input for that variable of being would be %.

Marginal likelihood is the denominator of the Bayes equation and it makes sure that the posterior probability is valid by making its area .

Explain the difference between Lasso and Ridge?

Lasso(L) and Ridge(L) are the regularization techniques where we penalize the coefficients to find the optimum solution. In ridge, the penalty function is defined by the sum of the squares of the coefficients and for the Lasso, we penalize the sum of the absolute values of the coefficients. Another type of regularization method is ElasticNet, it is a hybrid penalizing function of both lasso and ridge.

What’s the difference between probability and likelihood?

Probability is the measure of the likelihood that an event will occur that is, what is the certainty that a specific event will occur? Where-as a likelihood function is a function of parameters within the parameter space that describes the probability of obtaining the observed data.
So the fundamental difference is, Probability attaches to possible results; likelihood attaches to hypotheses.

Why would you Prune your tree?

In the context of data science or AIML, pruning refers to the process of reducing redundant branches of a decision tree. Decision Trees are prone to overfitting, pruning the tree helps to reduce the size and minimizes the chances of overfitting. Pruning involves turning branches of a decision tree into leaf nodes and removing the leaf nodes from the original branch. It serves as a tool to perform the tradeoff.

Model accuracy or Model performance? Which one will you prefer and why?

This is a trick question, one should first get a clear idea, what is Model Performance? If Performance means speed, then it depends upon the nature of the application, any application related to the real-time scenario will need high speed as an important feature. Example. The best of Search Results will lose its virtue if the Query results do not appear fast.

If Performance is hinted at Why Accuracy is not the most important virtue – For any imbalanced data set, more than Accuracy, it will be an F score than will explain the business case and in case data is imbalanced, then Precision and Recall will be more important than rest.

List the advantages and limitations of the Temporal Difference Learning Method.

Temporal Difference Learning Method is a mix of Monte Carlo method and Dynamic programming method. Some of the advantages of this method include.

  1. It can learn in every step online or offline.
  2. It can learn from a sequence which is not complete as well.
  3. It can work in continuous environments.
  4. It has lower variance compared to MC method and is more efficient than MC method.

Limitations of TD method are.

  1. It is a biased estimation.
  2. It is more sensitive to initialization.

How would you handle an imbalanced dataset?

Sampling Techniques can help with an imbalanced dataset. There are two ways to perform sampling, Under Sample or Over Sampling.

In Under Sampling, we reduce the size of the majority class to match minority class thus help by improving performance w.r.t storage and run-time execution, but it potentially discards useful information.

For Over Sampling, we up sample the Minority class and thus solve the problem of information loss, however, we get into the trouble of having Overfitting.

There are other techniques as well –
Cluster-Based Over Sampling – In this case, the K-means clustering algorithm is independently applied to minority and majority class instances. This is to identify clusters in the dataset. Subsequently, each cluster is oversampled such that all clusters of the same class have an equal number of instances and all classes have the same size

Synthetic Minority Over-sampling Technique (SMOTE) – A subset of data is taken from the minority class as an example and then new synthetic similar instances are created which are then added to the original dataset. This technique is good for Numerical data points.

Mention some of the EDA Techniques?

Exploratory Data Analysis (EDA) helps analysts to understand the data better and forms the foundation of better models.

Visualization

  • Univariate visualization
  • Bivariate visualization
  • Multivariate visualization

Missing Value Treatment – Replace missing values with Either Mean/Median

Outlier Detection – Use Boxplot to identify the distribution of Outliers, then Apply IQR to set the boundary for IQR

Transformation – Based on the distribution, apply a transformation on the features

Scaling the Dataset – Apply MinMax, Standard Scaler or Z Score Scaling mechanism to scale the data.

Feature Engineering – Need of the domain, and SME knowledge helps Analyst find derivative fields which can fetch more information about the nature of the data

Dimensionality reduction — Helps in reducing the volume of data without losing much information

Mention why feature engineering is important in model building and list out some of the techniques used for feature engineering.

Algorithms necessitate features with some specific characteristics to work appropriately. The data is initially in a raw form. You need to extract features from this data before supplying it to the algorithm. This process is called feature engineering. When you have relevant features, the complexity of the algorithms reduces. Then, even if a non-ideal algorithm is used, results come out to be accurate.

Feature engineering primarily has two goals.

  • Prepare the suitable input data set to be compatible with the machine learning algorithm constraints.
  • Enhance the performance of machine learning models.

Some of the techniques used for feature engineering include Imputation, Binning, Outliers Handling, Log transform, grouping operations, One-Hot encoding, Feature split, Scaling, Extracting date.

Differentiate between Statistical Modeling and Machine Learning?

Machine learning models are about making accurate predictions about the situations, like Foot Fall in restaurants, Stock-Price, etc. where-as, Statistical models are designed for inference about the relationships between variables, as What drives the sales in a restaurant, is it food or Ambience.

Differentiate between Boosting and Bagging?

Bagging and Boosting are variants of Ensemble Techniques.

Bootstrap Aggregation or bagging is a method that is used to reduce the variance for algorithms having very high variance. Decision trees are a particular family of classifiers which are susceptible to having high bias.

Decision trees have a lot of sensitiveness to the type of data they are trained on. Hence generalization of results is often much more complex to achieve in them despite very high fine-tuning. The results vary greatly if the training data is changed in decision trees.

Hence bagging is utilized where multiple decision trees are made which are trained on samples of the original data and the final result is the average of all these individual models.

Boosting is the process of using an n-weak classifier system for prediction such that every weak classifier compensates for the weaknesses of its classifiers. By weak classifier, we imply a classifier which performs poorly on a given data set.

It’s evident that boosting is not an algorithm rather it’s a process. Weak classifiers used are generally logistic regression, shallow decision trees etc.

There are many algorithms which make use of boosting processes but two of them are mainly used. Adaboost and Gradient Boosting and XGBoost.

What is the significance of Gamma and Regularization in SVM?

The gamma defines influence. Low values meaning ‘far’ and high values meaning ‘close’.  If gamma is too large, the radius of the area of influence of the support vectors only includes the support vector itself and no amount of regularization with C will be able to prevent overfitting.  If gamma is very small, the model is too constrained and cannot capture the complexity of the data.

The regularization parameter (lambda) serves as a degree of importance that is given to miss-classifications. This can be used to draw the tradeoff with Overfitting.

Define ROC curve work

The graphical representation of the contrast between true positive rates and the false positive rate at various thresholds is known as the ROC curve. It is used as a proxy for the trade-off between true positives vs the false positives.

What is the difference between a generative and discriminative model?

A generative model learns the different categories of data. On the other hand, a discriminative model will only learn the distinctions between different categories of data. Discriminative models perform much better than the generative models when it comes to classification tasks.

What is shattering a set of points? Explain VC dimension.

In order to shatter a given configuration of points, a classifier must be able to, for all possible assignments of positive and negative for the points, perfectly partition the plane such that positive points are separated from negative points. For a configuration of n points, there are n possible assignments of positive or negative.

When choosing a classifier, we need to consider the type of data to be classified and this can be known by VC dimension of a classifier. It is defined as cardinality of the largest set of points that the classification algorithm i.e. the classifier can shatter. In order to have a VC dimension of at least n, a classifier must be able to shatter a single given configuration of n points.

What are some differences between a linked list and an array?

Arrays and Linked lists are both used to store linear data of similar types. However, there are a few differences between them.

Array Linked List
Elements are well-indexed, making specific element accessing easier Elements need to be accessed in a cumulative manner
Operations (insertion, deletion) are faster in array Linked list takes linear time, making operations a bit slower
Arrays are of fixed size Linked lists are dynamic and flexible
Memory is assigned during compile time in an array Memory is allocated during execution or runtime in Linked list.
Elements are stored consecutively in arrays. Elements are stored randomly in Linked list
Memory utilization is inefficient in the array Memory utilization is efficient in the linked list.

What is the meshgrid () method and the contourf () method? State some usesof both.

The meshgrid( ) function in numpy takes two arguments as input . range of x-values in the grid, range of y-values in the grid whereas meshgrid needs to be built before the contourf( ) function in matplotlib is used which takes in many inputs . x-values, y-values, fitting curve (contour line) to be plotted in grid, colours etc.

Meshgrid () function is used to create a grid using -D arrays of x-axis inputs and y-axis inputs to represent the matrix indexing. Contourf () is used to draw filled contours using the given x-axis inputs, y-axis inputs, contour line, colours etc.

Write a simple code to binarize data.

Conversion of data into binary values on the basis of certain threshold is known as binarizing of data. Values below the threshold are set to and those above the threshold are set to which is useful for feature engineering.

Code.

from sklearn.preprocessing import Binarizer

import pandas

import numpy

names_list = [‘Alaska’, ‘Pratyush’, ‘Pierce’, ‘Sandra’, ‘Soundarya’, ‘Meredith’, ‘Richard’, ‘Jackson’, ‘Tom’,’Joe’]

data_frame = pandas.read_csv(url, names=names_list)

array = dataframe.values

# Splitting the array into input and output

A = array [. .]

B = array [.]

binarizer = Binarizer(threshold=.). fit(X)

binaryA = binarizer.transform(A)

numpy.set_printoptions(precision=)

print (binaryA [..])

What is an Array?

The array is defined as a collection of similar items, stored in a contiguous manner. Arrays is an intuitive concept as the need to group similar objects together arises in our day to day lives. Arrays satisfy the same need. How are they stored in the memory? Arrays consume blocks of data, where each element in the array consumes one unit of memory. The size of the unit depends on the type of data being used. For example, if the data type of elements of the array is int, then bytes of data will be used to store each element. For character data type, byte will be used. This is implementation specific, and the above units may change from computer to computer.

Example.

fruits = [‘apple’, banana’, pineapple’]

In the above case, fruits is a list that comprises of three fruits. To access them individually, we use their indexes. Python and C are – indexed languages, that is, the first index is . MATLAB on the contrary starts from , and thus is a -indexed language.

What are the advantages and disadvantages of using an Array?

Advantages.

  1. Random access is enabled
  2. Saves memory
  3. Cache friendly
  4. Predictable compile timing
  5. Helps in re-usability of code

Disadvantages.

  1. Addition and deletion of records is time consuming even though we get the element of interest immediately through random access. This is due to the fact that the elements need to be reordered after insertion or deletion.
  2. If contiguous blocks of memory are not available in the memory, then there is an overhead on the CPU to search for the most optimal contiguous location available for the requirement.

Now that we know what arrays are, we shall understand them in detail by solving some interview questions. Before that, let us see the functions that Python as a language provides for arrays, also known as, lists.

append() – Adds an element at the end of the list
copy() – returns a copy of a list.
reverse() – reverses the elements of the list
sort() – sorts the elements in ascending order by default.

What is Lists in Python?

Lists is an effective data structure provided in python. There are various functionalities associated with the same. Let us consider the scenario where we want to copy a list to another list. If the same operation had to be done in C programming language, we would have to write our own function to implement the same.

On the contrary, Python provides us with a function called copy. We can copy a list to another just by calling the copy function.

new_list = old_list.copy()

We need to be careful while using the function. copy() is a shallow copy function, that is, it only stores the references of the original list in the new list. If the given argument is a compound data structure like a list then python creates another object of the same type (in this case, a new list) but for everything inside old list, only their reference is copied. Essentially, the new list consists of references to the elements of the older list.

Hence, upon changing the original list, the new list values also change. This can be dangerous in many applications. Therefore, Python provides us with another functionality called as deepcopy.  Intuitively, we may consider that deepcopy() would follow the same paradigm, and the only difference would be that for each element we will recursively call deepcopy. Practically, this is not the case.

deepcopy() preserves the graphical structure of the original compound data. Let us understand this better with the help of an example.

 

import copy.deepcopy

a = [,]

b = [a,a] # there’s only object a

c = deepcopy(b)

 

# check the result by executing these lines

c[] is a # return False, a new object a’ is created

c[] is c[] # return True, c is [a’,a’] not [a’,a”]

This is the tricky part, during the process of deepcopy() a hashtable implemented as a dictionary in python is used to map. old_object reference onto new_object reference.

Therefore, this prevents unnecessary duplicates and thus preserves the structure of the copied compound data structure. Thus, in this case, c[] is not equal to a, as internally their addresses are different.

Normal copy

>>> a = [[, , ], [, , ]]

>>> b = list(a)

>>> a

[[, , ], [, , ]]

>>> b

[[, , ], [, , ]]

>>> a[][] =

>>> a

[[, , ], [, , ]]

>>> b # b changes too -> Not a deepcopy.

[[, , ], [, , ]]

Deep copy

>>> import copy

>>> b = copy.deepcopy(a)

>>> a

[[, , ], [, , ]]

>>> b

[[, , ], [, , ]]

>>> a[][] =

>>> a

[[, , ], [, , ]]

>>> b # b doesn’t change -> Deep Copy

[[, , ], [, , ]]

Now that we have understood the concept of lists, let us solve interview questions to get better exposure on the same.

Given an array of integers where each element represents the max number of steps that can be made forward from that element. The task is to find the minimum number of jumps to reach the end of the array (starting from the first element). If an element is , then cannot move through that element.

Solution. This problem is famously called as end of array problem. We want to determine the minimum number of jumps required in order to reach the end. The element in the array represents the maximum number of jumps that, that particular element can take.

Let us understand how to approach the problem initially.

We need to reach the end. Therefore, let us have a count that tells us how near we are to the end. Consider the array A=[,,,,]

In the above example we can go from

> – > – > – > – jumps

– > – > – > – jumps

– > – > – > – jumps

Hence, we have a fair idea of the problem. Let us come up with a logic for the same.

Let us start from the end and move backwards as that makes more sense intuitionally. We will use variables right and prev_r denoting previous right to keep track of the jumps.

Initially, right = prev_r = the last but one element. We consider the distance of an element to the end, and the number of jumps possible by that element. Therefore, if the sum of the number of jumps possible and the distance is greater than the previous element, then we will discard the previous element and use the second element’s value to jump. Try it out using a pen and paper first. The logic will seem very straight forward to implement. Later, implement it on your own and then verify with the result.

def min_jmp(arr).

n = len(arr)

right = prev_r = n-

count =

# We start from rightmost index and traverse array to find the leftmost index

# from which we can reach index ‘right’

while True.

for j in (range(prev_r-,-,-)).

if j + arr[j] >= prev_r.

right = j

if prev_r != right.

prev_r = right

else.

break

count +=

return count if right == else –

# Enter the elements separated by a space

arr = list(map(int, input().split()))

print(min_jmp(n, arr))

Given a string S consisting only ‘a’s and ‘b’s, print the last index of the ‘b’ present in it.

When we have are given a string of a’s and b’s, we can immediately find out the first location of a character occurring. Therefore, to find the last occurrence of a character, we reverse the string and find the first occurrence, which is equivalent to the last occurrence in the original string.

Here, we are given input as a string. Therefore, we begin by splitting the characters element wise using the function split. Later, we reverse the array, find the first occurrence position value, and get the index by finding the value len – position -, where position is the index value.

def split(word).

return [(char) for char in word]

a = input()

a= split(a)

a_rev = a[..-]

pos = –

for i in range(len(a_rev)).

if a_rev[i] == ‘b’.

pos = len(a_rev)- i –

print(pos)

break

else.

continue

if pos==-.

print(-)

Rotate the elements of an array by d positions to the left. Let us initially look at an example.

A = [,,,,]

A <<

[,,,,]

A<<

[,,,,]

There exists a pattern here, that is, the first d elements are being interchanged with last n-d + elements. Therefore we can just swap the elements. Correct? What if the size of the array is huge, say elements. There are chances of memory error, run-time error etc. Therefore, we do it more carefully. We rotate the elements one by one in order to prevent the above errors, in case of large arrays.

# Rotate all the elements left by position

def rot_left_once ( arr).

n = len( arr)

tmp = arr []

for i in range ( n-). #[,n-]

arr[i] = arr[i + ]

arr[n-] = tmp

# Use the above function to repeat the process for d times.

def rot_left (arr, d).

n = len (arr)

for i in range (d).

rot_left_once ( arr, n)

arr = list( map( int, input().split()))

rot =int( input())

leftRotate ( arr, rot)

for i in range( len(arr)).

print( arr[i], end=’ ‘)

Water Trapping Problem.

Given an array arr[] of N non-negative integers which represents the height of blocks at index I, where the width of each block is . Compute how much water can be trapped in between blocks after raining.

#  Structure is like below.

# | |

# |_|

# answer is we can trap two units of water.

Solution. We are given an array, where each element denotes the height of the block. One unit of height is equal to one unit of water, given there exists space between the elements to store it. Therefore, we need to find out all such pairs that exist which can store water. We need to take care of the possible cases.

  1. There should be no overlap of water saved
  2. Water should not overflow

Therefore, let us find start with the extreme elements, and move towards the centre.

n = int(input())

arr = [int(i) for i in input().split()]

left, right = [arr[]], [] * n

# left =[arr[]]

#right = [ …] n terms

right[n-] = arr[-] # right most element

# we use two arrays left[ ] and right[ ], which keep track of elements greater than all
# elements the order of traversal respectively.

for elem in arr[ . ].

left.append(max(left[-], elem) )

for i in range( len( arr)-, -, -).

right[i] = max( arr[i] , right[i+] )

water =

# once we have the arrays left, and right, we can find the water capacity between these arrays.

for i in range( , n – ).

add_water = min( left[i – ], right[i]) – arr[i]

if add_water > .

water += add_water

print(water)

Explain Eigenvectors and Eigenvalues.

Linear transformations are helpful to understand using eigenvectors. They find their prime usage in the creation of covariance and correlation matrices in data science.

Simply put, eigenvectors are directional entities along which linear transformation features like compression, flip etc. can be applied.

Eigenvalues are the magnitude of the linear transformation features along each direction of an Eigenvector.

How would you define the number of clusters in a clustering algorithm?

The number of clusters can be determined by finding the silhouette score. Often, we aim to get some inferences from data using clustering techniques so that we can have a broader picture of a number of classes being represented by the data. In this case, the silhouette score helps us determine the number of cluster centres to cluster our data along.

Another technique that can be used is the elbow method.

What are the performance metrics that can be used to estimate the efficiency of a linear regression model?

The performance metric that is used in this case is.

  1. Mean Squared Error
  2. R score
  3. Adjusted R score
  4. Mean Absolute score

What is the default method of splitting in decision trees?

The default method of splitting in decision trees is the Gini Index. Gini Index is the measure of impurity of a particular node.

This can be changed by making changes to classifier parameters.

How is p-value useful?

The p-value gives the probability of the null hypothesis is true. It gives us the statistical significance of our results. In other words, p-value determines the confidence of a model in a particular output.

Can logistic regression be used for classes more than ?

No, logistic regression cannot be used for classes more than as it is a binary classifier. For multi-class classification algorithms like Decision Trees, Naïve Bayes’ Classifiers are better suited.

What are the hyperparameters of a logistic regression model?

Classifier penalty, classifier solver and classifier C are the trainable hyperparameters of a Logistic Regression Classifier. These can be specified exclusively with values in Grid Search to hyper tune a Logistic Classifier.

Name a few hyper-parameters of decision trees?

The most important features which one can tune in decision trees are.

  1. Splitting criteria
  2. Min_leaves
  3. Min_samples
  4. Max_depth

How to deal with multicollinearity?

Multi collinearity can be dealt with by the following steps.

  • Remove highly correlated predictors from the model.
  • Use Partial Least Squares Regression (PLS) or Principal Components Analysis,

What is Heteroscedasticity?

It is a situation in which the variance of a variable is unequal across the range of values of the predictor variable.

It should be avoided in regression as it introduces unnecessary variance.

Is ARIMA model a good fit for every time series problem?

No, ARIMA model is not suitable for every type of time series problem. There are situations where ARMA model and others also come in handy.

ARIMA is best when different standard temporal structures require to be captured for time series data.

How do you deal with the class imbalance in a classification problem?

Class imbalance can be dealt with in the following ways.

  1. Using class weights
  2. Using Sampling
  3. Using SMOTE
  4. Choosing loss functions like Focal Loss

What is the role of cross-validation?

Cross-validation is a technique which is used to increase the performance of a machine learning algorithm, where the machine is fed sampled data out of the same data for a few times. The sampling is done so that the dataset is broken into small parts of the equal number of rows, and a random part is chosen as the test set, while all other parts are chosen as train sets.

What is a voting model?

A voting model is an ensemble model which combines several classifiers but to produce the final result, in case of a classification-based model, takes into account, the classification of a certain data point of all the models and picks the most vouched/voted/generated option from all the given classes in the target column.

How to deal with very few data samples? Is it possible to make a model out of it?

If very few data samples are there, we can make use of oversampling to produce new data points. In this way, we can have new data points.

What distance metrics can be used in KNN?

Following distance metrics can be used in KNN.

  • Manhattan
  • Minkowski
  • Tanimoto
  • Jaccard
  • Mahalanobis

Which metrics can be used to measure correlation of categorical data?

Chi square test can be used for doing so. It gives the measure of correlation between categorical predictors.

Which algorithm can be used in value imputation in both categorical and continuous categories of data?

KNN is the only algorithm that can be used for imputation of both categorical and continuous variables.

When should ridge regression be preferred over lasso?

We should use ridge regression when we want to use all predictors and not remove any as it reduces the coefficient values but does not nullify them.

Which algorithms can be used for important variable selection?

Random Forest, Xgboost and plot variable importance charts can be used for variable selection.

What ensemble technique is used by Random forests?

Bagging is the technique used by Random Forests. Random forests are a collection of trees which work on sampled data from the original dataset with the final prediction being a voted average of all trees.

What ensemble technique is used by gradient boosting trees?

Boosting is the technique used by GBM.

If we have a high bias error what does it mean? How to treat it?

High bias error means that that model we are using is ignoring all the important trends in the model and the model is underfitting.

To reduce underfitting.

  • We need to increase the complexity of the model
  • Number of features need to be increased

Sometimes it also gives the impression that the data is noisy. Hence noise from data should be removed so that most important signals are found by the model to make effective predictions.

Increasing the number of epochs results in increasing the duration of training of the model. It’s helpful in reducing the error.

Which type of sampling is better for a classification model and why?

Stratified sampling is better in case of classification problems because it takes into account the balance of classes in train and test sets. The proportion of classes is maintained and hence the model performs better. In case of random sampling of data, the data is divided into two parts without taking into consideration the balance classes in the train and test sets. Hence some classes might be present only in tarin sets or validation sets. Hence the results of the resulting model are poor in this case.

What is a good metric for measuring the level of multicollinearity?

VIF or /tolerance is a good measure of measuring multicollinearity in models. VIF is the percentage of the variance of a predictor which remains unaffected by other predictors. So higher the VIF value, greater is the multicollinearity amongst the predictors.

rule of thumb for interpreting the variance inflation factor.

  • = not correlated.
  • Between and = moderately correlated.
  • Greater than = highly correlated.

When can be a categorical value treated as a continuous variable and what effect does it have when done so?

A categorical predictor can be treated as a continuous one when the nature of data points it represents is ordinal. If the predictor variable is having ordinal data then it can be treated as continuous and its inclusion in the model increases the performance of the model.

What is the role of maximum likelihood in logistic regression.

Maximum likelihood equation helps in estimation of most probable values of the estimator’s predictor variable coefficients which produces results which are the most likely or most probable and are quite close to the truth values.

Which distance do we measure in the case of KNN?

The hamming distance is measured in case of KNN for the determination of nearest neighbours. Kmeans uses euclidean distance.

What is a pipeline?

A pipeline is a sophisticated way of writing software such that each intended action while building a model can be serialized and the process calls the individual functions for the individual tasks. The tasks are carried out in sequence for a given sequence of data points and the entire process can be run onto n threads by use of composite estimators in scikit learn.

Which sampling technique is most suitable when working with time-series data?

We can use a custom iterative sampling such that we continuously add samples to the train set. We only should keep in mind that the sample used for validation should be added to the next train sets and a new sample is used for validation.

What are the benefits of pruning?

Pruning helps in the following.

  1. Reduces overfitting
  2. Shortens the size of the tree
  3. Reduces complexity of the model
  4. Increases bias

What is normal distribution?

The distribution having the below properties is called normal distribution.

  • The mean, mode and median are all equal.
  • The curve is symmetric at the center (i.e. around the mean, μ).
  • Exactly half of the values are to the left of center and exactly half the values are to the right.
  • The total area under the curve is .

What is the per cent rule in normal distribution?

The normal distribution is a bell-shaped curve. Most of the data points are around the median. Hence approximately  per cent of the data is around the median. Since there is no skewness and its bell-shaped.

What is a chi-square test?

A chi-square determines if a sample data matches a population.

A chi-square test for independence compares two variables in a contingency table to see if they are related.

A very small chi-square test statistics implies observed data fits the expected data extremely well.

What is a random variable?

A Random Variable is a set of possible values from a random experiment. Example. Tossing a coin. we could get Heads or Tails. Rolling of a dice. we get values

What is the degree of freedom?

It is the number of independent values or quantities which can be assigned to a statistical distribution. It is used in Hypothesis testing and chi-square test.

Which kind of recommendation system is used by amazon to recommend similar items?

Amazon uses a collaborative filtering algorithm for the recommendation of similar items. It’s a user-to-user similarity-based mapping of user likeness and susceptibility to buy.

What’s the difference between Type I and Type II error?

Type I and Type II error in machine learning refers to false values. Type I is equivalent to a False positive while Type II is equivalent to a False negative. In Type I error, a hypothesis which ought to be accepted doesn’t get accepted. Similarly, for Type II error, the hypothesis gets rejected which should have been accepted in the first place.

What do you understand by L and L regularization?

L regularization. It tries to spread error among all the terms. L corresponds to a Gaussian prior.

L regularization. It is more binary/sparse, with many variables either being assigned a or in weighting. L corresponds to setting a Laplacian prior on the terms.

Which one is better, Naive Bayes Algorithm or Decision Trees?

Although it depends on the problem you are solving, but some general advantages are following.

Naive Bayes.

  • Work well with small dataset compared to DT which need more data
  • Lesser overfitting
  • Smaller in size and faster in processing

Decision Trees.

  • Decision Trees are very flexible, easy to understand, and easy to debug
  • No preprocessing or transformation of features required
  • Prone to overfitting but you can use pruning or Random forests to avoid that.

What do you mean by AUC curve?

AUC (area under curve). Higher the area under the curve, better the prediction power of the model.

What is log likelihood in logistic regression?

It is the sum of the likelihood residuals. At record level, the natural log of the error (residual) is calculated for each record, multiplied by minus one, and those values are totaled. That total is then used as the basis for deviance ( x ll) and likelihood (exp(ll)).

The same calculation can be applied to a naive model that assumes absolutely no predictive power, and a saturated model assuming perfect predictions.

The likelihood values are used to compare different models, while the deviances (test, naive, and saturated) can be used to determine the predictive power and accuracy. Logistic regression accuracy of the model will always be percent for the development data set, but that is not the case once a model is applied to another data set.

How would you evaluate a logistic regression model?

Model Evaluation is a very important part in any analysis to answer the following questions,

How well does the model fit the data? Which predictors are most important? Are the predictions accurate?

So, the following are the criterion to access the model performance,

Akaike Information Criteria (AIC). In simple terms, AIC estimates the relative amount of information lost by a given model. So, the less information lost the higher the quality of the model. Therefore, we always prefer models with minimum AIC.

Receiver operating characteristics (ROC curve). ROC curve illustrates the diagnostic ability of a binary classifier. It is calculated/ created by plotting True Positive against False Positive at various threshold settings. The performance metric of ROC curve is AUC (area under curve). Higher the area under the curve, better the prediction power of the model.

Confusion Matrix. In order to find out how well the model does in predicting the target variable, we use a confusion matrix/ classification rate. It is nothing but a tabular representation of actual Vs predicted values which helps us to find the accuracy of the model.

What are the advantages of SVM algorithms?

SVM algorithms have basically advantages in terms of complexity. First I would like to clear that both Logistic regression as well as SVM can form nonlinear decision surfaces and can be coupled with the kernel trick. If Logistic regression can be coupled with kernel then why use SVM?

  • SVM is found to have better performance practically in most cases.
  • SVM is computationally cheaper O(N^*K) where K is no of support vectors (support vectors are those points that lie on the class margin) whereas logistic regression is O(N^)
  • Classifier in SVM depends only on a subset of points. Since we need to maximize distance between closest points of two classes (aka margin) we need to care about only a subset of points unlike logistic regression.

What are support vector machines?

Support vector machines are supervised learning algorithms used for classification and regression analysis.

What are the components of relational evaluation techniques?

The important components of relational evaluation techniques are

  • Data Acquisition
  • Ground Truth Acquisition
  • Cross Validation Technique
  • Query Type
  • Scoring Metric
  • Significance Test

What are the different methods for Sequential Supervised Learning?

The different methods to solve Sequential Supervised Learning problems are

  • Sliding-window methods
  • Recurrent sliding windows
  • Hidden Markow models
  • Maximum entropy Markow models
  • Conditional random fields
  • Graph transformer networks

What are the areas in robotics and information processing where sequential prediction problem arises?

The areas in robotics and information processing where sequential prediction problem arises are

  • Imitation Learning
  • Structured prediction
  • Model based reinforcement learning

What is batch statistical learning?

Statistical learning techniques allow learning a function or predictor from a set of observed data that can make predictions about unseen or future data. These techniques provide guarantees on the performance of the learned predictor on the future unseen data based on a statistical assumption on the data generating process.

What is PAC Learning?

PAC (Probably Approximately Correct) learning is a learning framework that has been introduced to analyze learning algorithms and their statistical efficiency.

What are the different categories you can categorized the sequence learning process?

  • Sequence prediction
  • Sequence generation
  • Sequence recognition
  • Sequential decision

What is sequence learning?

Sequence learning is a method of teaching and learning in a logical manner.

What are two techniques of Machine Learning?

The two techniques of Machine Learning are

  • Genetic Programming
  • Inductive Learning

Give a popular application of machine learning that you see on day-to-day basis?

The recommendation engine implemented by major ecommerce websites uses Machine Learning.

What do you think of our current data process?

This kind of question requires you to listen carefully and impart feedback in a manner that is constructive and insightful. Your interviewer is trying to gauge if you’d be a valuable member of their team and whether you grasp the nuances of why certain things are set the way they are in the company’s data process based on company or industry-specific conditions. They’re trying to see if you can be an intellectual peer. Act accordingly.

Why does XGBoost perform better than SVM?

First reason is that XGBoost is an ensemble method that uses many trees to make a decision so it gains power by repeating itself.

SVM is a linear separator, when data is not linearly separable SVM needs a Kernel to project the data into a space where it can separate it, there lies its greatest strength and weakness, by being able to project data into a high dimensional space SVM can find a linear separation for almost any data but at the same time it needs to use a Kernel and we can argue that there’s not a perfect kernel for every dataset.

What is the difference between SVM Rank and SVR (Support Vector Regression)?

One is used for ranking and the other is used for regression.

There is a crucial difference between regression and ranking. In regression, the absolute value is crucial. A real number is predicted.

In ranking, the only thing of concern is the ordering of a set of examples. We only want to know which example has the highest rank, which one has the second-highest, and so on. From the data, we only know that example should be ranked higher than example , which in turn should be ranked higher than example , and so on. We do not know by how much example is ranked higher than example , or whether this difference is bigger than the difference between examples and .

What is the difference between the normal soft margin SVM and SVM with a linear kernel?

Hard-margin

You have the basic SVM – hard margin. This assumes that data is very well behaved, and you can find a perfect classifier – which will have error on train data.

Soft-margin

Data is usually not well behaved, so SVM hard margins may not have a solution at all. So we allow for a little bit of error on some points. So the training error will not be , but average error over all points is minimized.

Kernels

The above assume that the best classifier is a straight line. But what is it is not a straight line. (e.g. it is a circle, inside a circle is one class, outside is another class). If we are able to map the data into higher dimensions – the higher dimension may give us a straight line.

How is linear classifier relevant to SVM?

An svm is a type of linear classifier. If you don’t mess with kernels, it’s arguably the most simple type of linear classifier.

Linear classifiers (all?) learn linear fictions from your data that map your input to scores like so. scores = Wx + b. Where W is a matrix of learned weights, b is a learned bias vector that shifts your scores, and x is your input data. This type of function may look familiar to you if you remember y = mx + b from high school.

A typical svm loss function (the function that tells you how good your calculated scores are in relation to the correct labels) would be hinge loss. It takes the form. Loss = sum over all scores except the correct score of max (, scores – scores(correct class) + ).

What are the advantages of using a naive Bayes for classification?

  • Very simple, easy to implement and fast.
  • If the NB conditional independence assumption holds, then it will converge quicker than discriminative models like logistic regression.
  • Even if the NB assumption doesn’t hold, it works great in practice.
  • Need less training data.
  • Highly scalable. It scales linearly with the number of predictors and data points.
  • Can be used for both binary and multiclass classification problems.
  • Can make probabilistic predictions.
  • Handles continuous and discrete data.
  • Not sensitive to irrelevant features.

Are Gaussian Naive Bayes the same as binomial Naive Bayes?

Binomial Naive Bayes. It assumes that all our features are binary such that they take only two values. Means s can represent “word does not occur in the document” and s as “word occurs in the document”.

Gaussian Naive Bayes. Because of the assumption of the normal distribution, Gaussian Naive Bayes is used in cases when all our features are continuous. For example, in Iris dataset features are sepal width, petal width, sepal length, petal length. So its features can have different values in the data set as width and length can vary. We can’t represent features in terms of their occurrences. This means data is continuous. Hence, we use Gaussian Naive Bayes here.

What is the difference between the Naive Bayes Classifier and the Bayes classifier?

Naive Bayes assumes conditional independence, P(X|Y, Z)=P(X|Z)

P(X|Y,Z)=P(X|Z)

P(X|Y,Z)=P(X|Z), Whereas more general Bayes Nets (sometimes called Bayesian Belief Networks), will allow the user to specify which attributes are, in fact, conditionally independent.

For the Bayesian network as a classifier, the features are selected based on some scoring functions like Bayesian scoring function and minimal description length (the two are equivalent in theory to each other given that there is enough training data). The scoring functions mainly restrict the structure (connections and directions) and the parameters(likelihood) using the data. After the structure has been learned the class is only determined by the nodes in the Markov blanket (its parents, its children, and the parents of its children), and all variables given the Markov blanket are discarded.

In what real-world applications is Naive Bayes classifier used?

Some of real-world examples are as given below

  • To mark an email as spam, or not spam?
  • Classify a news article about technology, politics, or sports?
  • Check a piece of text expressing positive emotions, or negative emotions?
  • Also used for face recognition software

Is naive Bayes supervised or unsupervised?

First, Naive Bayes is not one algorithm but a family of Algorithms that inherits the following attributes.

.Discriminant Functions

.Probabilistic Generative Models

.Bayesian Theorem

.Naive Assumptions of Independence and Equal Importance of feature vectors.

Moreover, it is a special type of Supervised Learning algorithm that could do simultaneous multi-class predictions (as depicted by standing topics in many news apps).

Since these are generative models, so based upon the assumptions of the random variable mapping of each feature vector these may even be classified as Gaussian Naive Bayes, Multinomial Naive Bayes, Bernoulli Naive Bayes, etc.

What do you understand by selection bias in Machine Learning?

Selection bias stands for the bias which was introduced by the selection of individuals, groups or data for doing analysis in a way that the proper randomization is not achieved. It ensures that the sample obtained is not representative of the population intended to be analyzed and sometimes it is referred to as the selection effect. This is the part of distortion of a statistical analysis which results from the method of collecting samples. If you don’t take the selection bias into the account then some conclusions of the study may not be accurate.

The types of selection bias include.

  1. Sampling bias. It is a systematic error due to a non-random sample of a population causing some members of the population to be less likely to be included than others resulting in a biased sample.
  2. Time interval. A trial may be terminated early at an extreme value (often for ethical reasons), but the extreme value is likely to be reached by the variable with the largest variance, even if all variables have a similar mean.
  3. Data. When specific subsets of data are chosen to support a conclusion or rejection of bad data on arbitrary grounds, instead of according to previously stated or generally agreed criteria.
  4. Attrition. Attrition bias is a kind of selection bias caused by attrition (loss of participants) discounting trial subjects/tests that did not run to completion.

What do you understand by Precision and Recall?

In pattern recognition, the information retrieval and classification in machine learning are part of precision. It is also called as positive predictive value which is the fraction of relevant instances among the retrieved instances.

Recall is also known as sensitivity and the fraction of the total amount of relevant instances which were actually retrieved.

Both precision and recall are therefore based on an understanding and measure of relevance.

What Are the Three Stages of Building a Model in Machine Learning?

To build a model in machine learning, you need to follow few steps.

  1. Understand the business model
  2. Data acquisitions
  3. Data cleaning
  4. Exploratory data analysis
  5. Use machine learning algorithms to make a model
  6. Use unknown dataset to check the accuracy of the model

How Do You Design an Email Spam Filter in Machine Learning?

  1. Understand the business model. Try to understand the related attributes for the spam mail
  2. Data acquisitions. Collect the spam mail to read the hidden pattern from them
  3. Data cleaning. Clean the unstructured or semi structured data
  4. Exploratory data analysis. Use statistical concepts to understand the data like spread, outlier, etc.
  5. Use machine learning algorithms to make a model. can use naive bayes or some other algorithms as well
  6. Use unknown dataset to check the accuracy of the model

What is the difference between Entropy and Information Gain?

The information gain is based on the decrease in entropy after a dataset is split on an attribute. Constructing a decision tree is all about finding the attribute that returns the highest information gain (i.e., the most homogeneous branches). Step . Calculate entropy of the target.

What are collinearity and multicollinearity?

Collinearity is a linear association between two predictors. Multicollinearity is a situation where two or more predictors are highly linearly related.

What is Kernel SVM?

SVM algorithms have basically advantages in terms of complexity. First I would like to clear that both Logistic regression as well as SVM can form non linear decision surfaces and can be coupled with the kernel trick. If Logistic regression can be coupled with kernel then why use SVM?

  • SVM is found to have better performance practically in most cases.
  • SVM is computationally cheaper O(N^*K) where K is no of support vectors (support vectors are those points that lie on the class margin) where as logistic regression is O(N^)
  • Classifier in SVM depends only on a subset of points . Since we need to maximize distance between closest points of two classes (aka margin) we need to care about only a subset of points unlike logistic regression.

What is the process of carrying out a linear regression?

Linear Regression Analysis consists of more than just fitting a linear line through a cloud of data points. It consists of stages–

() analyzing the correlation and directionality of the data,

() estimating the model, i.e., fitting the line,

and () evaluating the validity and usefulness of the model.

What Are the Different Types of Machine Learning?

There are three types of machine learning.

Supervised Learning

In supervised machine learning, a model makes predictions or decisions based on past or labeled data. Labeled data refers to sets of data that are given tags or labels, and thus made more meaningful.

Unsupervised Learning

In unsupervised learning, we don’t have labeled data. A model can identify patterns, anomalies, and relationships in the input data.

Reinforcement Learning

Using reinforcement learning, the model can learn based on the rewards it received for its previous action.

Consider an environment where an agent is working. The agent is given a target to achieve. Every time the agent takes some action toward the target, it is given positive feedback. And, if the action taken is going away from the goal, the agent is given negative feedback.

What is ‘training Set’ and ‘test Set’ in a Machine Learning Model? How Much Data Will You Allocate for Your Training, Validation, and Test Sets?

There is a three-step process followed to create a model.

  1. Train the model
  2. Test the model
  3. Deploy the model
Training Set Test Set
  • The training set is examples given to the model to analyze and learn
  • % of the total data is typically taken as the training dataset
  • This is labeled data used to train the model
  • The test set is used to test the accuracy of the hypothesis generated by the model
  • Remaining % is taken as testing dataset
  • We test without labeled data and then verify results with labels

Consider a case where you have labeled data for , records. One way to train the model is to expose all , records during the training process. Then you take a small set of the same data to test the model, which would give good results in this case.

But, this is not an accurate way of testing. So, we set aside a portion of that data called the ‘test set’ before starting the training process. The remaining data is called the ‘training set’ that we use for training the model. The training set passes through the model multiple times until the accuracy is high, and errors are minimized.

Now, we pass the test data to check if the model can accurately predict the values and determine if training is effective. If you get errors, you either need to change your model or retrain it with more data.

Regarding the question of how to split the data into a training set and test set, there is no fixed rule, and the ratio can vary based on individual preferences.

How Do You Handle Missing or Corrupted Data in a Dataset?

One of the easiest ways to handle missing or corrupted data is to drop those rows or columns or replace them entirely with some other value.

There are two useful methods in Pandas.

  • IsNull() and dropna() will help to find the columns/rows with missing data and drop them
  • Fillna() will replace the wrong values with a placeholder value

How Can You Choose a Classifier Based on a Training Set Data Size?

When the training set is small, a model that has a right bias and low variance seems to work better because they are less likely to overfit.

For example, Naive Bayes works best when the training set is large. Models with low bias and high variance tend to perform better as they work fine with complex relationships.

What Are the Three Stages of Building a Model in Machine Learning?

The three stages of building a machine learning model are.

Model Building

Choose a suitable algorithm for the model and train it according to the requirement

Model Testing

Check the accuracy of the model through the test data

Applying the Model

Make the required changes after testing and use the final model for real-time projects

Here, it’s important to remember that once in a while, the model needs to be checked to make sure it’s working correctly. It should be modified to make sure that it is up-to-date.

What is Deep Learning?

Deep learning is a subset of machine learning that involves systems that think and learn like humans using artificial neural networks. The term ‘deep’ comes from the fact that you can have several layers of neural networks.

One of the primary differences between machine learning and deep learning is that feature engineering is done manually in machine learning. In the case of deep learning, the model consisting of neural networks will automatically determine which features to use (and which not to use).

What Are the Applications of Supervised Machine Learning in Modern Businesses?

Applications of supervised machine learning include.

Email Spam Detection

Here we train the model using historical data that consists of emails categorized as spam or not spam. This labeled information is fed as input to the model.

Healthcare Diagnosis

By providing images regarding a disease, a model can be trained to detect if a person is suffering from the disease or not.

Sentiment Analysis

This refers to the process of using algorithms to mine documents and determine whether they’re positive, neutral, or negative in sentiment.

Fraud Detection

Training the model to identify suspicious patterns, we can detect instances of possible fraud.

What is Semi-supervised Machine Learning?

Supervised learning uses data that is completely labeled, whereas unsupervised learning uses no training data.

In the case of semi-supervised learning, the training data contains a small amount of labeled data and a large amount of unlabeled data.

What Are Unsupervised Machine Learning Techniques? 

There are two techniques used in unsupervised learning. clustering and association.

Clustering

Clustering problems involve data to be divided into subsets. These subsets, also called clusters, contain data that are similar to each other. Different clusters reveal different details about the objects, unlike classification or regression.

Association

In an association problem, we identify patterns of associations between different variables or items.

For example, an e-commerce website can suggest other items for you to buy, based on the prior purchases that you have made, spending habits, items in your wishlist, other customers’ purchase habits, and so on.

What is the Difference Between Supervised and Unsupervised Machine Learning?

  • Supervised learning – This model learns from the labeled data and makes a future prediction as output
  • Unsupervised learning – This model uses unlabeled input data and allows the algorithm to act on that information without guidance.

Explain How a System Can Play a Game of Chess Using Reinforcement Learning.

Reinforcement learning has an environment and an agent. The agent performs some actions to achieve a specific goal. Every time the agent performs a task that is taking it towards the goal, it is rewarded. And, every time it takes a step which goes against that goal or in reverse direction, it is penalized.

Earlier, chess programs had to determine the best moves after much research on numerous factors. Building a machine designed to play such games would require many rules to be specified.

With reinforced learning, we don’t have to deal with this problem as the learning agent learns by playing the game. It will make a move (decision), check if it’s the right move (feedback), and keep the outcomes in memory for the next step it takes (learning). There is a reward for every correct decision the system takes and punishment for the wrong one.

How Will You Know Which Machine Learning Algorithm to Choose for Your Classification Problem?

While there is no fixed rule to choose an algorithm for a classification problem, you can follow these guidelines.

  • If accuracy is a concern, test different algorithms and cross-validate them
  • If the training dataset is small, use models that have low variance and high bias
  • If the training dataset is large, use models that have high variance and little bias

How is Amazon Able to Recommend Other Things to Buy? How Does the Recommendation Engine Work?

Once a user buys something from Amazon, Amazon stores that purchase data for future reference and finds products that are most likely also to be bought, it is possible because of the Association algorithm, which can identify patterns in a given dataset.

When Will You Use Classification over Regression?

Classification is used when your target is categorical, while regression is used when your target variable is continuous. Both classification and regression belong to the category of supervised machine learning algorithms.

Examples of classification problems include.

  • Predicting yes or no
  • Estimating gender
  • Breed of an animal
  • Type of color

Examples of regression problems include.

  • Estimating sales and price of a product
  • Predicting the score of a team
  • Predicting the amount of rainfall

How Do You Design an Email Spam Filter?

Building a spam filter involves the following process.

  • The email spam filter will be fed with thousands of emails
  • Each of these emails already has a label. ‘spam’ or ‘not spam.’
  • The supervised machine learning algorithm will then determine which type of emails are being marked as spam based on spam words like the lottery, free offer, no money, full refund, etc.
  • The next time an email is about to hit your inbox, the spam filter will use statistical analysis and algorithms like Decision Trees and SVM to determine how likely the email is spam
  • If the likelihood is high, it will label it as spam, and the email won’t hit your inbox
  • Based on the accuracy of each model, we will use the algorithm with the highest accuracy after testing all the models

What is a Random Forest?

A ‘random forest’ is a supervised machine learning algorithm that is generally used for classification problems. It operates by constructing multiple decision trees during the training phase. The random forest chooses the decision of the majority of the trees as the final decision.

Considering a Long List of Machine Learning Algorithms, given a Data Set, How Do You Decide Which One to Use?

There is no master algorithm for all situations. Choosing an algorithm depends on the following questions.

  • How much data do you have, and is it continuous or categorical?
  • Is the problem related to classification, association, clustering, or regression?
  • Predefined variables (labeled), unlabeled, or mix?
  • What is the goal?

Based on the above questions, the following algorithms can be used.

What is Bias and Variance in a Machine Learning Model?

Bias

Bias in a machine learning model occurs when the predicted values are further from the actual values. Low bias indicates a model where the prediction values are very close to the actual ones.

Underfitting. High bias can cause an algorithm to miss the relevant relations between features and target outputs.

Variance

Variance refers to the amount the target model will change when trained with different training data. For a good model, the variance should be minimized.

Overfitting. High variance can cause an algorithm to model the random noise in the training data rather than the intended outputs.

What is the Trade-off Between Bias and Variance?

The bias-variance decomposition essentially decomposes the learning error from any algorithm by adding the bias, variance, and a bit of irreducible error due to noise in the underlying dataset.

Necessarily, if you make the model more complex and add more variables, you’ll lose bias but gain variance. To get the optimally-reduced amount of error, you’ll have to trade off bias and variance. Neither high bias nor high variance is desired.

High bias and low variance algorithms train models that are consistent, but inaccurate on average.

High variance and low bias algorithms train models that are accurate but inconsistent.

Define Precision and Recall.

Precision

Precision is the ratio of several events you can correctly recall to the total number of events you recall (mix of correct and wrong recalls).

Precision = (True Positive) / (True Positive + False Positive)

Recall

A recall is the ratio of a number of events you can recall the number of total events.

Recall = (True Positive) / (True Positive + False Negative)

What is Decision Tree Classification?

A decision tree builds classification (or regression) models as a tree structure, with datasets broken up into ever-smaller subsets while developing the decision tree, literally in a tree-like way with branches and nodes. Decision trees can handle both categorical and numerical data.

What is Pruning in Decision Trees, and How Is It Done?

Pruning is a technique in machine learning that reduces the size of decision trees. It reduces the complexity of the final classifier, and hence improves predictive accuracy by the reduction of overfitting.

Pruning can occur in.

  • Top-down fashion. It will traverse nodes and trim subtrees starting at the root
  • Bottom-up fashion. It will begin at the leaf nodes

There is a popular pruning algorithm called reduced error pruning, in which.

  • Starting at the leaves, each node is replaced with its most popular class
  • If the prediction accuracy is not affected, the change is kept
  • There is an advantage of simplicity and speed

Explain the K Nearest Neighbor Algorithm. 

K nearest neighbor algorithm is a classification algorithm that works in a way that a new data point is assigned to a neighboring group to which it is most similar.

In K nearest neighbors, K can be an integer greater than . So, for every new data point, we want to classify, we compute to which neighboring group it is closest.

Let us classify an object using the following example. Consider there are three clusters.

  • Football
  • Basketball
  • Tennis ball

Let the new data point to be classified is a black ball. We use KNN to classify it. Assume K = (initially).

Next, we find the K (five) nearest data points, as shown.

Observe that all five selected points do not belong to the same cluster. There are three tennis balls and one each of basketball and football.

When multiple classes are involved, we prefer the majority. Here the majority is with the tennis ball, so the new data point is assigned to this cluster.

What is a Recommendation System?

Anyone who has used Spotify or shopped at Amazon will recognize a recommendation system. It’s an information filtering system that predicts what a user might want to hear or see based on choice patterns provided by the user.

What is Kernel SVM?

Kernel SVM is the abbreviated version of the kernel support vector machine. Kernel methods are a class of algorithms for pattern analysis, and the most common one is the kernel SVM.

What Are Some Methods of Reducing Dimensionality?

You can reduce dimensionality by combining features with feature engineering, removing collinear features, or using algorithmic dimensionality reduction.

Now that you have gone through these machine learning interview questions, you must have got an idea of your strengths and weaknesses in this domain.

What’s the trade-off between bias and variance?

Bias is error due to erroneous or overly simplistic assumptions in the learning algorithm you’re using. This can lead to the model underfitting your data, making it hard for it to have high predictive accuracy and for you to generalize your knowledge from the training set to the test set.

Variance is error due to too much complexity in the learning algorithm you’re using. This leads to the algorithm being highly sensitive to high degrees of variation in your training data, which can lead your model to overfit the data. You’ll be carrying too much noise from your training data for your model to be very useful for your test data.

The bias-variance decomposition essentially decomposes the learning error from any algorithm by adding the bias, the variance and a bit of irreducible error due to noise in the underlying dataset. Essentially, if you make the model more complex and add more variables, you’ll lose bias but gain some variance — in order to get the optimally reduced amount of error, you’ll have to tradeoff bias and variance. You don’t want either high bias or high variance in your model.

Why is “Naive” Bayes naive?

Despite its practical applications, especially in text mining, Naive Bayes is considered “Naive” because it makes an assumption that is virtually impossible to see in real-life data. the conditional probability is calculated as the pure product of the individual probabilities of components. This implies the absolute independence of features — a condition probably never met in real life.

As a Quora commenter put it whimsically, a Naive Bayes classifier that figured out that you liked pickles and ice cream would probably naively recommend you a pickle ice cream.

Explain the difference between L and L regularization.

L regularization tends to spread error among all the terms, while L is more binary/sparse, with many variables either being assigned a or in weighting. L corresponds to setting a Laplacean prior on the terms, while L corresponds to a Gaussian prior.

What’s your favorite algorithm, and can you explain it to me in less than a minute?

This type of question tests your understanding of how to communicate complex and technical nuances with poise and the ability to summarize quickly and efficiently. Make sure you have a choice and make sure you can explain different algorithms so simply and effectively that a five-year-old could grasp the basics!

How is a decision tree pruned?

Pruning is what happens in decision trees when branches that have weak predictive power are removed in order to reduce the complexity of the model and increase the predictive accuracy of a decision tree model. Pruning can happen bottom-up and top-down, with approaches such as reduced error pruning and cost complexity pruning.

Reduced error pruning is perhaps the simplest version. replace each node. If it doesn’t decrease predictive accuracy, keep it pruned. While simple, this heuristic actually comes pretty close to an approach that would optimize for maximum accuracy.

Which is more important to you. model accuracy or model performance?

This question tests your grasp of the nuances of machine learning model performance! Machine learning interview questions often look towards the details. There are models with higher accuracy that can perform worse in predictive power—how does that make sense?

Well, it has everything to do with how model accuracy is only a subset of model performance, and at that, a sometimes misleading one. For example, if you wanted to detect fraud in a massive dataset with a sample of millions, a more accurate model would most likely predict no fraud at all if only a vast minority of cases were fraud. However, this would be useless for a predictive model—a model designed to find fraud that asserted there was no fraud at all! Questions like this help you demonstrate that you understand model accuracy isn’t the be-all and end-all of model performance.

What’s the F score? How would you use it?

The F score is a measure of a model’s performance. It is a weighted average of the precision and recall of a model, with results tending to being the best, and those tending to being the worst. You would use it in classification tests where true negatives don’t matter much.

How would you handle an imbalanced dataset?

An imbalanced dataset is when you have, for example, a classification test and % of the data is in one class. That leads to problems. an accuracy of % can be skewed if you have no predictive power on the other category of data! Here are a few tactics to get over the hump.

  1. Collect more data to even the imbalances in the dataset.
  2. Resample the dataset to correct for imbalances.
  3. Try a different algorithm altogether on your dataset.

What’s important here is that you have a keen sense for what damage an unbalanced dataset can cause, and how to balance that.

When should you use classification over regression?

Classification produces discrete values and dataset to strict categories, while regression gives you continuous results that allow you to better distinguish differences between individual points. You would use classification over regression if you wanted your results to reflect the belongingness of data points in your dataset to certain explicit categories (ex. If you wanted to know whether a name was male or female rather than just how correlated they were with male and female names.)

Name an example where ensemble techniques might be useful.

Ensemble techniques use a combination of learning algorithms to optimize better predictive performance. They typically reduce overfitting in models and make the model more robust (unlikely to be influenced by small changes in the training data).

You could list some examples of ensemble methods (bagging, boosting, the “bucket of models” method) and demonstrate how they could increase predictive power.

How do you ensure you’re not overfitting with a model?

This is a simple restatement of a fundamental problem in machine learning. the possibility of overfitting training data and carrying the noise of that data through to the test set, thereby providing inaccurate generalizations.

There are three main methods to avoid overfitting.

  1. Keep the model simpler. reduce variance by taking into account fewer variables and parameters, thereby removing some of the noise in the training data.
  2. Use cross-validation techniques such as k-folds cross-validation.
  3. Use regularization techniques such as LASSO that penalize certain model parameters if they’re likely to cause overfitting.

What evaluation approaches would you work to gauge the effectiveness of a machine learning model?

You would first split the dataset into training and test sets, or perhaps use cross-validation techniques to further segment the dataset into composite sets of training and test sets within the data. You should then implement a choice selection of performance metrics. here is a fairly comprehensive list. You could use measures such as the F score, the accuracy, and the confusion matrix. What’s important here is to demonstrate that you understand the nuances of how a model is measured and how to choose the right performance measures for the right situations.

How would you evaluate a logistic regression model?

A subsection of the question above. You have to demonstrate an understanding of what the typical goals of a logistic regression are (classification, prediction, etc.) and bring up a few examples and use cases.

What’s the “kernel trick” and how is it useful?

The Kernel trick involves kernel functions that can enable in higher-dimension spaces without explicitly calculating the coordinates of points within that dimension. instead, kernel functions compute the inner products between the images of all pairs of data in a feature space. This allows them the very useful attribute of calculating the coordinates of higher dimensions while being computationally cheaper than the explicit calculation of said coordinates. Many algorithms can be expressed in terms of inner products. Using the kernel trick enables us effectively run algorithms in a high-dimensional space with lower-dimensional data.

How do you handle missing or corrupted data in a dataset?

You could find missing/corrupted data in a dataset and either drop those rows or columns, or decide to replace them with another value.

In Pandas, there are two very useful methods. isnull() and dropna() that will help you find columns of data with missing or corrupted data and drop those values. If you want to fill the invalid values with a placeholder value (for example, ), you could use the fillna() method.

Do you have experience with Spark or big data tools for machine learning?

 You’ll want to get familiar with the meaning of big data for different companies and the different tools they’ll want. Spark is the big data tool most in demand now, able to handle immense datasets with speed. Be honest if you don’t have experience with the tools demanded, but also take a look at job descriptions and see what tools pop up. you’ll want to invest in familiarizing yourself with them. Pick an algorithm. Write the pseudo-code for a parallel implementation.

This kind of question demonstrates your ability to think in parallelism and how you could handle concurrency in programming implementations dealing with big data. Take a look at pseudocode frameworks such as Peril-L and visualization tools such as Web Sequence Diagrams to help you demonstrate your ability to write code that reflects parallelism.

Given two strings, A and B, of the same length n, find whether it is possible to cut both strings at a common point such that the first part of A and the second part of B form a palindrome.

You’ll often get standard algorithms and data structures questions as part of your interview process as a machine learning engineer that might feel akin to a software engineering interview. In this case, this comes from Google’s interview process. There are multiple ways to check for palindromes—one way of doing so if you’re using a programming language such as Python is to reverse the string and check to see if it still equals the original string, for example. The thing to look out for here is the category of questions you can expect, which will be akin to software engineering questions that drill down to your knowledge of algorithms and data structures. Make sure that you’re totally comfortable with the language of your choice to express that logic.

How are primary and foreign keys related in SQL?

Most machine learning engineers are going to have to be conversant with a lot of different data formats. SQL is still one of the key ones used. Your ability to understand how to manipulate SQL databases will be something you’ll most likely need to demonstrate. In this example, you can talk about how foreign keys allow you to match up and join tables together on the primary key of the corresponding table—but just as useful is to talk through how you would think about setting up SQL tables and querying them. 

How does XML and CSVs compare in terms of size?

In practice, XML is much more verbose than CSVs are and takes up a lot more space. CSVs use some separators to categorize and organize data into neat columns. XML uses tags to delineate a tree-like structure for key-value pairs. You’ll often get XML back as a way to semi-structure data from APIs or HTTP responses. In practice, you’ll want to ingest XML data and try to process it into a usable CSV. This sort of question tests your familiarity with data wrangling sometimes messy data formats.

What are the data types supported by JSON? 

This tests your knowledge of JSON, another popular file format that wraps with JavaScript. There are six basic JSON datatypes you can manipulate. strings, numbers, objects, arrays, booleans, and null values.

How would you build a data pipeline?

Data pipelines are the bread and butter of machine learning engineers, who take data science models and find ways to automate and scale them. Make sure you’re familiar with the tools to build data pipelines (such as Apache Airflow) and the platforms where you can host models and pipelines (such as Google Cloud or AWS or Azure). Explain the steps required in a functioning data pipeline and talk through your actual experience building and scaling them in production.

What do you think is the most valuable data in our business? 

This question or questions like it really try to test you on two dimensions. The first is your knowledge of the business and the industry itself, as well as your understanding of the business model. The second is whether you can pick how correlated data is to business outcomes in general, and then how you apply that thinking to your context about the company. You’ll want to research the business model and ask good questions to your recruiter—and start thinking about what business problems they probably want to solve most with their data.

How would you implement a recommendation system for our company’s users?

A lot of machine learning interview questions of this type will involve the implementation of machine learning models to a company’s problems. You’ll have to research the company and its industry in-depth, especially the revenue drivers the company has, and the types of users the company takes on in the context of the industry it’s in.

Do you have research experience in machine learning?

Related to the last point, most organizations hiring for machine learning positions will look for your formal experience in the field. Research papers, co-authored or supervised by leaders in the field, can make the difference between you being hired and not. Make sure you have a summary of your research experience and papers ready—and an explanation for your background and lack of formal research experience if you don’t.

What are your favorite use cases of machine learning models?

The Quora thread below contains some examples, such as decision trees that categorize people into different tiers of intelligence based on IQ scores. Make sure that you have a few examples in mind and describe what resonated with you. It’s important that you demonstrate an interest in how machine learning is implemented.

How would you approach the “Netflix Prize” competition?

The Netflix Prize was a famed competition where Netflix offered $,, for a better collaborative filtering algorithm. The team that won called BellKor had a % improvement and used an ensemble of different methods to win. Some familiarity with the case and its solution will help demonstrate you’ve paid attention to machine learning for a while.

Where do you usually source datasets?

Machine learning interview questions like these try to get at the heart of your machine learning interest. Somebody who is truly passionate about machine learning will have gone off and done side projects on their own, and have a good idea of what great datasets are out there. If you’re missing any, check out Quandl for economic and financial data, and Kaggle’s Datasets collection for another great list.

How do you think Google is training data for self-driving cars?

Machine learning interview questions like this one really test your knowledge of different machine learning methods, and your inventiveness if you don’t know the Google is currently using recaptcha to source labeled data on storefronts and traffic signs. They are also building on training data collected by Sebastian Thrun at GoogleX—some of which was obtained by his grad students driving buggies on desert dunes!

How would you simulate the approach AlphaGo took to beat Lee Sedol at Go?

AlphaGo beating Lee Sedol, the best human player at Go, in a best-of-five series was a truly seminal event in the history of machine learning and deep learning. The Nature paper above describes how this was accomplished with “Monte-Carlo tree search with deep neural networks that have been trained by supervised learning, from human expert games, and by reinforcement learning from games of self-play.”

What are your thoughts on GPT- and OpenAI’s model?

GPT- is a new language generation model developed by OpenAI. It was marked as exciting because with very little change in architecture, and a ton more data, GPT- could generate what seemed to be human-like conversational pieces, up to and including novel-size works and the ability to create code from natural language. There are many perspectives on GPT- throughout the Internet — if it comes up in an interview setting, be prepared to address this topic (and trending topics like it) intelligently to demonstrate that you follow the latest advances in machine learning.

What models do you train for fun, and what GPU/hardware do you use?

This question tests whether you’ve worked on machine learning projects outside of a corporate role and whether you understand the basics of how to resource projects and allocate GPU-time efficiently. Expect questions like this to come from hiring managers that are interested in getting a greater sense behind your portfolio, and what you’ve done independently.

What are some of your favorite APIs to explore? 

If you’ve worked with external data sources, it’s likely you’ll have a few favorite APIs that you’ve gone through. You can be thoughtful here about the kinds of experiments and pipelines you’ve run in the past, along with how you think about the APIs you’ve used before.

How do you think quantum computing will affect machine learning?

With the recent announcement of more breakthroughs in quantum computing, the question of how this new format and way of thinking through hardware serves as a useful proxy to explain classical computing and machine learning, and some of the hardware nuances that might make some algorithms much easier to do on a quantum machine. Demonstrating some knowledge in this area helps show that you’re interested in machine learning at a much higher level than just implementation details.

What is Machine learning?

Machine learning is a branch of computer science which deals with system programming in order to automatically learn and improve with experience.  For example. Robots are programed so that they can perform the task based on data they gather from sensors. It automatically learns programs from data.

Mention the difference between Data Mining and Machine learning?

Machine learning relates with the study, design and development of the algorithms that give computers the capability to learn without being explicitly programmed.  While, data mining can be defined as the process in which the unstructured data tries to extract knowledge or unknown interesting patterns.  During this process machine, learning algorithms are used.

What is ‘Overfitting’ in Machine learning?

In machine learning, when a statistical model describes random error or noise instead of underlying relationship ‘overfitting’ occurs.  When a model is excessively complex, overfitting is normally observed, because of having too many parameters with respect to the number of training data types. The model exhibits poor performance which has been overfit.

Why overfitting happens?

The possibility of overfitting exists as the criteria used for training the model is not the same as the criteria used to judge the efficacy of a model.

How can you avoid overfitting?

By using a lot of data overfitting can be avoided, overfitting happens relatively as you have a small dataset, and you try to learn from it. But if you have a small database and you are forced to come with a model based on that. In such situation, you can use a technique known as cross validation. In this method the dataset splits into two section, testing and training datasets, the testing dataset will only test the model while, in training dataset, the datapoints will come up with the model.

In this technique, a model is usually given a dataset of a known data on which training (training data set) is run and a dataset of unknown data against which the model is tested. The idea of cross validation is to define a dataset to “test” the model in the training phase.

What is inductive machine learning?

The inductive machine learning involves the process of learning by examples, where a system, from a set of observed instances tries to induce a general rule.

What are the five popular algorithms of Machine Learning?

  • Decision Trees
  • Neural Networks (back propagation)
  • Probabilistic networks
  • Nearest Neighbor
  • Support vector machines

What are the different Algorithm techniques in Machine Learning?

The different types of techniques in Machine Learning are

  • Supervised Learning
  • Unsupervised Learning
  • Semi-supervised Learning
  • Reinforcement Learning
  • Transduction
  • Learning to Learn

What are the three stages to build the hypotheses or model in machine learning?

  • Model building
  • Model testing
  • Applying the model

What is the standard approach to supervised learning?

The standard approach to supervised learning is to split the set of example into the training set and the test.

What is ‘Training set’ and ‘Test set’?

In various areas of information science like machine learning, a set of data is used to discover the potentially predictive relationship known as ‘Training Set’. Training set is an examples given to the learner, while Test set is used to test the accuracy of the hypotheses generated by the learner, and it is the set of example held back from the learner. Training set are distinct from Test set.

List down various approaches for machine learning?

The different approaches in Machine Learning are

  • Concept Vs Classification Learning
  • Symbolic Vs Statistical Learning
  • Inductive Vs Analytical Learning

What is not Machine Learning?

  • Artificial Intelligence
  • Rule based inference

Explain what is the function of ‘Unsupervised Learning’?

  • Find clusters of the data
  • Find low-dimensional representations of the data
  • Find interesting directions in data
  • Interesting coordinates and correlations
  • Find novel observations/ database cleaning

Explain what is the function of ‘Supervised Learning’?

  • Classifications
  • Speech recognition
  • Regression
  • Predict time series
  • Annotate strings

What is algorithm independent machine learning?

Machine learning in where mathematical foundations is independent of any particular classifier or learning algorithm is referred as algorithm independent machine learning?

What is dimension reduction in Machine Learning?

In Machine Learning and statistics, dimension reduction is the process of reducing the number of random variables under considerations and can be divided into feature selection and feature extraction.

So, this brings us to the end of the Machine Learning Interview Questions blog.This Tecklearn ‘Top Machine Learning Interview Questions and Answers’ helps you with commonly asked questions if you are looking out for a job in Data Science Domain. If you wish to learn Machine Learning and build a career in Data Science domain, then check out our interactive Machine Learning Training, that comes with 24*7 support to guide you throughout your learning period.

https://www.tecklearn.com/course/machine-learning/

Machine Learning Training

About the Course

Tecklearn’s Machine Learning training will help you develop the skills and knowledge required for a career as a Machine Learning Engineer. It helps you gain expertise in various machine learning algorithms such as regression, clustering, decision trees, random forest, Naïve Bayes and Q-Learning. This Machine Learning Certification Training exposes you to concepts of Statistics, Time Series and different classes of machine learning algorithms like supervised, unsupervised and reinforcement algorithms. With these key concepts, you will be well prepared for the role of Machine Learning (ML) engineer. In addition, it is one of the most immersive Machine Learning online courses, which includes hands-on projects

Why Should you take Machine Learning Training?

  • The average machine learning salary, according to Indeed’s research, is approximately $146,085 (an astounding 344% increase since 2015). The average machine learning engineer salary far outpaced other technology jobs on the list.
  • IBM, Amazon, Apple, Google, Facebook, Microsoft, Oracle & other MNCs worldwide are using Machine Learning for their Data analysis
  • The Machine Learning market is expected to reach USD $8.81 Billion by 2022, at a growth rate of 44.1-percent, indicating the increased adoption of Machine Learning among companies. By 2020, the demand for Machine Learning engineers is expected to grow by 60-percent.

What you will Learn in this Course?

Introduction to Machine Learning

  • Need of Machine Learning
  • Types of Machine Learning – Supervised, Unsupervised and Reinforcement Learning
  • Applications of Machine Learning

Concept of Supervised Learning and Linear Regression

  • Concept of Supervised learning
  • Types of Supervised learning: Classification and Regression
  • Overview of Regression
  • Types of Regression: Simple Linear Regression and Multiple Linear Regression
  • Assumptions in Linear Regression and Mathematical Concepts behind Linear Regression
  • Hands On

Concept of Classification and Logistic Regression

  • Overview of the Concept of Classification
  • Comparison of Linear regression with Logistic regression
  • Mathematics behind Logistic Regression: Detailed Formulas and Functions
  • Concept of Confusion matrix and Accuracy Measurement
  • True positives rate, False positives rate
  • Threshold evaluation with ROCR
  • Hands on

Concept of Decision Trees and Random Forest

  • Overview of Tree Based Classification
  • Concept of Decision trees, Impurity function and Entropy
  • Concept of Impurity function and Information gain for the right split of node and
  • Concept of Gini index and right split of node using Gini Index
  • Overfitting and Pruning Techniques
  • Stages of Pruning: Pre-Pruning, Post Pruning and cost-complexity pruning
  • Introduction to ensemble techniques and Concept of Bagging
  • Concept of random forests
  • Evaluation of Correct number of trees in a random forest
  • Hands on

Naive Bayes and Support Vector Machine

  • Introduction to probabilistic classifiers
  • Understanding Naive Bayes Theorem and mathematics behind the Bayes theorem
  • Concept of Support vector machines (SVM)
  • Mathematics behind SVM and Kernel functions in SVM
  • Hands on

Concept of Unsupervised Learning

  • Overview of Unsupervised Learning
  • Types of Unsupervised Learning:  Dimensionality Reduction and Clustering
  • Types of Clustering
  • Concept of K-Means Clustering
  • Mathematics behind K-Means Clustering
  • Concept of Dimensionality Reduction using Principal Component Analysis (PCA)
  • Hands on

Natural Language Processing and Text Mining Concepts

  • Overview of Concept of Natural Language Processing (NLP)
  • Concepts of Text mining with Importance and applications of text mining
  • Working of NLP with text mining
  • Reading and Writing to word files and OS modules
  • Text mining using Natural Language Toolkit (NLTK) environment: Cleaning of Text, Pre-Processing of Text and Text classification
  • Hands on

Introduction to Deep Learning

  • Overview of Deep Learning with neural networks
  • Biological neural network Versus Artificial neural network (ANN)
  • Concept of Perceptron learning algorithm
  • Deep Learning frameworks and Tensor Flow constants
  • Hands on

Time Series Analysis

  • Concept of Time series analysis, its techniques and applications
  • Time series components
  • Concepts of Moving average and smoothing techniques such as exponential smoothing
  • Univariate time series models
  • Multivariate time series analysis and the ARIMA model
  • Time series in Python
  • Sentiment analysis using Python (Twitter sentiment analysis Use Case) and Text analysis
  • Hands on

Got a question for us? Please mention it in the comments section and we will get back to you.

 

0 responses on "Top Machine Learning Interview Questions and Answers"

Leave a Message

Your email address will not be published. Required fields are marked *