-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC Add basic example gallery infrastructure and two examples #5845
base: branch-24.06
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the addition @betatim !
Example gallery | ||
=============== | ||
|
||
Below is a gallery of examples showing how to use cuml. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below is a gallery of examples showing how to use cuml. | |
Below is a gallery of examples showing how to use cuML. |
@@ -0,0 +1,128 @@ | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I was wondering how to deal with licensing and attribution. My best guess so far would be something like the following. Though the BSD3 license says we also need to reproduce the 3 clauses and disclaimer. But that would add excessive amount of text to the top of each file. Maybe we can deal with it in some other way? Is there prior art somewhere?
# BSD 3-Clause License
#
# Copyright (c) 2007-2024 The scikit-learn developers.
# All rights reserved.
#
#
# Copyright (c) 2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
@@ -0,0 +1,247 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before
@@ -0,0 +1,205 @@ | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
I have been looking at the scikit-learn gallery and attempting to "translate" examples from it to use RAPIDS projects where possible. Mostly this is an exercise in learning how such transformations look, what changes are common, etc
I thought it could be nice to add these examples to the cuml gallery, realised there was none and hence this PR.
It adds basic infrastructure to make a gallery work. The gallery is a new section in the documentation and examples are cross linked from the API docs of a class (at the bottom of
KMeans
it shows a thumbnail for the example that usesKMeans
).What do people think of this?
It would be ideal to somehow be able to highlight the differences between the "cuml" and "scikit-learn" versions of an example. That way readers could more easily see the bits that are relevant to "I have CPU code and want to move to GPU". However, I don't know how to do that :D
I plan to translate a few more examples, but not all of them. I think getting this merged even with a "slim" gallery to start would be good, that way others could also add examples (instead of having one mega PR that is essentially blocked on one person and unreviewable)
Marking as draft for now to see what the CI robots say and what needs fixing up for the docs preview.