噪声对比数据可视化
ncvis的Python项目详细描述
ncvis
NCVis是一个有效的数据可视化解决方案它使用HNSW构造快速近邻图,并使用并行方法构造图嵌入。
安装
康达[推荐]
如果使用conda,则不需要设置环境,所有依赖项都将自动安装。
$ conda install -c alartum ncvis
皮普
Important:确保编译器支持OpenMPgcc默认情况下有,但clang的情况并非如此。您可能需要事先安装llvm openmp库
安装numpy和cython包(编译时依赖项):
$ pip install numpy cython
安装ncvis包:
$ pip install ncvis
使用
importncvisvis=ncvis.NCVis()Y=vis.fit(X)
可以找到一个更详细的示例here。
实验
可以使用download.sh脚本下载数据集:
$ bash examples/data/download.sh <dataset>
用表中相应的项替换<;dataset>;。您还可以一次下载所有这些文件:
$ bash examples/data/download.sh
然后可以使用来自datapython模块的接口来访问这些数据集。确保已安装这些软件包:
$ pip install -r examples/requirements-pip.txt
或
$ conda install --file examples/requirements-conda.txt
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 |
Flow Cytometry | flow | not yet |
GoogleNews | news | not yet |
每个数据集的使用方法如下:
Sample Code | Action |
---|---|
^{ | Load the dataset. |
^{ | Get the samples as numpy array of shape (n_samples, n_dimensions). If samples have more than one dimension they are all flattened. |
^{ | Get the labels of the samples. |
^{ | Get total number of samples. |
^{ | Get 0-th pair (sample, label) from the dataset. |
^{ | Get the original shape of the samples. For example, it equals to (28, 28) for MNIST. |