{"id":1353,"date":"2022-08-13T13:44:00","date_gmt":"2022-08-13T13:44:00","guid":{"rendered":"http:\/\/blog.cloudxlab.com\/?p=1353"},"modified":"2024-04-24T06:07:19","modified_gmt":"2024-04-24T06:07:19","slug":"machine-learning-interview-questions-part-1","status":"publish","type":"post","link":"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/","title":{"rendered":"Top Machine Learning Interview Questions for 2024 (Part-1)"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">These Machine Learning Interview Questions, are the real questions that are asked in the top interviews. <\/span><\/p>\n<p><span style=\"font-weight: 400\">For hiring machine learning engineers or data scientists, the typical process has multiple rounds.<\/span><\/p>\n<ol class=\"ili-indent\">\n<li><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>A basic screening round<\/strong> &#8211; The objective is to check the minimum fitness in this round.<\/span><\/span><\/li>\n<li><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Algorithm Design Round<\/strong> &#8211; Some companies have this round but most don&#8217;t. This involves checking the coding \/ algorithmic skills of the interviewee.<\/span><\/span><\/li>\n<li><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>ML Case Study<\/strong> &#8211; In this round, you are given a case study problem of machine learning on the lines of Kaggle. You have to solve it in an hour.<\/span><\/span><\/li>\n<li><span style=\"font-weight: 400\"><strong>Bar Raiser \/ Hiring Manager<\/strong> &nbsp;&#8211; This interview is generally with the most senior person in the team or a very senior person from another team (at Amazon it is called Bar raiser round) who will check if the candidate fits in the company-wide technical capabilities. This is generally the last round.<\/span><\/li>\n<\/ol>\n<p><!--more--><\/p>\n<p><span style=\"font-weight: 400\">A typical first round of interview consists of three parts. First, a brief intro about yourself.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">Second, a brief about your relevant projects.<\/span><\/p>\n<p><span style=\"font-weight: 400\">A typical interviewer will start by asking about the relevant work from your profile. On your past experience of machine learning project, the interviewer might ask how would you improve it.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Say, you have done a project on recommendation, the interviewer might ask:<\/span><\/p>\n<ul class=\"ili-indent\">\n<li>How would you improve the recommendations?<\/li>\n<li>How would you do ranking?<\/li>\n<li>Have you done any end-to-end machine learning project? If yes, then what were the challenges faced. How would you do solve the problem of the cold start?<\/li>\n<li>How would you improve upon the speed of recommendation?<\/li>\n<\/ul>\n<p>Afterwards (third part), the interviewer would proceed to check your basic knowledge of machine learning on the following lines.<\/p>\n<h2><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Q1: What is machine learning?<\/strong><\/span><\/span><\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">Machine learning is the field of study that gives the computer the ability to learn and improve from experience without explicitly taught or programmed.<br \/>\n<\/span><br \/>\n<span style=\"font-weight: 400\"><span style=\"font-weight: 400\">In traditional programs, the rules are coded for a program to make decisions, but in machine learning, the program learns based on the data to make decisions.<\/span><\/span><\/p>\n<h2><strong>Q2. Why do we need machine learning?<\/strong><\/h2>\n<p>The most intuitive and prominent example is self-driving cars, but let\u2019s answer this question in the more structured way. Machine learning is needed to solve the problems that are categorized as below:<\/p>\n<ul class=\"ili-indent\">\n<li>Problems for which a traditional solution require a long and complex set of rules and requires hand-tuning often. Example of such problem is email spam filter. You notice a few words such as 4U, promotion, credit card, free, amazing etc. and figure out that the email is a spam. This list can be really long and can change once the spammer notices that you started ignoring these words. It becomes hard to deal with this problem with traditional programming approach. Machine learning algorithm learns to detect spam emails very well and works better.<\/li>\n<li>Complex problems for which there is no good solution at all using the traditional approach. Speech recognition is an example of this category of the problems.<br \/>\nMachine learning algorithms can find a good solution to these problems.<\/li>\n<li>Fluctuating environment: a machine learning system can adapt to new data and learn to do well in this new set of data.<\/li>\n<li>Getting insights into complex, large amounts of data. For example, your business collects a large amount of data from the customers. A machine learning algorithm can find insights into this data which otherwise is not easy to figure out.<\/li>\n<\/ul>\n<p>For more details visit <a href=\"https:\/\/cloudxlab.com\/course\/specialization\/1\/machine-learning-specialization\">Machine Learning Specialization<\/a><\/p>\n<h2><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Q3. What is the difference between the supervised and unsupervised learning? Give examples of both.<\/strong><br \/>\n<\/span><\/span><\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">By definition, the supervised and unsupervised learning algorithms are categorized based on the supervision required while training.<\/span><span style=\"font-weight: 400\"> Supervised learning algorithms work on data which are labelled i.e. the data has a desired solution or a label.<\/span><\/p>\n<p>On the other hand, unsupervised learning algorithms work on unlabeled data, meaning that the data does not contain the desired solution for the algorithm to learn from.<\/p>\n<p><span style=\"font-weight: 400\">Supervised algorithm examples:<\/span><\/p>\n<ul class=\"ili-indent\">\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Linear Regression<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Neural Networks\/Deep Learning<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Decision Trees<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Support Vector Machine (SVM)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">K-Nearest neighbours<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><br \/>\n<\/span><\/span><span style=\"font-weight: 400\">Unsupervised algorithm examples:<\/span><\/p>\n<ul class=\"ili-indent\">\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Clustering Algorithms &#8211; K-means, Hierarchical Clustering Analysis (HCA)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Visualization and Dimensionality reduction &#8211; Principal component reduction (PCA)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\">Association rule learning<\/span><\/span><\/li>\n<\/ul>\n<h2><strong>Q4. Is recommendation supervised or unsupervised learning?<\/strong><\/h2>\n<p>Recommendation algorithms are interesting as some of these are supervised and some are unsupervised. The recommendations based on your profile, previous purchases, page views fall under supervised learning. But there are recommendations based on hot selling products, country\/location-based recommendations, which are unsupervised learning.<\/p>\n<p>For more details visit <a href=\"https:\/\/cloudxlab.com\/course\/specialization\/1\/machine-learning-specialization\">Machine Learning Specialization<\/a><\/p>\n<h2><strong>Q5. Explain PCA?<\/strong><\/h2>\n<p>PCA stands for Principal Component Analysis. PCA is a procedure to reduce the dimensionality of the data, which consist of many variables related to each other heavily or lightly while retaining the variation in the data to the maximum possible. The data on which the PCA is applied has to be scaled data and the result of the PCA is sensitive to the relative scaling of the data.<\/p>\n<figure id=\"attachment_1440\" aria-describedby=\"caption-attachment-1440\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><img class=\"wp-image-1440\" src=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2018\/08\/PCA_hyperplane2-300x152.png\" alt=\"PCA Hyperplane depiction\" width=\"570\" height=\"289\" srcset=\"https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/PCA_hyperplane2-300x152.png 300w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/PCA_hyperplane2-768x390.png 768w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/PCA_hyperplane2-1024x520.png 1024w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/PCA_hyperplane2-1200x609.png 1200w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/PCA_hyperplane2.png 1202w\" sizes=\"(max-width: 570px) 85vw, 570px\" \/><figcaption id=\"caption-attachment-1440\" class=\"wp-caption-text\">PCA &#8211; Hyperplanes<\/figcaption><\/figure>\n<p>For an example, say, you have dataset in 2D space and you would need to choose a hyperplane&nbsp;to project the dataset. The hyperplane must be chosen such that the variance is preserved to the maximum. In below figure, when converting from one representation to another (left to right), the hyperplace C1 (solid line) has preserved maximum variance in the dataset while C2 (dotted line) has very little variance preserved.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Q6. Which supervised learning algorithms do you know?<\/strong><\/h2>\n<p>You need to answer this question in your own comfort level with the algorithm.<span style=\"font-weight: 400\"> There are many supervised learning algorithms such as regression, decision tree, neural networks, SVM etc. <\/span><span style=\"font-weight: 400\">Out of these the most popular and simple algorithm in supervised learning is the linear regression. Let me explain it in a quick way.<\/span><\/p>\n<p>Say we need to predict income of residents of a county based on some historical data. Linear regression is can be used for this problem.<br \/>\n<span style=\"font-weight: 400\"><span style=\"font-weight: 400\"> The linear regression model is a linear function of input features with weights which define the model and a bias term as shown below.<br \/>\n<img class=\"size-medium wp-image-1390 aligncenter\" src=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2018\/08\/eq1-300x43.png\" alt=\"\" width=\"300\" height=\"43\" srcset=\"https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/eq1-300x43.png 300w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/eq1.png 614w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><br \/>\n<\/span><\/span><span style=\"font-weight: 400\">In this equation <\/span><span style=\"font-weight: 400\">y_hat&nbsp;<\/span><span style=\"font-weight: 400\"> is the predicted outcome, <\/span><span style=\"font-weight: 400\">x_<\/span><span style=\"font-weight: 400\">i&nbsp;<\/span><span style=\"font-weight: 400\">are the inputs and <\/span><span style=\"font-weight: 400\">theta_i&nbsp;<\/span><span style=\"font-weight: 400\">are the model parameters or weights. theta_<\/span><span style=\"font-weight: 400\">0&nbsp;<\/span><span style=\"font-weight: 400\">is the bias.<\/span><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><br \/>\n<\/span><\/span>The performance of this model is measured by evaluating Root Mean Square Error (RMSE). In practice, Mean Square Error is minimized to find the values<span style=\"font-weight: 400\"> so that the MSE is the least.<\/span><span style=\"font-weight: 400\">MSE is given as below:<\/span><span style=\"font-weight: 400\"><img class=\"size-medium wp-image-1391 aligncenter\" src=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2018\/08\/eq2-300x54.png\" alt=\"\" width=\"300\" height=\"54\" srcset=\"https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/eq2-300x54.png 300w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/eq2.png 523w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/span><\/p>\n<h2><em><strong><br \/>\n<\/strong><\/em><strong>Q7. Can you compare Decision Trees and linear regression? Can decision trees be used for non-linear classification?<\/strong><\/h2>\n<p><span style=\"font-weight: 400\">Decision trees are used for both unsupervised and supervised learning. Also, they are used for classification as well as the regression in supervised machine learning problems.<\/span><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"> In decision trees, we form the tree by splitting the node. Initially, all of the instances are divided into two parts based on a boundary such that the instance on either side is boundary is very close to other instance on the same side. The instances on the left-hand side should be very similar to other instance on the left-hand side and same is true for the right-hand side.<\/span><\/span><\/p>\n<p>Below figure shows the decision tree of max depth 2 and max depth 3; you can see that as the max depth of the decision tree increases you get a better coverage of the available data.<\/p>\n<figure id=\"attachment_1442\" aria-describedby=\"caption-attachment-1442\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><img class=\"wp-image-1442\" src=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2018\/08\/decision_tree1-300x111.png\" alt=\"Decision tree depth explanation\" width=\"510\" height=\"189\" srcset=\"https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree1-300x111.png 300w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree1-768x283.png 768w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree1-1024x378.png 1024w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree1-1200x443.png 1200w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree1.png 1203w\" sizes=\"(max-width: 510px) 85vw, 510px\" \/><figcaption id=\"caption-attachment-1442\" class=\"wp-caption-text\">Decision Trees with Different Depths<\/figcaption><\/figure>\n<p>One more aspect of the decision tree worth highlight is the stability of the decision trees. The decision trees are sensitive to the dataset rotations. Below picture demonstrates the instability of decision tree while the data is rotated.<\/p>\n<figure id=\"attachment_1443\" aria-describedby=\"caption-attachment-1443\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><img class=\"wp-image-1443\" src=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2018\/08\/decision_tree2-300x111.png\" alt=\"Decision Tree Sensitivity with Rotation of Data\" width=\"570\" height=\"211\" srcset=\"https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree2-300x111.png 300w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree2-768x283.png 768w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree2-1024x378.png 1024w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree2-1200x443.png 1200w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/decision_tree2.png 1203w\" sizes=\"(max-width: 570px) 85vw, 570px\" \/><figcaption id=\"caption-attachment-1443\" class=\"wp-caption-text\">Decision Tree Sensitivity with Rotation of Data<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>For more details visit <a href=\"https:\/\/cloudxlab.com\/course\/specialization\/1\/machine-learning-specialization\">Machine Learning Specialization<br \/>\n<\/a><\/p>\n<h2><em><strong><br \/>\n<\/strong><\/em><strong>Q8. Explain overfitting and underfitting? What causes overfitting?<\/strong><\/h2>\n<p><span style=\"font-weight: 400\">Say, there are two kids Jack and Jill in a maths exam. Jack only learnt additions and Jill memorized the questions and their answers from the maths book. &nbsp;Now, who will succeed in the exam? The answer is neither. From machine learning lingo, Jack is underfitting and Jill is overfitting.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">Overfitting is failing of the algorithm to generalize to new examples which are not in the training set, at the same time the algorithm works very well for training set data same as Jill can answer the question which is in the book but nothing besides it.<\/span><span style=\"font-weight: 400\"> Underfitting, on the other hand, refers to the model when it does not capture the underlying trend of the data (training data as well as test data). The remedy, in general, is to choose a better (more complex) machine learning algorithm.<\/span><\/p>\n<p>So, the underfitting models are the ones that give bad performance both in training and test data.<span style=\"font-weight: 400\"> Overfitting is very important to keep a tab on while developing the machine learning algorithms. This is because, by intuition, if the model fits very well with the training set the developers tend to think that the algorithm is working well, sometimes failing to account for overfitting.<\/span><span style=\"font-weight: 400\"> Overfitting occurs when the model is too complex relative to the amount and noisiness of the training data. It also means that the algorithm is not be working for test data well, maybe because the test data does not come from the same distribution as that of training data.<\/span><span style=\"font-weight: 400\"> Below are some of the ways to avoid overfitting:<\/span><\/p>\n<ul class=\"ili-indent\">\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Simplify the model: regularization, controlled by hyperparameter<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Gather more training data<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Reduce the noise in the training data<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">Below are some of the ways to avoid underfitting:<\/span><\/p>\n<ul class=\"ili-indent\">\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Selecting a more powerful model<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Feeding better features to the learning algorithm<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\">Reducing the constraints on the model (reduce regularization hyperparameter)<\/span><\/span><\/span><\/li>\n<\/ul>\n<h2><strong>Q9. What is cross-validation technique?<\/strong><\/h2>\n<p>Let&#8217;s understand what validation set is and then we will go to cross-validation. When building the model, the training set is required to tune the weights by the means of backpropagation. And these weights are chosen such that the training error is minimum.<\/p>\n<p>Now you need data to evaluate the model and the hyperparameters and this data can not be the same as the training set data. Hence a portion of the training set data is reserved for validation and is called the validation set. When testing different models to avoid wasting too much data in the validation of the models by keeping separate validation sets, the cross-validation technique is used. In cross-validation technique training data is divided into complimentary sub-sets and a different set of training and validation set are used for different models.<\/p>\n<p>Then finally the best model is tested with test data.<\/p>\n<p>For more details visit <a href=\"https:\/\/cloudxlab.com\/course\/specialization\/1\/machine-learning-specialization\">Machine Learning Specialization<\/a><\/p>\n<h2><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Q10. How would you detect overfitting and underfitting?<\/strong><br \/>\n<\/span><\/span><\/h2>\n<p>This is one of the most important questions of practical machine learning. For answering this question, let\u2019s understand the concept of bias and variance.<\/p>\n<p>In order to conclude whether the algorithm is overfitting or underfitting, you need to find out the training set error (E_train) and cross-validation set error (E_cv). If your E_train is high and E_cv is also in the same range as E_train i.e. both E_train and E_cv are high. This is the case of high bias and the algorithm is underfitting. In another case, say, your training set error is low but your cross-validation set error is high: E_train is low and E_cv is high. This is the case of high variance and the algorithm is overfitting.<\/p>\n<h2><strong>Q11. What\u2019s the trade-off between bias and variance?<\/strong><\/h2>\n<figure id=\"attachment_1395\" aria-describedby=\"caption-attachment-1395\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img class=\"wp-image-1395 size-medium\" src=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2018\/08\/bias_variance-300x112.png\" alt=\"Explanation of Bias and Variance trade-off\" width=\"300\" height=\"112\" srcset=\"https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/bias_variance-300x112.png 300w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/bias_variance.png 566w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><figcaption id=\"caption-attachment-1395\" class=\"wp-caption-text\">Bias vs Variance<\/figcaption><\/figure>\n<p><span style=\"font-weight: 400\"><span style=\"font-weight: 400\">In simple terms, you can understand that a very simple algorithm (which does not capture the underlying details of the data) underfit, and has high bias and a very complex algorithm overfit and has high variance. There has to be a balance between the two. The picture below depicts how they are related in terms of the trade-off between them.<\/span><\/span><\/p>\n<h2><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Q12. How would you overcome overfitting in the algorithms that you mentioned above?<\/strong><br \/>\n<\/span><\/span><\/h2>\n<p>As mentioned above, the ways to overcome overfitting are as below:<\/p>\n<ul class=\"ili-indent\">\n<li>Simplify the model: regularization, controlled by hyperparameter<\/li>\n<li>Gather more training data<\/li>\n<li>Reduce the noise in the training data<\/li>\n<\/ul>\n<h2><strong>Q13. There is a colleague who claims to have achieved 99.99% accuracy in the classifier that he has built? Would you believe him? If not, what could be the prime suspects? How would you solve it?<\/strong><\/h2>\n<p>99.99% is a very high accuracy, in general, and should be suspected. At least a careful analysis of the data set and any flow in modelling the solution around it be checked thoroughly. My prime suspects would be the data set and the problem statement. For example: in a set of handwritten characters where there are digits from 0 to 9 and if one builds a model to detect whether a digit is 5 or not 5. A faulty model which always recognize a digit as 8 will also give 90% accuracy, given all digits have the equal number of images in the data set.<br \/>\nIn this case, the data set is not having good distribution for the problem of detecting 5 or not 5.<\/p>\n<h2><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Q14. Explain how a ROC curve works?<\/strong><br \/>\n<\/span><\/span><\/span><\/h2>\n<figure id=\"attachment_1404\" aria-describedby=\"caption-attachment-1404\" style=\"width: 348px\" class=\"wp-caption aligncenter\"><img class=\"wp-image-1404\" src=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2018\/08\/ROC-300x227.png\" alt=\"ROC Curve\" width=\"348\" height=\"263\" srcset=\"https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/ROC-300x227.png 300w, https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/ROC.png 523w\" sizes=\"(max-width: 348px) 85vw, 348px\" \/><figcaption id=\"caption-attachment-1404\" class=\"wp-caption-text\">ROC Curve<\/figcaption><\/figure>\n<p>ROC stands for Receiver Operating Characteristic. ROC curve is used to measure the performance of different algorithms. This is a measurement of the area under the curve when the true positive rate and the false positive rate is plotted. More the area better the model.<\/p>\n<p>For more details visit <a href=\"https:\/\/cloudxlab.com\/course\/specialization\/1\/machine-learning-specialization\">Machine Learning Specialization<\/a><\/p>\n<h2><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Q15. Explain the ensemble methods? What is the basic principle?<\/strong><\/span><\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><span style=\"font-weight: 400\">Say you ask a question to thousands of people and then aggregates the answer, many times this answer is better than an expert&#8217;s answer.<\/span><\/span><\/span><\/span> Ensemble methods are basically combining the predictions of different learning algorithms such as classification, regression etc., to achieve a higher accuracy. This aggregate prediction is better than the best individual predictor. These group of predictors are called ensemble and the technique is called ensemble learning.<\/p>\n<h2><strong>Q16. Say, you have a dataset having city id as the feature, what would you do?<\/strong><\/h2>\n<p>When you collect the data for your machine learning project, you need to carefully select the features from the data collected. City id is just a serial number which does not represent any property of the city unless otherwise stated, so I would just drop city id from the features list.<\/p>\n<h2><strong>Q17. In a dataset, there is a feature hour_of_the_day which goes from 0 to 23. Do you think it is okay?<\/strong><\/h2>\n<p>This feature can not be used as it is because of the simple reason that hour_of_the_day may imply a certain constraint on your problem to be solved using the machine learning technique but there is a flaw to use the feature as is. Consider 0 and 23, these two numbers have a large numeric difference but in fact, they are close in the actual occurrence in the day, hence the algorithm may not produce desired results. There are two ways to solve this. First is to apply sine function with the periodicity of 24 (hours in a day), this will result in a continuous data from a discontinuous data.<\/p>\n<p>The second approach is to divide the hours of the day into categories such as morning, afternoon, evening, night etc. or in the split of peak hours and non-peak hours based on your knowledge of the domain of your problem.<\/p>\n<h2><span style=\"font-weight: 400\"><strong>Q18. If you have a smaller dataset, how would handle?<\/strong><\/span><\/h2>\n<p>There are multiple ways to deal with this problem. Below are a few techniques.<\/p>\n<ol class=\"ili-indent\">\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Data augmentation<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Pretrained Models<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Better algorithm<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Get started with generating the data<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Download from internet<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>To learn more in details, join the <a href=\"https:\/\/cloudxlab.com\/course\/specialization\/1\/machine-learning-specialization\">course on machine learning<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; These Machine Learning Interview Questions, are the real questions that are asked in the top interviews. For hiring machine learning engineers or data scientists, the typical process has multiple rounds. A basic screening round &#8211; The objective is to check the minimum fitness in this round. Algorithm Design Round &#8211; Some companies have this &hellip; <a href=\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Top Machine Learning Interview Questions for 2024 (Part-1)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":14,"featured_media":1419,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[29,15,28,30,13,14],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Top Machine Learning Interview Questions for 2018 | CloudxLab Blog<\/title>\n<meta name=\"description\" content=\"Top Machine Learning Interview Questions aimed at helping Machine Learning Engineers and Data scientists preparing for interviews.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top Machine Learning Interview Questions for 2018 | CloudxLab Blog\" \/>\n<meta property=\"og:description\" content=\"Top Machine Learning Interview Questions aimed at helping Machine Learning Engineers and Data scientists preparing for interviews.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/\" \/>\n<meta property=\"og:site_name\" content=\"CloudxLab Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cloudxlab\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-13T13:44:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-24T06:07:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2018\/08\/abstract-ai-art-355948-e1534168310219.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2296\" \/>\n\t<meta property=\"og:image:height\" content=\"1396\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CloudxLab\" \/>\n<meta name=\"twitter:site\" content=\"@CloudxLab\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"13 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/#website\",\"url\":\"https:\/\/cloudxlab.com\/blog\/\",\"name\":\"CloudxLab Blog\",\"description\":\"Learn AI, Machine Learning, Deep Learning, Devops &amp; Big Data\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/cloudxlab.com\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/abstract-ai-art-355948-e1534168310219.jpg\",\"contentUrl\":\"https:\/\/cloudxlab.com\/blog\/wp-content\/uploads\/2018\/08\/abstract-ai-art-355948-e1534168310219.jpg\",\"width\":2296,\"height\":1396},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/#webpage\",\"url\":\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/\",\"name\":\"Top Machine Learning Interview Questions for 2018 | CloudxLab Blog\",\"isPartOf\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/#primaryimage\"},\"datePublished\":\"2022-08-13T13:44:00+00:00\",\"dateModified\":\"2024-04-24T06:07:19+00:00\",\"author\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/#\/schema\/person\/4835f1b3d5000626cb15e9311d748e09\"},\"description\":\"Top Machine Learning Interview Questions aimed at helping Machine Learning Engineers and Data scientists preparing for interviews.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/\",\"url\":\"https:\/\/cloudxlab.com\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/machine-learning-interview-questions-part-1\/#webpage\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/#\/schema\/person\/4835f1b3d5000626cb15e9311d748e09\",\"name\":\"Sandeep Giri\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1393214840cf7455bb4cba055cb30468?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1393214840cf7455bb4cba055cb30468?s=96&d=mm&r=g\",\"caption\":\"Sandeep Giri\"},\"sameAs\":[\"https:\/\/cloudxlab.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/posts\/1353"}],"collection":[{"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/comments?post=1353"}],"version-history":[{"count":57,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/posts\/1353\/revisions"}],"predecessor-version":[{"id":4245,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/posts\/1353\/revisions\/4245"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/media\/1419"}],"wp:attachment":[{"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/media?parent=1353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/categories?post=1353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/tags?post=1353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}