Closed tomasjoh closed 4 months ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Split into two PRs: C++: https://github.com/rapidsai/cuml/pull/5987 Python and Benchmarking: https://github.com/rapidsai/cuml/pull/5988
Description
Adds C++, Python, and benchmarking code for Kernel PCA. This implementation of Kernel PCA support fit(), transform(), and fit_transform().
Feature request: https://github.com/rapidsai/cuml/issues/1317
Tests and benchmarks were performed on an EC2
g4dn.xlarge
instance with CUDA 12.2.Click here to see environment details
Notes for Reviewers
The API deviates from SKlearn by not supporting options for these fields: fit_inverse_transform, random_state, n_jobs, max_iter. If a user tries to set one of them a
NotImplementedError
will be raised. The Criteria of Done mentions making the class pickable incuml/tests/test_pickle.py
. I couldn't find a PCA reference for this. Would appreciate pointers if additional work is needed.Benchmarks
From
notebooks/tools/cuml_benchmarks.ipynb
Benchmark output
C++ unit test reference
Sklearn script to generate C++ test reference data
Output from script and C++ expected values are below. Note that C++ matrices are in column order while Python w. numpy uses row order. Sklearn linear kernel:
C++ test reference:
Sklearn poly kernel:
C++ test reference:
Sklearn rbf kernel:
C++ test reference:
Manual tests
Kernel PCA with RBF kernel
code
Kernel PCA with poly kernel
code
Projecting testing data
Case is copied from sklearn, except it uses cuML PCA and kernelPCA
code
Definition of Done Criteria Checklist
C++ Checklist
Design
Testing
Documentation
Python Checklist
Design
cuml/tests/test_pickle.py
input_to_cuml_array
to accept flexible inputs and check their datatypes and usecumlArray.to_output()
to return configurable outputs.CumlArray
Testing
python/cuml/benchmarks/algorithms.py
and benchmarks notebook inpython/cuml/notebooks/tools/cuml_benchmarks.ipynb
Unit test results
C++ Test Results
Python Test Results