Examples for NCVis Python wrapper.
| Notebook | Contents |
|---|---|
| sample.ipynb | Introduction to NCVis |
| big-data.ipynb | Large-scale application case |
You do not need to setup the environment if using conda, all dependencies are installed automatically.
$ conda install --file requirements-conda.txtImportant: be sure to have a compiler with OpenMP support. GCC has it by default, which is not the case with clang. You may need to install llvm-openmp library beforehand.
- Install numpy and cython packages (compile-time dependencies):
$ pip install numpy cython
- Install other packages:
$ pip install -r requirements-pip.txt
Datasets can be dowloaded by using the download.sh script:
$ bash data/download.sh <dataset>Replace <dataset> with corresponding entry from the table. You can also download all of them at once:
$ bash data/download.shThe datasets can be then accessed by using interfaces from the data Python module.
| Dataset | <dataset> | Dataset Class |
|---|---|---|
| MNIST | mnist | MNIST |
| Fashion MNIST | fmnist | FMNIST |
| Iris | iris | Iris |
| Handwritten Digits | pendigits | PenDigits |
| COIL-20 | coil20 | COIL20 |
| COIL-100 | coil100 | COIL100 |
| Mouse scRNA-seq | scrna | ScRNA |
| Statlog (Shuttle) | shuttle | Shuttle |
Each dataset can be used in the following way:
| Sample Code | Action |
|---|---|
d = data.MNIST() |
Load the dataset. |
ds.X |
Get the samples as numpy array of shape (n_samples, n_dimensions). If samples have more than one dimension they are all flattened. |
ds.y |
Get the labels of the samples. |
len(ds) |
Get total number of samples. |
ds[0] |
Get 0-th pair (sample, label) from the dataset. |
ds.shape |
Get the original shape of the samples. For example, it equals to (28, 28) for MNIST. |