PPT: https://docs.google.com/presentation/d/13o2f5BR7bowmZ8CBV-b3cBjgX8aPJ5t5wV_Gq_2QsZ4/edit

Two Web Pages

Given two web pages with different layouts, which one is better?

Solution 1: Quay-square test

good for small dataset

Solution 2: Boostrap test

good for large dataset

Fisher exactly test

Machine Learning

Model

What is the fundamental idea behind Support Vector Machine?

  1. maximum margin

最优化问题 -> Omega -> 对偶 -> KKT

  1. 尽可能降低误差 hinge loss, balance, tradeoff

  2. non-linear的话,需要加入 kernel function

复变函数中将一个空间转移到另外一个空间

kernel function会把原空间中的内积,映射到新空间中的内积。使得原空间中的线性分类器,映射为新空间中的非线性分类器。

找kernel没有什么好办法,

  • RBF
  • polynomil

What is the Random Forrest, AdBoost and GBDT?

Random Forrest每棵树都是同样的等级,variance变化快。

AdBoost和GBDT

AdaBoost跟GBDT的区别?

GBDT还会学习error

What is PCA? How does it work? Also tell some goods and bad about it?

PCA主要是做降维,不能解决overfitting.

PCA找egen value, 找协方差矩阵, 找特征向量, 然后制作projection matrix。

egen value是原来feature的linear combination

PCA的话

Overfitting的最有效的方法是进行regulartion 规格化, 或者使用feature engineering, 或者增加样本量。

Why doesn’t Logistic Regression use R^2?

R^2 是用在regression, Logistic Regression是分类器。

When to use L1 instead of L2?

L1 Lasso Regression

L2

L1 会把系数惩罚为0,这样可以进行一定程度上的feature selection; L2是光滑收敛的, 会更好的

ElasticNet是L1跟L2的结合。

Overfitting?

模型在training set效果好,在testing set上的效果不好。模型的泛化能力很弱。

解决办法:regularation, l1, l2, 增加数据集, deep learning中的drop out, ensummebling的树越多,会提高variance, 这样可以避免overfitting。

cursor of dimensionality?

训练效率低

容易overfitting

Bias and variance tradeoff?

Bias低Variance高,容易overfitting

Bias高Variance低,容易under fitting

Multicolinearity?

多重共线性问题。

多重共线性是因为不同feature之间有相关性,

解决方法是

  1. feature selection
  2. 计算feature之间的相关性,把相关性高的feature移除。

One-hot encoding? Dummy variable?

Dummy variable不能保证不同category之间的距离相同,会有隐患。

one-hot encoding一般在非线性模型下用

dummy variable一般在线性模型下用, intercept term

Co-founder?

Case Study

Online Education

Now you need to assign a difficulty level to each course in FLAGDream, how would you implement this functionality?

Solution 1: domain knowledge

easy

intermediate

hard

数据量小的时候,可以快糙猛的人工进行快速分类。数据量大的时候再开始考虑模型。

Solution 2: classification model

multi-class classification model

样本是每个课程,预测结果就是课程的难易程度分类。

Evaluation method

AUC

ROC

F1

contax, 凸优化

cross validation的最主要的目的是为了进行模型超参数调整。

分析类的DS需要的门槛

  1. 麦肯锡case interview cracking
  2. Capital One

SQL的能力,一般需要跟实际业务需求挂钩之后,才能比较好的提升。

left join, right join, window function, case when, group by,

Leetcode的SQL题都刷完可以比较溜。

Think loud!

leetcode刷题之后一定要及时总结!