Author: Vinta
-
Updated
Generate negative samples for recommender system?
Category: AI
對 implicit feedback 的 ALS 來說,手動加入負樣本(Rui = 0 的樣本)是沒有意義的,因為 missing value / non-observed value 對該演算法來說本來就是 0,表示用戶確實沒有對該物品做出行為,也就是 Pui = 0 沒有偏好。
-
Updated
Spark ML cookbook (Python)
Category: AI, Big Data, Python
As of Spark 2.0, the RDD-based APIs in the spark.mllib package have entered maintenance mode. The primary Machine Learning API for Spark is now the DataFrame-based API in the spark.ml package.
-
Updated
Spark SQL cookbook (Python)
Category: AI, Big Data, Python
Spark SQL is a Spark module for structured data processing. Unlike the basic Spark RDD API, the interfaces provided by Spark SQL provide Spark with more information about the structure of both the data and the computation being performed.
-
Updated
Spark RDD methods (Python / Scala)
Category: AI, Big Data, Python
以下的 methods 有些是所有 RDD 都能用,有些則是 PairRDD 才有的功能。然後因為在不同的 projects 我先後用了 Spark 的 Python API 和 Scala API,所以以下的內容可能會混雜著兩者的範例。Scala API 要特別注意每個 method 接受和回傳的 type 的差異;Python API 就沒有這種限制了,畢竟是動態語言。
-
Updated
Setup Spark on macOS
Category: AI, Big Data, Python
Install Spark on macOS with Homebrew or the pre-built tarball. You need Java 8 JDK first.
-
Updated
Recommender System: Matrix Factorization
Category: AI
只要用戶對物品有過行為(Rui > 0),我們就假設用戶對該物品有偏好(Pui = 1),用戶對該物品的行為越多(Rui 越大),Cui 就會越大,表示置信度越高,假設越可信;如果用戶對該物品沒有行為(Rui = 0),就假設用戶對該物品沒有偏好(Pui = 0),但是因為 Cui = 1 + alpha x 0,所以這個假設相對來說置信度較低,比較不可信。
-
Updated
-
Updated
Functional Programming in Python
Category: Python
map() 會讓 list 的每一個元素都會各自經過 func(x) 去處理,最後得到的會是一個新的數量相同的 list。
-
Updated
MySQL system error codes
Print all OS error codes and MySQL error codes using the perror command.
-
Updated
Calculate the similarity of two vectors
You should only calculate Pearson Correlations when the number of items in common between two users is > 1, preferably greater than 5/10. Only calculate the Pearson Correlation for two users where they have commonly rated items.