external help file | Module Name | online version | schema |
---|---|---|---|
PSOpenAI-help.xml |
PSOpenAI |
2.0.0 |
Calculate cosine similarity between two vectors.
Get-CosineSimilarity
[-Vector1] <Double[]>
[-Vector2] <Double[]>
[<CommonParameters>]
Calculate cosine similarity between two vectors.
PS C:\> $v1 = (-0.01302161, -0.01999075, 0.007301898)
PS C:\> $v2 = (0.01506045, -0.04311577, 0.01272033)
PS C:\> Get-CosineSimilarity $v1 $v2
0.00144161334877118
First vector
Type: Double[]
Required: True
Position: 0
Second vector. The dimension is must same as first vector.
Type: Double[]
Required: True
Position: 1
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.