← 开源
yoshoku

rumale

Rumale is a machine learning library in Ruby

Model DevelopmentClassical MLRuby
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
918
Star
34
Fork
+0
本周
10
贡献者
创建于 2017-09-30 · 更新于 2026-09-14 · 今日第 12651 名
主要开发者
yoshokukojix2bkmgit

yoshoku/rumale 排名第 12,651,有 918 个星标。

同类别比较

yoshoku/rumale 排名第 12,651,此处有 8 个同类条目;sberbank-ai-lab/LightAutoML 排名第 12,650。

同类别比较
名称排名指标
BIDData/BIDMach12,645
语言:
Scala
星标数:
918
分叉数:
169
简介:
CPU and GPU-accelerated Machine Learning Library
MarvinTeichmann/KittiSeg12,646
语言:
Python
星标数:
918
分叉数:
394
简介:
A Kitti Road Segmentation model implemented in tensorflow.
MontaEllis/Pytorch-Medical-Segmentation12,647
语言:
Python
星标数:
918
分叉数:
198
简介:
This repository is an unoffical PyTorch implementation of Medical segmentation in 2D and 3D.
sberbank-ai-lab/LightAutoML12,650
语言:
Python
星标数:
918
分叉数:
97
简介:
LAMA - automatic model creation framework
HRNet/Lite-HRNet12,659
语言:
Python
星标数:
916
分叉数:
133
简介:
This is an official pytorch implementation of Lite-HRNet: A Lightweight High-Resolution Network.
Samsung/veles12,660
语言:
C++
星标数:
916
分叉数:
182
简介:
Distributed machine learning platform
oh-my-ocr/text_renderer12,665
语言:
Python
星标数:
916
分叉数:
174
简介:
Generate text line images for training deep learning OCR models
ai4co/rl4co12,671
语言:
Python
星标数:
914
分叉数:
156
简介:
A PyTorch library for all things Reinforcement Learning (RL) for Combinatorial Optimization (CO)
关键参数与规格
关键参数与规格
参数值
语言Ruby
类别Model Development
子类别Classical ML
星标数918
分叉数34
贡献者10
创建日期2017-09-30
更新日期2026-09-14
1 天星标数0
7 天星标数0
排名12,651
上次排名12,569
排名变化-82
7 天星标排名13,534
上次 7 天星标排名13,546
7 天星标排名变化12
总星标排名11,888
上次总星标排名11,868
总星标排名变化-20
国家Japan
README 摘录

Rumale Rumale (**Ru**by **ma**chine **le**arning) is a machine learning library in Ruby. Rumale provides machine learning algorithms with interfaces similar to Scikit-Learn in Python. Rumale supports Support Vector Machine, Logistic Regression, Ridge, Lasso, Multi-layer Perceptron, Naive Bayes, Decision Tree, Gradient Tree Boosting, Random Forest, K-Means, Gaussian Mixture Model, DBSCAN, Spectral Clustering, Mutidimensional Scaling, t-SNE, Fisher Discriminant Analysis, Neighbourhood Component Analysis, Principal Component Analysis, Non-negative Matrix Factorization, and many other algorithms. 0, Rumale

uses Numo::NArray Alternative instead of Numo::NArray as a dependency. Installation Add this line to your application's Gemfile: And then execute: Or install it yourself as: Documentation Rumale API Documentation Usage Example 1. Pendigits dataset classification Rumale provides function loading libsvm format dataset file. We start by downloading the pendigits dataset from LIBSVM Data web site. Training of the classifier with Linear SVM and RBF kernel feature map is the following code. Classifying testing data with the trained classifier

is the following code. Execution of the above scripts result in the following. Cross-validation Execution of the above scripts result in the following. Speedup Numo::Linalg Alternative Rumale uses Numo::NArray Alternative for typed arrays. Loading the Numo::Linalg Alterntaive allows to perform matrix and vector product of Numo::NArray Alternative using OpenBLAS libraries. Some machine learning algorithms frequently compute matrix and vector products, the execution speed of such algorithms can be expected to be accelerated. In ruby script

, just load Numo::Linalg along with Rumale. Parallel Several estimators in Rumale support parallel processing. Parallel processing in Rumale is realized by Parallel gem, so install and load it. Estimators that support parallel processing have n_jobs parameter. When -1 is given to n_jobs parameter, all processors are used. Related Projects Rumale::SVM provides support vector machine algorithms in LIBSVM and LIBLINEAR with Rumale interface. Rumale::Torch provides the learning and inference by the neural network defined in torch

. License The gem is available as open source under the terms of the BSD-3-Clause License.

常见问题

记录了多少星标和分叉?

yoshoku/rumale 有 918 个星标和 34 个分叉。

仓库排名是多少?

yoshoku/rumale 排名第 12,651。

记录的语言和类别是什么?

yoshoku/rumale 有 918 个星标,语言为 Ruby,类别为 Model Development。

哪个仓库排名最接近?

yoshoku/rumale 与 sberbank-ai-lab/LightAutoML 比较,后者排名第 12,650,有 918 个星标。

README

Rumale

Rumale (Ruby machine learning) is a machine learning library in Ruby. Rumale provides machine learning algorithms with interfaces similar to Scikit-Learn in Python. Rumale supports Support Vector Machine, Logistic Regression, Ridge, Lasso, Multi-layer Perceptron, Naive Bayes, Decision Tree, Gradient Tree Boosting, Random Forest, K-Means, Gaussian Mixture Model, DBSCAN, Spectral Clustering, Mutidimensional Scaling, t-SNE, Fisher Discriminant Analysis, Neighbourhood Component Analysis, Principal Component Analysis, Non-negative Matrix Factorization, and many other algorithms.

Note: Since v2.0.0, Rumale uses Numo::NArray Alternative instead of Numo::NArray as a dependency.

Installation

Add this line to your application's Gemfile:

gem 'rumale'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rumale

Documentation

Usage

Example 1. Pendigits dataset classification

Rumale provides function loading libsvm format dataset file. We start by downloading the pendigits dataset from LIBSVM Data web site.

$ wget https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/pendigits
$ wget https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/pendigits.t

Training of the classifier with Linear SVM and RBF kernel feature map is the following code.

require 'rumale'

# Load the training dataset.
samples, labels = Rumale::Dataset.load_libsvm_file('pendigits')

# Map training data to RBF kernel feature space.
transformer = Rumale::KernelApproximation::RBF.new(gamma: 0.0001, n_components: 1024, random_seed: 1)
transformed = transformer.fit_transform(samples)

# Train linear SVM classifier.
classifier = Rumale::LinearModel::SVC.new(reg_param: 0.0001)
classifier.fit(transformed, labels)

# Save the model.
File.open('transformer.dat', 'wb') { |f| f.write(Marshal.dump(transformer)) }
File.open('classifier.dat', 'wb') { |f| f.write(Marshal.dump(classifier)) }

Classifying testing data with the trained classifier is the following code.

require 'rumale'

# Load the testing dataset.
samples, labels = Rumale::Dataset.load_libsvm_file('pendigits.t')

# Load the model.
transformer = Marshal.load(File.binread('transformer.dat'))
classifier = Marshal.load(File.binread('classifier.dat'))

# Map testing data to RBF kernel feature space.
transformed = transformer.transform(samples)

# Classify the testing data and evaluate prediction results.
puts("Accuracy: %.1f%%" % (100.0 * classifier.score(transformed, labels)))

# Other evaluating approach
# results = classifier.predict(transformed)
# evaluator = Rumale::EvaluationMeasure::Accuracy.new
# puts("Accuracy: %.1f%%" % (100.0 * evaluator.score(results, labels)))

Execution of the above scripts result in the following.

$ ruby train.rb
$ ruby test.rb
Accuracy: 98.5%

Example 2. Cross-validation

require 'rumale'

# Load dataset.
samples, labels = Rumale::Dataset.load_libsvm_file('pendigits')

# Define the estimator to be evaluated.
lr = Rumale::LinearModel::LogisticRegression.new

# Define the evaluation measure, splitting strategy, and cross validation.
ev = Rumale::EvaluationMeasure::Accuracy.new
kf = Rumale::ModelSelection::StratifiedKFold.new(n_splits: 5, shuffle: true, random_seed: 1)
cv = Rumale::ModelSelection::CrossValidation.new(estimator: lr, splitter: kf, evaluator: ev)

# Perform 5-cross validation.
report = cv.perform(samples, labels)

# Output result.
mean_accuracy = report[:test_score].sum / kf.n_splits
puts "5-CV mean accuracy: %.1f%%" % (100.0 * mean_accuracy)

Execution of the above scripts result in the following.

$ ruby cross_validation.rb
5-CV mean accuracy: 95.5%

Speedup

Numo::Linalg Alternative

Rumale uses Numo::NArray Alternative for typed arrays. Loading the Numo::Linalg Alterntaive allows to perform matrix and vector product of Numo::NArray Alternative using OpenBLAS libraries. Some machine learning algorithms frequently compute matrix and vector products, the execution speed of such algorithms can be expected to be accelerated.

Install Numo::Linalg Alternative gem.

$ gem install numo-linalg-alt

In ruby script, just load Numo::Linalg along with Rumale.

require 'numo/linalg'
require 'rumale'

Parallel

Several estimators in Rumale support parallel processing. Parallel processing in Rumale is realized by Parallel gem, so install and load it.

$ gem install parallel
require 'parallel'
require 'rumale'

Estimators that support parallel processing have n_jobs parameter. When -1 is given to n_jobs parameter, all processors are used.

estimator = Rumale::Ensemble::RandomForestClassifier.new(n_jobs: -1, random_seed: 1)

Related Projects

  • Rumale::SVM provides support vector machine algorithms in LIBSVM and LIBLINEAR with Rumale interface.
  • Rumale::Torch provides the learning and inference by the neural network defined in torch.rb with Rumale interface.

License

The gem is available as open source under the terms of the BSD-3-Clause License.

排名相邻
同类项目