r/datascience • u/eternaldatalearner • Sep 01 '20
Job Search 51 Essential Machine Learning Interview Questions
https://www.springboard.com/blog/machine-learning-interview-questions/[removed] — view removed post
4
Sep 02 '20
These are good questions for entry-level data science positions. I think they skipped a couple of important details in several questions.
Q8: Explain the difference between L1 and L2 regularization.
They missed the actual difference between these two types of regularization models: the penalty terms are the difference between the two models, and that's because one of the penalty terms uses the l1 norm (aka absolute value) and one of the penalty terms uses the l2 norm (aka sum of squares). The l1 regularization models are better for feature selection because the l1 norm in the penalty term shrinks the coefficients of the less important terms to zero (aka dropping them out of the model). So you want to use l1 instead of the more classical l2 approach when handling very large data sets with a large number of features.
The difference in the two norms is why the linked quora answer for this question has two different shapes in black. The l1 norm is absolute value, so it makes a diamond because it's got sharp cutoffs. The l2norm is squares so it doesn't have sharp cutoffs and it's got a round shape.
That "sharp cutoff" thing is why the picture for question 8 has a rounded, smooth curve for the l2 regularization (Gaussian) and has a smooth curve with a sharp peak for the l1 regularization (Laplacean).
L1 corresponds to setting a Laplacean prior on the terms, while L2 corresponds to a Gaussian prior.
Don't give this answer unless you understand what it means. It's not one of those standard answers to regurgitate without understanding.
Questions 1 and 10 are related. You can't answer question 1 without understanding question 10.
Question 12 is something that has a simple idea underlying it but explaining it can be very difficult. I suggest reading all of the answers in the link and also reading the other links that are given in the stack exchange link. The ideas discussed there are incredibly important but (IMO) are not well taught outside of theoretical stats classes like measure theory.
Question 15: time series is a different type of data structure and the majority of standard stats/machine learning approaches are not appropriate. The choice of what cross validation technique to use depends on more than just knowing that there's a time series involved. The linked stack exchange question is from someone who doesn't understand time series at all. If you work with time series data or you think you may be asked about it or work with it in the future, take a couple of hours and read up on time series.
Question 22: the supplied answer is overly simplistic. Methods for trying to ensure that you're not overfitting a model are going to depend on the model itself. If you read the answers in the linked quora question, they discuss this more.
Question 24: this answer is really handwavy. The two links are necessary to see what the author is vaguely hinting at.
2
1
1
15
u/ingloreous_wetard Sep 01 '20
Good interview questions for interviews at beginner position in Data Science jobs.