ML:基礎技法學習
Package:scikit-learn
課程:機器學習技法
簡介:第十五講 Matrix Factorization
為 complete
比較如下圖
Linear autoencoder 可參考 [ML] 機器學習技法:第十三講 Deep Learning
針對電影的例子,因理論上越接近現在的時間,越接近使用者的喜好
依 SGD 設計出改進方案,最後 次的更新限定在從最近的資料挑選,不再是從全部挑選
sklearn.preprocessing.OneHotEncoder
Package:scikit-learn
課程:機器學習技法
簡介:第十五講 Matrix Factorization
Basic Matrix Factorization
常數項 被移除
- 初始化
維度的
通常為隨機產生,以免陷入 Local optimum - alternating optimization
直到收斂 - 最佳化
更新 ,利用 m-th-movie 的 做 linear regression - 最佳化
更新 ,利用 n-th-user 的 做 linear regression
Linear Autoencoder vs. Matrix Factorization
Linear Autoencoder ≡ 特別的 Matrix Factorization 其比較如下圖
Linear autoencoder 可參考 [ML] 機器學習技法:第十三講 Deep Learning
Stochastic Gradient Descent Matrix Factorization
較適用於龐大的資料
若對演算法有足夠的了解,可依其實際做出改善- 初始化
維度的
通常為隨機產生,以免陷入 Local optimum - for
- 隨機從
挑出一個 - 計算 residual
-
SGD-update
針對電影的例子,因理論上越接近現在的時間,越接近使用者的喜好
依 SGD 設計出改進方案,最後
總結
- Extraction Models
- 將特徵轉換包含在學習中,最後執行 linear model
- 好處
- 簡單,無需再特別設計 features
- powerful
- 壞處
- 難以最佳化,因為 non-convex
- overfitting,需要適當的 regularization/validation
- 種類
- Adaptive/Gradient Boosting
- [ML] 機器學習技法:第十一講 Gradient Boosted Decision Tree
- 特徵轉換
- hypotheses
- 方法
- functional gradient descent
- linear model
- weights
- Neural Network/Deep Learning
- [ML] 機器學習技法:第十二講 Neural Network
- 特徵轉換
- weights
- 方法
- autoencoder 初始化權重
- SGD (backprop) 更新權重
- linear model
- weights
- RBF Network
- [ML] 機器學習技法:第十四講 Radial Basis Function Network
- 特徵轉換
- RBF centers
- 方法
- k-means clustering 初始化中心點
- linear model
- weights
- k Nearest Neighbor
- lazy learning
- [ML] 機器學習技法:第十四講 Radial Basis Function Network
- 特徵轉換
-neighbor RBF- linear model
- weights
- Matrix Factorization
- 因是對稱互為特徵轉換 與 linear model
- user features
- movie features
- 方法
- SGD
- alternating leastSQR
程式碼
BinaryVectorEncoding
- from sklearn import preprocessing
- lb = preprocessing.LabelBinarizer()
- lb.fit(['A', 'B', 'A', 'AB', 'O'])
- print(lb.classes_)
- # array(['A' 'AB' 'B' 'O'])
- print(lb.transform(['A', 'B']))
- # [[1 0 0 0]
- # [0 0 1 0]]
參考
sklearn.preprocessing.LabelBinarizersklearn.preprocessing.OneHotEncoder
留言
張貼留言