Version:

UDF Python ExamplesΒΆ

The following are complete examples of the implementation & execution of User-Defined Functions (UDFs) in the UDF Python API.

Example UDF (CUDA) - CUBLAS
Example of various computations, making use of the scikit-CUDA interface for making CUDA calls from Python. This UDF uses CUDA libraries and must be run on a CUDA build of Kinetica. It also involves a Python package that must be installed before the UDF is run.
Example UDF (Non-CUDA) - Distributed Model
Example of how to build multiple models based on distributed data and combine them into an ensemble. This UDF does not use CUDA libraries and can be run on an Intel build of Kinetica.
Example UDF (Non-CUDA) - H2O Generalized Linear Model (GLM)
Example of how to build a generalized linear model (GLM) using H2O that detects correlation between different types of loan data and if a loan is bad or not. A GLM estimates regression analysis based on a given distribution. This UDF does not use CUDA libraries and can be run on an Intel build of Kinetica.
Example UDF (Non-CUDA) - H2O Random Forest Model
Example of how to build a model using the random forest method via H2O. This model will learn to detect if a loan is bad or not depending on related loan data. The random forest method trains multiple models on small subsets of a large dataset and then combines the models' inference output. This UDF does not use CUDA libraries and can be run on an Intel build of Kinetica.
Example UDF (Non-CUDA) - Pandas
Example of how to utilize pandas dataframes in UDFs and how to insert the dataframes into Kinetica. This UDF does not use CUDA libraries and can be run on an Intel build of Kinetica.
Example UDF (Non-CUDA) - Sum of Squares
Example of the computation of the sum of squares, summing the squares of input table columns and storing the result in an output table. This UDF does not use CUDA libraries and can be run on an Intel build of Kinetica.