All Projects → ankane → tsne-ruby

ankane / tsne-ruby

Licence: other
High performance t-SNE for Ruby

Programming Languages

ruby
36898 projects - #4 most used programming language
python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to tsne-ruby

scGEAToolbox
scGEAToolbox: Matlab toolbox for single-cell gene expression analyses
Stars: ✭ 15 (+0%)
Mutual labels:  tsne
Word2VecAndTsne
Scripts demo-ing how to train a Word2Vec model and reduce its vector space
Stars: ✭ 45 (+200%)
Mutual labels:  tsne
Fun-with-MNIST
Playing with MNIST. Machine Learning. Generative Models.
Stars: ✭ 23 (+53.33%)
Mutual labels:  tsne
Deepdetect
Deep Learning API and Server in C++14 support for Caffe, Caffe2, PyTorch,TensorRT, Dlib, NCNN, Tensorflow, XGBoost and TSNE
Stars: ✭ 2,306 (+15273.33%)
Mutual labels:  tsne
Multicore Tsne
Parallel t-SNE implementation with Python and Torch wrappers.
Stars: ✭ 1,664 (+10993.33%)
Mutual labels:  tsne
Amazon-Fine-Food-Review
Machine learning algorithm such as KNN,Naive Bayes,Logistic Regression,SVM,Decision Trees,Random Forest,k means and Truncated SVD on amazon fine food review
Stars: ✭ 28 (+86.67%)
Mutual labels:  tsne
Embeddings2Image
create "Karpathy's style" 2d images out of your image embeddings
Stars: ✭ 52 (+246.67%)
Mutual labels:  tsne
word2vec-tsne
Google News and Leo Tolstoy: Visualizing Word2Vec Word Embeddings using t-SNE.
Stars: ✭ 59 (+293.33%)
Mutual labels:  tsne
biovec
ProtVec can be used in protein interaction predictions, structure prediction, and protein data visualization.
Stars: ✭ 23 (+53.33%)
Mutual labels:  tsne
ReductionWrappers
R wrappers to connect Python dimensional reduction tools and single cell data objects (Seurat, SingleCellExperiment, etc...)
Stars: ✭ 31 (+106.67%)
Mutual labels:  tsne
scarf
Toolkit for highly memory efficient analysis of single-cell RNA-Seq, scATAC-Seq and CITE-Seq data. Analyze atlas scale datasets with millions of cells on laptop.
Stars: ✭ 54 (+260%)
Mutual labels:  tsne

t-SNE Ruby

High performance t-SNE for Ruby, powered by Multicore t-SNE

Build Status

Installation

Add this line to your application’s Gemfile:

gem 'tsne'

Getting Started

Prep your data

x = [[0, 0, 0], [0, 1, 1], [1, 0, 1], [1, 1, 1]]

Run

tsne = TSNE.new
tsne.fit_transform(x)

Get Kullback-Leibler divergence

tsne.kl_divergence

Full Example

Install the matplotlib gem and download the optdigits.tes from the Optical Recognition of Handwritten Digits Data Set.

require "csv"
require "matplotlib/pyplot"
require "tsne"

data = []
target = []
CSV.foreach("optdigits.tes", converters: :numeric) do |row|
  data << row[0...-1]
  target << row[-1]
end

tsne = TSNE.new(n_jobs: 4)
embeddings = tsne.fit_transform(data)

vis_x = embeddings[true, 0]
vis_y = embeddings[true, 1]

plt = Matplotlib::Pyplot
plt.scatter(vis_x.to_a, vis_y.to_a, c: target, cmap: plt.cm.get_cmap("jet", 10), marker: ".")
plt.colorbar(ticks: 10.times.to_a)
plt.clim(-0.5, 9.5)
plt.show

Parameters

TSNE.new(
  n_components: 2,
  perplexity: 30.0,
  early_exaggeration: 12,
  learning_rate: 200,
  n_iter: 1000,
  n_iter_early_exag: 250,
  verbose: 0,
  random_state: -1,
  angle: 0.5,
  n_jobs: 1,
  cheat_metric: true
)

Data

Data can be a Ruby array

[[0, 0, 0], [0, 1, 1], [1, 0, 1], [1, 1, 1]]

Or a Numo array

Numo::DFloat.new(4, 3).rand

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/tsne-ruby.git
cd tsne-ruby
bundle install
bundle exec rake vendor:all
bundle exec rake test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].