Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Rumale is a machine learning library in Ruby
| Date | Stars |
|---|---|
| 2026-07-31 | 914 |
| 2026-08-03 | 914 |
| 2026-08-06 | 914 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
15.0
growth rate 0.00%/day
# Rumale

[](https://github.com/yoshoku/rumale/actions/workflows/main.yml)
[](https://badge.fury.io/rb/rumale)
[](https://github.com/yoshoku/rumale/blob/main/LICENSE.txt)
[](https://yoshoku.github.io/rumale/doc/)
[](https://doi.org/10.5281/zenodo.14590520)
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.
**Note**: Since v2.0.0, Rumale uses [Numo::NArray Alternative](https://github.com/yoshoku/numo-narray-alt)
instead of Numo::NArray as a dependency.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rumale'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install rumale
## Documentation
- [Rumale API Documentation](https://yoshoku.github.io/rumale/doc/)
## 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.
```bash
$ 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.
```ruby
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.
```ruby
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.
```bash
$ ruby train.rb
$ ruby test.rb
Accuracy: 98.5%
```
### Example 2. Cross-validation
```ruby
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::EvaluatExcerpt of 6,191 characters
Read on GitHub964
15
2
1
1
1
1
1
Benson Muite · Kenya
1
Olle Jonsson · Auctionet ✨
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:37b1bb531dd91cbc, llm:Repository topics include 'machine-learning', 'data-science', 'rubyml' and the description/README state 'Rumale is a machine learning library in Ruby' and list many ML algorithms (SVM, Logistic Regression, Random Forest, PCA, clustering, etc.).
matched fp:37b1bb531dd91cbc, llm:Repository topics include 'machine-learning', 'data-science', 'rubyml' and the description/README state 'Rumale is a machine learning library in Ruby' and list many ML algorithms (SVM, Logistic Regression, Random Forest, PCA, clustering, etc.).