COSINE_SIMILARITY (Lakehouse v2)
Retorna a similaridade de cosseno entre dois arrays (vetores).
Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”func.cosine_similarity(<array1>, <array2>)Exemplos do Analyze
Seção intitulada “Exemplos do Analyze”func.cosine_similarity([1.0, 2.0], [2.0, 4.0])
┌─────┐│ 1.0 │└─────┘Sintaxe SQL
Seção intitulada “Sintaxe SQL”COSINE_SIMILARITY(<array1>, <array2>)Exemplos de SQL
Seção intitulada “Exemplos de SQL”SELECT COSINE_SIMILARITY([1.0, 2.0], [2.0, 4.0]);
┌─────┐│ 1.0 │└─────┘