ASPL User's Guide v 1.00
© 2024 by SetSphere.com


10-1

   Similarity Operations

Similarity is a cosine based calculation of the angle between vectors in a plane. Setting aside its implementation, ASPL provides the similarity or its abbreviation sim as a command to calculate the similarity between your datasets. In this example, we will load the RANDONEBIT and calculate the similarity between the randomly generated groups in the workspace:

aspl -wsname RANDONEBIT -groupingclass BITGROUP

aspl>  sim v1 v2 v3
    display the similarity between v1 v2 and v3

aspl>  simi123 = sim v1 v2 v3
    assign the similarity calculatiion to COS variable simi123

aspl>  c
    display the COS symbol table

aspl>  ?c simi123
    interrogate the similarity variable simi123

aspl>  ??c simi123
    really interrogate simi123

aspl>  c sorted
    display COS symbol table in sorted mode

aspl>  v sorted
    display the symbol table in sorted mode

aspl>  @c simi123
    display the archived COS variables for simi123

aspl>  @@c simi123
    display the dependencies for COS variables simi123

aspl>  quit
    leave ASPL without saving the workspace RANDONEBIT



A similarity variable is interrogated by preceding it with the operator ?c

To really interrogate a similarity COS variable by sourcing the variables it depends on, precede the COS variable with the operator ??c and
this will cause sourcing the dependendies variables and may also result in updates in the sourced variables.

To view the archived similarities of a COS variable, precede the variable name with the operator @c

To view the variables that a COS variable depend on, precede the COS variable name with the operator @@c

ASPL set variables are stored in datasets symbol table (or simply called variables-symbol-table), while ASPL similarity variables are stored in COS-symbol-table. To display the variables-symbol-table use the command v or v sorted and to view the COS-symbol-table use the command c or c sorted



Remember that ASPL stores the similarity variables in its COS symbol table that you can display its contents anytime by typing any of the following commands at the ASPL prompt: c C cos COS