| | |
- HNSWSummary(object=None, **generic_arguments)
- DESCRIPTION:
The HNSWSummary() function accepts the model generated from
HNSW() function as input and converts the model data into
readable format.
PARAMETERS:
object:
Required Argument.
Specifies the teradataml DataFrame containing the
HNSW model.
Types: teradataml DataFrame
**generic_arguments:
Specifies the generic keyword arguments SQLE functions accept. Below
are the generic keyword arguments:
persist:
Optional Argument.
Specifies whether to persist the results of the
function in a table or not. When set to True,
results are persisted in a table; otherwise,
results are garbage collected at the end of the
session.
Default Value: False
Types: bool
volatile:
Optional Argument.
Specifies whether to put the results of the
function in a volatile table or not. When set to
True, results are stored in a volatile table,
otherwise not.
Default Value: False
Types: bool
Function allows the user to partition, hash, order or local
order the input data. These generic arguments are available
for each argument that accepts teradataml DataFrame as
input and can be accessed as:
* "<input_data_arg_name>_partition_column" accepts str or
list of str (Strings)
* "<input_data_arg_name>_hash_column" accepts str or list
of str (Strings)
* "<input_data_arg_name>_order_column" accepts str or list
of str (Strings)
* "local_order_<input_data_arg_name>" accepts boolean
Note:
These generic arguments are supported by teradataml if
the underlying SQL Engine function supports, else an
exception is raised.
RETURNS:
Instance of HNSWSummary.
Output teradataml DataFrames can be accessed using attribute
references, such as HNSWSummaryObj.<attribute_name>.
Output teradataml DataFrame attribute name is:
result
RAISES:
TeradataMlException, TypeError, ValueError
EXAMPLES:
# Notes:
# 1. Get the connection to Vantage, before importing the
# function in user space.
# 2. User can import the function, if it is available on
# Vantage user is connected to.
# 3. To check the list of analytic functions available on
# Vantage user connected to, use
# "display_analytic_functions()".
# Load the example data.
load_example_data("teradataml", ["hnsw_data"])
# Create teradataml DataFrame objects.
hnsw_data = DataFrame.from_table("hnsw_data")
# Check the list of available analytic functions.
display_analytic_functions()
# Import function HNSW, HNSWSummary.
from teradataml import HNSW, HNSWSummary
# Example 1 : Convert the model into readable format generated
# by HNSW() function.
HNSW_out = HNSW(data = hnsw_data,
id_column = "id",
vector_column = "array_col",
seed = 1,
ef_construction = 16,
numconn_pernode = 16,
maxnumconn_pernode = 20,
distance_measure = "EUCLIDEAN",
embedding_size = 2,
apply_heuristics = True
)
# Pass the model generated from HNSW() function to HNSWSummary() function.
HNSWSummary_out = HNSWSummary(object = HNSW_out)
# Print the result DataFrame.
print(HNSWSummary_out.result)
|