PINE LIBRARY

SMC_KNN

129
Library "SMC_KNN"

euclidean_distance(f1, f2)
  2つの特徴量ベクトル間のユークリッド距離を計算
  Parameters:
    f1 (array<float>): 特徴量配列 1
    f2 (array<float>): 特徴量配列 2
  Returns: float 距離 (Distance)

get_k_nearest(distances, k)
  K個の直近傍(Nearest Neighbors)のインデックスを取得
  Parameters:
    distances (array<float>): 現在のイベントと過去の全イベントとの距離配列
    k (int): 取得する近傍の数 (K)
  Returns: array<int> 最も距離が近い過去イベントのインデックス配列

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.