33. BigQuery による最近傍探索
CREATE TEMPORARY FUNCTION
calc_distance(x ARRAY<FLOAT64>,
y ARRAY<FLOAT64>)
RETURNS FLOAT64
LANGUAGE js AS """
// Calculate distance
// e.g. Euclidean, Cosine, Hamming
distance = …
return distance;
""";
…
WITH all_dist AS (
SELECT
a.item_id AS a_id,
b.item_id AS b_id,
calc_distance(a.vector, b.vector) AS dist
FROM feature AS a CROSS JOIN feature AS b),
ranking AS (# Assign rank to item using window),
knns AS (# Extract and aggregate kNNs),
...
44. CV 予測モデル
全結合の NN
CV するか否かの 2 値分類
入力はユーザ特徴, プラン特徴ベクトル
CDAE の中間層出力
User feature Plan feature
CV
ReLU
Dropout
L2 regularization
Softmax
45. 推薦モデル
CV 確率降順にプラン ID をソート
入力はユーザ ID と宿 ID
GET リクエストパスで受け取る
ユーザ ID と宿 ID を特徴ベクトルへ
マッピング User ID Plan IDs
CV
model
Plan IDs
User feature Plan feature
Yad ID