Skip to content
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

[WIP] Documentation & Notebook updates #341

Merged
merged 9 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ The original version (0.2) of cuxfilter, most known for the backend powering the

## Usage

### Example 1
### Example 1
[![Open In Studio Lab](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/auto_accidents_example.ipynb) [<img src="https://img.shields.io/badge/-Setup Studio Lab Environment-gray.svg">](./notebooks/README.md#amazon-sagemaker-studio-lab)

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/auto_accidents_example.ipynb) [<img src="https://img.shields.io/badge/-Setup Colab Environment-gray.svg">](./notebooks/README.md#google-colab)

```python
import cuxfilter
Expand All @@ -69,16 +72,19 @@ chart4 = cuxfilter.charts.bar('MONTH')
#declare dashboard
d = cux_df.dashboard([chart1, chart3, chart4], sidebar=[chart2], layout=cuxfilter.layouts.feature_and_double_base, title='Auto Accident Dataset')

# run the dashboard within the notebook cell
# d.app()

#run the dashboard as a webapp:
d.show('jupyter-notebook/lab-url')
# d.show('jupyter-notebook/lab-url')

#run the dashboard within the notebook cell
d.app()

```
![output dashboard](./docs/_images/demo.gif)

### Example 2

### Example 2
[![Open In Studio Lab](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/Mortgage_example.ipynb) [<img src="https://img.shields.io/badge/-Setup Studio Lab Environment-gray.svg">](./notebooks/README.md#amazon-sagemaker-studio-lab)

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/Mortgage_example.ipynb) [<img src="https://img.shields.io/badge/-Setup Colab Environment-gray.svg">](./notebooks/README.md#google-colab)

```python
import cuxfilter
Expand All @@ -104,11 +110,12 @@ chart1 = cuxfilter.charts.drop_down('dti')
#declare dashboard
d = cux_df.dashboard([chart0, chart2],sidebar=[chart3, chart1], layout=cuxfilter.layouts.feature_and_double_base,theme = cuxfilter.themes.light, title='Mortgage Dashboard')

# run the dashboard within the notebook cell
#run the dashboard within the notebook cell
# d.app()

#run the dashboard as a webapp:
d.show('jupyter-notebook/lab-url')

```
![output dashboard](./docs/_images/demo2.gif)

Expand Down Expand Up @@ -152,25 +159,17 @@ cuxfilter can be installed with conda ([miniconda](https://conda.io/miniconda.ht

For `cuxfilter version == 22.02` :
```bash
# for CUDA 10.1
# for CUDA 11.5
conda install -c rapidsai -c nvidia -c numba -c conda-forge \
cuxfilter=22.02 python=3.7 cudatoolkit=10.1

# or, for CUDA 10.2
conda install -c rapidsai -c nvidia -c numba -c conda-forge \
cuxfilter=22.02 python=3.7 cudatoolkit=10.2
cuxfilter=22.02 python=3.7 cudatoolkit=11.5

```

For the nightly version of `cuxfilter` :
```bash
# for CUDA 10.1
conda install -c rapidsai-nightly -c nvidia -c numba -c conda-forge \
cuxfilter python=3.7 cudatoolkit=10.1

# or, for CUDA 10.2
# for CUDA 11.5
conda install -c rapidsai-nightly -c nvidia -c numba -c conda-forge \
cuxfilter python=3.7 cudatoolkit=10.2
cuxfilter python=3.7 cudatoolkit=11.5
```

Note: cuxfilter is supported only on Linux, and with Python versions 3.7 and later.
Expand Down Expand Up @@ -214,6 +213,8 @@ The notebooks inside `python/notebooks` already have a check function which veri

While in the directory you want the datasets to be saved, execute the following

> Note: Auto Accidents dataset has corrupted coordinate data from the years 2012-2014

```bash
#go the the environment where cuxfilter is installed. Skip if in a docker container
source activate test_env
Expand All @@ -239,7 +240,6 @@ Currently supported layout templates and example code can be found on the [layou
| custom | view_dataframe |
| pydeck | choropleth(3d and 2d) |


## Contributing Developers Guide

cuxfilter acts like a connector library and it is easy to add support for new libraries. The `python/cuxfilter/charts/core` directory has all the core chart classes which can be inherited and used to implement a few (viz related) functions and support dashboarding in cuxfilter directly.
Expand Down
Binary file modified docs/_images/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 72 additions & 4 deletions notebooks/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,78 @@
# Example notebooks

These are example notebooks to showcase cuxfilter. Related Datasets can be download using the link below:
These are example notebooks to showcase cuxfilter.

- Download the mortgage dataset from [here](https://docs.rapids.ai/datasets/mortgage-viz-data)
## TRY CUXFILTER NOTEBOOKS ONLINE

- Nyc taxi dataset from [here](https://drive.google.com/file/d/1mTvl66VLzHwQJPcgnGBdmZTNEdNp1tYo/view?usp=sharing)
[<img src="https://img.shields.io/badge/-Setup Studio Lab Environment-gray.svg">](#amazon-sagemaker-studio-lab) [<img src="https://img.shields.io/badge/-Setup Colab Environment-gray.svg">](#google-colab)

1. Mortgage_example.ipynb

- Auto dataset from [here](https://drive.google.com/file/d/1jxySYJ9e32hI8PQ5QPr9_xrsu37N5fOM/view?usp=sharing)
[![Open In Studio Lab](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/Mortgage_example.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/Mortgage_example.ipynb)

2. NYC_taxi_example.ipynb

[![Open In Studio Lab](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/NYC_taxi_example.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/NYC_taxi_example.ipynb)

3. auto_accidents_example.ipynb

[![Open In Studio Lab](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/auto_accidents_example.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/auto_accidents_example.ipynb)

4. graphs.ipynb

[![Open In Studio Lab](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/graphs.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rapidsai/cuxfilter/blob/branch-22.02/notebooks/graphs.ipynb)
</br>


## Setup Remote Environments
### Amazon Sagemaker Studio Lab

[Amazon SageMaker Studio Lab](https://studiolab.sagemaker.aws/faq) is a free ML development environment that provides the compute, storage (up to 15GB), and security —all at no cost (currently). This includes GPU notebook instances.

Once you have registered with your email address, simply sign in to your account, start a CPU or GPU runtime, and open your project - all in your browser.

To setup a rapids environment in studio lab(you only need to do this the first time, since studio lab has 15GB of persistent storage across sessions), open a new terminal:

```bash
conda install ipykernel

# for stable rapids version
conda install -c rapidsai -c nvidia -c numba -c conda-forge \
cuxfilter=22.02 python=3.7 cudatoolkit=11.5

# for nightly rapids version
conda install -c rapidsai-nightly -c nvidia -c numba -c conda-forge \
cuxfilter python=3.7 cudatoolkit=11.5
```
AjayThorve marked this conversation as resolved.
Show resolved Hide resolved
> Above are sample install snippets for cuxfilter, see the [Get RAPIDS version picker](https://rapids.ai/start.html) for installing the latest `cuxfilter` version.

Once installed, you should see a card in the launcher for that environment and kernel after about a minute.

<div class="alert alert-info"> <b>Note:</b> It may take about one minute for the new environment to appear as a kernel option.</div>


### Google Colab

[Google Colab](https://colab.research.google.com/?utm_source=scs-index), or "Colaboratory", allows you to write and execute Python in your browser, with
- Zero configuration required
- Free access to GPUs
- Easy sharing

To launch cuxfilter notebooks on the colab environment, you need to follow the the RAPIDS installation instructions guide by clicking [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1rY7Ln6rEE1pOlfSHCYOVaqt8OvDO35J0#forceEdit=true&offline=true&sandboxMode=true). Once the RAPIDS libraries are installed, you can run the cuxfilter notebooks.

> Note: Unlike Studio Lab, environment storage is not persistent and each notebook needs a separate RAPIDS installation every time you start a new session.

> Copy the installation notebook cells to the top of the cuxfilter notebooks and install RAPIDS before executing the cuxfilter code.


</br>

## Download Datasets
- [Mortgage dataset](https://docs.rapids.ai/datasets/mortgage-viz-data)

- [Nyc taxi dataset](https://drive.google.com/file/d/1mTvl66VLzHwQJPcgnGBdmZTNEdNp1tYo/view?usp=sharing)

- [Auto Accidents dataset](https://drive.google.com/file/d/1jxySYJ9e32hI8PQ5QPr9_xrsu37N5fOM/view?usp=sharing)

> Note: Auto Accidents dataset has corrupted coordinate data from the years 2012-2014