注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
超详细 🐶 DS 面经,求大米!正在努力找工作上岸!
. 1point3acres.com
. Χ
总得来说面试题比较难,但是面试官都比较友善,也比较会引导(除了其中一轮)。感觉 🐶 家的面试很难准备,不像元宇宙有很多面经。感觉还是靠平时的积累。
Technical: Statistics. .и
Question 1: Assume we have a sample with 100 data points. The sample mean is 100, and margin of error is 10. The confidence interval is [70, 90]. The PM complains that the confidence interval is too wide. What can you do?
回答:可以考虑增大 sample size.
Follow up: Let’s say we increase the sample size to 10000. How will the CI change? Can you think of other ways to make the CI narrower without increasing the sample size?
回答:增加 significance level 可以让 CI 变窄.
Question 2: Assume we have a linear model Y = X * b, where X = (X_1, X_2, …, X_m) and b = (b_0, b_1, …, b_m). Also we have n data points (y_i, x_i). How would you estimate b?
回答:We can use OLS assuming we have m < n. Estimated b will be (X^T X)^{-1} X^T Y
Follow up: Let’s assume we actually have more features than data points. That is m > n. What would you do?
回答:A few options to consider. (1) Do we really need all m features? Consider feature selection before building the model using business context. (2) Consider regularization method such as lasso regression. (3) Upsample from existing observation to make n > n.(我后来想了想其实这个不是很合理)(4) Try other methods like random forecasts.
Question 3: If we want to know if some feature is relevant or not, what can we do?. 1point 3acres
回答:urve. 脑子有点卡壳,一下子没想起来 precision 的定义。Python 函数倒是很好写。
第二个问题是,假设现在给你一个 regression model 的 output,这个模型是预测每个国家的 revenue 有多少。CSV 一共有三列:country, actual revenue, predicted revenue. 先是讨论应该用什么 metric. 我说可以考虑 MSE 或者 weighted MSE,然后面试官就各种 challenge:你为什么看 mean 而不是 sum,哪个比较好,etc. 最后说那就 implement RMSE 好了。然后写到一半说 “Wait, why are you taking the difference?” 然后说我们想要的是 percentage: sqrt(avg(sum_i (predicted_i / actual_i - 1)^2)).
写完了之后问我怎么得出 percentage RMSE(我都没见过这个 metric)的 CI,答“bootstrap”,然后写到一半又说 “Wait a second, why is your bootstrap sample the same sample size as the original sample?” 然后我就说 “Oh, this is quite common and I think it’s the standard procedure of nonparametric bootstrap?” 然后他说“那你是不是有概率得到一个和原来的 sample 一样的 bootstrap sample 呢?”我还以为是考概率题,正准备算,然后面试官说 “Oh actually it’s not very likely. Never mind.” |