Skip to content

stat-ml/ncvis-examples

Repository files navigation

ncvis-examples

Examples for NCVis Python wrapper.

Notebook Contents
sample.ipynb Introduction to NCVis
big-data.ipynb Large-scale application case

Setup

Conda [recommended]

You do not need to setup the environment if using conda, all dependencies are installed automatically.

 $ conda install --file requirements-conda.txt

Pip [not recommended]

Important: 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.

  1. Install numpy and cython packages (compile-time dependencies):
    $ pip install numpy cython
  2. Install other packages:
    $ pip install -r requirements-pip.txt

Popular Datasets

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.sh

The 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.

About

Examples for NCVis Python wrapper.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages