rumale 0.23.3 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +5 -1
- data/README.md +3 -288
- data/lib/rumale/version.rb +1 -1
- data/lib/rumale.rb +20 -131
- metadata +252 -150
- data/CHANGELOG.md +0 -643
- data/CODE_OF_CONDUCT.md +0 -74
- data/ext/rumale/extconf.rb +0 -37
- data/ext/rumale/rumaleext.c +0 -545
- data/ext/rumale/rumaleext.h +0 -12
- data/lib/rumale/base/base_estimator.rb +0 -49
- data/lib/rumale/base/classifier.rb +0 -36
- data/lib/rumale/base/cluster_analyzer.rb +0 -31
- data/lib/rumale/base/evaluator.rb +0 -17
- data/lib/rumale/base/regressor.rb +0 -36
- data/lib/rumale/base/splitter.rb +0 -21
- data/lib/rumale/base/transformer.rb +0 -22
- data/lib/rumale/clustering/dbscan.rb +0 -123
- data/lib/rumale/clustering/gaussian_mixture.rb +0 -218
- data/lib/rumale/clustering/hdbscan.rb +0 -291
- data/lib/rumale/clustering/k_means.rb +0 -122
- data/lib/rumale/clustering/k_medoids.rb +0 -141
- data/lib/rumale/clustering/mini_batch_k_means.rb +0 -139
- data/lib/rumale/clustering/power_iteration.rb +0 -127
- data/lib/rumale/clustering/single_linkage.rb +0 -203
- data/lib/rumale/clustering/snn.rb +0 -76
- data/lib/rumale/clustering/spectral_clustering.rb +0 -115
- data/lib/rumale/dataset.rb +0 -246
- data/lib/rumale/decomposition/factor_analysis.rb +0 -150
- data/lib/rumale/decomposition/fast_ica.rb +0 -188
- data/lib/rumale/decomposition/nmf.rb +0 -124
- data/lib/rumale/decomposition/pca.rb +0 -159
- data/lib/rumale/ensemble/ada_boost_classifier.rb +0 -179
- data/lib/rumale/ensemble/ada_boost_regressor.rb +0 -160
- data/lib/rumale/ensemble/extra_trees_classifier.rb +0 -139
- data/lib/rumale/ensemble/extra_trees_regressor.rb +0 -125
- data/lib/rumale/ensemble/gradient_boosting_classifier.rb +0 -306
- data/lib/rumale/ensemble/gradient_boosting_regressor.rb +0 -237
- data/lib/rumale/ensemble/random_forest_classifier.rb +0 -189
- data/lib/rumale/ensemble/random_forest_regressor.rb +0 -153
- data/lib/rumale/ensemble/stacking_classifier.rb +0 -215
- data/lib/rumale/ensemble/stacking_regressor.rb +0 -163
- data/lib/rumale/ensemble/voting_classifier.rb +0 -126
- data/lib/rumale/ensemble/voting_regressor.rb +0 -82
- data/lib/rumale/evaluation_measure/accuracy.rb +0 -29
- data/lib/rumale/evaluation_measure/adjusted_rand_score.rb +0 -74
- data/lib/rumale/evaluation_measure/calinski_harabasz_score.rb +0 -56
- data/lib/rumale/evaluation_measure/davies_bouldin_score.rb +0 -53
- data/lib/rumale/evaluation_measure/explained_variance_score.rb +0 -39
- data/lib/rumale/evaluation_measure/f_score.rb +0 -50
- data/lib/rumale/evaluation_measure/function.rb +0 -147
- data/lib/rumale/evaluation_measure/log_loss.rb +0 -45
- data/lib/rumale/evaluation_measure/mean_absolute_error.rb +0 -29
- data/lib/rumale/evaluation_measure/mean_squared_error.rb +0 -29
- data/lib/rumale/evaluation_measure/mean_squared_log_error.rb +0 -29
- data/lib/rumale/evaluation_measure/median_absolute_error.rb +0 -30
- data/lib/rumale/evaluation_measure/mutual_information.rb +0 -49
- data/lib/rumale/evaluation_measure/normalized_mutual_information.rb +0 -53
- data/lib/rumale/evaluation_measure/precision.rb +0 -50
- data/lib/rumale/evaluation_measure/precision_recall.rb +0 -96
- data/lib/rumale/evaluation_measure/purity.rb +0 -40
- data/lib/rumale/evaluation_measure/r2_score.rb +0 -43
- data/lib/rumale/evaluation_measure/recall.rb +0 -50
- data/lib/rumale/evaluation_measure/roc_auc.rb +0 -130
- data/lib/rumale/evaluation_measure/silhouette_score.rb +0 -82
- data/lib/rumale/feature_extraction/feature_hasher.rb +0 -110
- data/lib/rumale/feature_extraction/hash_vectorizer.rb +0 -155
- data/lib/rumale/feature_extraction/tfidf_transformer.rb +0 -113
- data/lib/rumale/kernel_approximation/nystroem.rb +0 -126
- data/lib/rumale/kernel_approximation/rbf.rb +0 -102
- data/lib/rumale/kernel_machine/kernel_fda.rb +0 -120
- data/lib/rumale/kernel_machine/kernel_pca.rb +0 -97
- data/lib/rumale/kernel_machine/kernel_ridge.rb +0 -82
- data/lib/rumale/kernel_machine/kernel_ridge_classifier.rb +0 -92
- data/lib/rumale/kernel_machine/kernel_svc.rb +0 -193
- data/lib/rumale/linear_model/base_sgd.rb +0 -285
- data/lib/rumale/linear_model/elastic_net.rb +0 -119
- data/lib/rumale/linear_model/lasso.rb +0 -115
- data/lib/rumale/linear_model/linear_regression.rb +0 -201
- data/lib/rumale/linear_model/logistic_regression.rb +0 -275
- data/lib/rumale/linear_model/nnls.rb +0 -137
- data/lib/rumale/linear_model/ridge.rb +0 -209
- data/lib/rumale/linear_model/svc.rb +0 -213
- data/lib/rumale/linear_model/svr.rb +0 -132
- data/lib/rumale/manifold/mds.rb +0 -155
- data/lib/rumale/manifold/tsne.rb +0 -222
- data/lib/rumale/metric_learning/fisher_discriminant_analysis.rb +0 -113
- data/lib/rumale/metric_learning/mlkr.rb +0 -161
- data/lib/rumale/metric_learning/neighbourhood_component_analysis.rb +0 -167
- data/lib/rumale/model_selection/cross_validation.rb +0 -125
- data/lib/rumale/model_selection/function.rb +0 -42
- data/lib/rumale/model_selection/grid_search_cv.rb +0 -225
- data/lib/rumale/model_selection/group_k_fold.rb +0 -93
- data/lib/rumale/model_selection/group_shuffle_split.rb +0 -115
- data/lib/rumale/model_selection/k_fold.rb +0 -81
- data/lib/rumale/model_selection/shuffle_split.rb +0 -90
- data/lib/rumale/model_selection/stratified_k_fold.rb +0 -99
- data/lib/rumale/model_selection/stratified_shuffle_split.rb +0 -118
- data/lib/rumale/model_selection/time_series_split.rb +0 -91
- data/lib/rumale/multiclass/one_vs_rest_classifier.rb +0 -83
- data/lib/rumale/naive_bayes/base_naive_bayes.rb +0 -47
- data/lib/rumale/naive_bayes/bernoulli_nb.rb +0 -82
- data/lib/rumale/naive_bayes/complement_nb.rb +0 -85
- data/lib/rumale/naive_bayes/gaussian_nb.rb +0 -69
- data/lib/rumale/naive_bayes/multinomial_nb.rb +0 -74
- data/lib/rumale/naive_bayes/negation_nb.rb +0 -71
- data/lib/rumale/nearest_neighbors/k_neighbors_classifier.rb +0 -133
- data/lib/rumale/nearest_neighbors/k_neighbors_regressor.rb +0 -108
- data/lib/rumale/nearest_neighbors/vp_tree.rb +0 -132
- data/lib/rumale/neural_network/adam.rb +0 -56
- data/lib/rumale/neural_network/base_mlp.rb +0 -248
- data/lib/rumale/neural_network/mlp_classifier.rb +0 -120
- data/lib/rumale/neural_network/mlp_regressor.rb +0 -90
- data/lib/rumale/pairwise_metric.rb +0 -152
- data/lib/rumale/pipeline/feature_union.rb +0 -69
- data/lib/rumale/pipeline/pipeline.rb +0 -175
- data/lib/rumale/preprocessing/bin_discretizer.rb +0 -93
- data/lib/rumale/preprocessing/binarizer.rb +0 -60
- data/lib/rumale/preprocessing/kernel_calculator.rb +0 -92
- data/lib/rumale/preprocessing/l1_normalizer.rb +0 -62
- data/lib/rumale/preprocessing/l2_normalizer.rb +0 -63
- data/lib/rumale/preprocessing/label_binarizer.rb +0 -89
- data/lib/rumale/preprocessing/label_encoder.rb +0 -79
- data/lib/rumale/preprocessing/max_abs_scaler.rb +0 -61
- data/lib/rumale/preprocessing/max_normalizer.rb +0 -62
- data/lib/rumale/preprocessing/min_max_scaler.rb +0 -76
- data/lib/rumale/preprocessing/one_hot_encoder.rb +0 -100
- data/lib/rumale/preprocessing/ordinal_encoder.rb +0 -109
- data/lib/rumale/preprocessing/polynomial_features.rb +0 -109
- data/lib/rumale/preprocessing/standard_scaler.rb +0 -71
- data/lib/rumale/probabilistic_output.rb +0 -114
- data/lib/rumale/tree/base_decision_tree.rb +0 -150
- data/lib/rumale/tree/decision_tree_classifier.rb +0 -150
- data/lib/rumale/tree/decision_tree_regressor.rb +0 -116
- data/lib/rumale/tree/extra_tree_classifier.rb +0 -107
- data/lib/rumale/tree/extra_tree_regressor.rb +0 -94
- data/lib/rumale/tree/gradient_tree_regressor.rb +0 -202
- data/lib/rumale/tree/node.rb +0 -39
- data/lib/rumale/utils.rb +0 -42
- data/lib/rumale/validation.rb +0 -128
- data/lib/rumale/values.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94217b519d1715e9845565f2dbc03bf9379794936192583bfdbfbc049dd163ce
|
4
|
+
data.tar.gz: 156b5c891c2c52a31208aae5726ccdf3902b93fc3dd332dc416297375c1e0605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fde44d93f43001b6155d6722dc09b2683b2c7e145d11d9f99e49509f374bba4c9d825c2dc1f46b5b3f7ae8df8795a8eb0f6548c822241313d17c72b05d5608fc
|
7
|
+
data.tar.gz: ad6108febf2d62454af1af592c5396ca2bf292b48e8004a583e47b63f63503608436344d3213216e879298de84aef63c74f101e2792d92ae85387c1ce96d0102
|
data/LICENSE.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2022 Atsushi Tatsuma
|
2
2
|
All rights reserved.
|
3
3
|
|
4
4
|
Redistribution and use in source and binary forms, with or without
|
@@ -11,6 +11,10 @@ modification, are permitted provided that the following conditions are met:
|
|
11
11
|
this list of conditions and the following disclaimer in the documentation
|
12
12
|
and/or other materials provided with the distribution.
|
13
13
|
|
14
|
+
* Neither the name of the copyright holder nor the names of its
|
15
|
+
contributors may be used to endorse or promote products derived from
|
16
|
+
this software without specific prior written permission.
|
17
|
+
|
14
18
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
15
19
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
16
20
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
data/README.md
CHANGED
@@ -1,25 +1,10 @@
|
|
1
1
|
# Rumale
|
2
2
|
|
3
|
-
**This project is suspended for the author's health reasons. It will be resumed when the author recovers.**
|
4
|
-
|
5
|
-
![Rumale](https://dl.dropboxusercontent.com/s/joxruk2720ur66o/rumale_header_400.png)
|
6
|
-
|
7
|
-
[![Build Status](https://github.com/yoshoku/rumale/actions/workflows/build.yml/badge.svg)](https://github.com/yoshoku/rumale/actions/workflows/build.yml)
|
8
3
|
[![Gem Version](https://badge.fury.io/rb/rumale.svg)](https://badge.fury.io/rb/rumale)
|
9
|
-
[![BSD
|
4
|
+
[![BSD 3-Clause License](https://img.shields.io/badge/License-BSD%203--Clause-orange.svg)](https://github.com/yoshoku/rumale/blob/main/LICENSE.txt)
|
10
5
|
[![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://yoshoku.github.io/rumale/doc/)
|
11
6
|
|
12
7
|
Rumale (**Ru**by **ma**chine **le**arning) is a machine learning library in Ruby.
|
13
|
-
Rumale provides machine learning algorithms with interfaces similar to Scikit-Learn in Python.
|
14
|
-
Rumale supports Support Vector Machine,
|
15
|
-
Logistic Regression, Ridge, Lasso,
|
16
|
-
Multi-layer Perceptron,
|
17
|
-
Naive Bayes, Decision Tree, Gradient Tree Boosting, Random Forest,
|
18
|
-
K-Means, Gaussian Mixture Model, DBSCAN, Spectral Clustering,
|
19
|
-
Mutidimensional Scaling, t-SNE,
|
20
|
-
Fisher Discriminant Analysis, Neighbourhood Component Analysis,
|
21
|
-
Principal Component Analysis, Non-negative Matrix Factorization,
|
22
|
-
and many other algorithms.
|
23
8
|
|
24
9
|
## Installation
|
25
10
|
|
@@ -31,7 +16,7 @@ gem 'rumale'
|
|
31
16
|
|
32
17
|
And then execute:
|
33
18
|
|
34
|
-
$ bundle
|
19
|
+
$ bundle install
|
35
20
|
|
36
21
|
Or install it yourself as:
|
37
22
|
|
@@ -41,276 +26,6 @@ Or install it yourself as:
|
|
41
26
|
|
42
27
|
- [Rumale API Documentation](https://yoshoku.github.io/rumale/doc/)
|
43
28
|
|
44
|
-
## Usage
|
45
|
-
|
46
|
-
### Example 1. Pendigits dataset classification
|
47
|
-
|
48
|
-
Rumale provides function loading libsvm format dataset file.
|
49
|
-
We start by downloading the pendigits dataset from LIBSVM Data web site.
|
50
|
-
|
51
|
-
```bash
|
52
|
-
$ wget https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/pendigits
|
53
|
-
$ wget https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/pendigits.t
|
54
|
-
```
|
55
|
-
|
56
|
-
Training of the classifier with Linear SVM and RBF kernel feature map is the following code.
|
57
|
-
|
58
|
-
```ruby
|
59
|
-
require 'rumale'
|
60
|
-
|
61
|
-
# Load the training dataset.
|
62
|
-
samples, labels = Rumale::Dataset.load_libsvm_file('pendigits')
|
63
|
-
|
64
|
-
# Map training data to RBF kernel feature space.
|
65
|
-
transformer = Rumale::KernelApproximation::RBF.new(gamma: 0.0001, n_components: 1024, random_seed: 1)
|
66
|
-
transformed = transformer.fit_transform(samples)
|
67
|
-
|
68
|
-
# Train linear SVM classifier.
|
69
|
-
classifier = Rumale::LinearModel::SVC.new(reg_param: 0.0001, random_seed: 1)
|
70
|
-
classifier.fit(transformed, labels)
|
71
|
-
|
72
|
-
# Save the model.
|
73
|
-
File.open('transformer.dat', 'wb') { |f| f.write(Marshal.dump(transformer)) }
|
74
|
-
File.open('classifier.dat', 'wb') { |f| f.write(Marshal.dump(classifier)) }
|
75
|
-
```
|
76
|
-
|
77
|
-
Classifying testing data with the trained classifier is the following code.
|
78
|
-
|
79
|
-
```ruby
|
80
|
-
require 'rumale'
|
81
|
-
|
82
|
-
# Load the testing dataset.
|
83
|
-
samples, labels = Rumale::Dataset.load_libsvm_file('pendigits.t')
|
84
|
-
|
85
|
-
# Load the model.
|
86
|
-
transformer = Marshal.load(File.binread('transformer.dat'))
|
87
|
-
classifier = Marshal.load(File.binread('classifier.dat'))
|
88
|
-
|
89
|
-
# Map testing data to RBF kernel feature space.
|
90
|
-
transformed = transformer.transform(samples)
|
91
|
-
|
92
|
-
# Classify the testing data and evaluate prediction results.
|
93
|
-
puts("Accuracy: %.1f%%" % (100.0 * classifier.score(transformed, labels)))
|
94
|
-
|
95
|
-
# Other evaluating approach
|
96
|
-
# results = classifier.predict(transformed)
|
97
|
-
# evaluator = Rumale::EvaluationMeasure::Accuracy.new
|
98
|
-
# puts("Accuracy: %.1f%%" % (100.0 * evaluator.score(results, labels)))
|
99
|
-
```
|
100
|
-
|
101
|
-
Execution of the above scripts result in the following.
|
102
|
-
|
103
|
-
```bash
|
104
|
-
$ ruby train.rb
|
105
|
-
$ ruby test.rb
|
106
|
-
Accuracy: 98.7%
|
107
|
-
```
|
108
|
-
|
109
|
-
### Example 2. Cross-validation
|
110
|
-
|
111
|
-
```ruby
|
112
|
-
require 'rumale'
|
113
|
-
|
114
|
-
# Load dataset.
|
115
|
-
samples, labels = Rumale::Dataset.load_libsvm_file('pendigits')
|
116
|
-
|
117
|
-
# Define the estimator to be evaluated.
|
118
|
-
lr = Rumale::LinearModel::LogisticRegression.new
|
119
|
-
|
120
|
-
# Define the evaluation measure, splitting strategy, and cross validation.
|
121
|
-
ev = Rumale::EvaluationMeasure::Accuracy.new
|
122
|
-
kf = Rumale::ModelSelection::StratifiedKFold.new(n_splits: 5, shuffle: true, random_seed: 1)
|
123
|
-
cv = Rumale::ModelSelection::CrossValidation.new(estimator: lr, splitter: kf, evaluator: ev)
|
124
|
-
|
125
|
-
# Perform 5-cross validation.
|
126
|
-
report = cv.perform(samples, labels)
|
127
|
-
|
128
|
-
# Output result.
|
129
|
-
mean_accuracy = report[:test_score].sum / kf.n_splits
|
130
|
-
puts "5-CV mean accuracy: %.1f%%" % (100.0 * mean_accuracy)
|
131
|
-
```
|
132
|
-
|
133
|
-
Execution of the above scripts result in the following.
|
134
|
-
|
135
|
-
```bash
|
136
|
-
$ ruby cross_validation.rb
|
137
|
-
5-CV mean accuracy: 95.4%
|
138
|
-
```
|
139
|
-
|
140
|
-
### Example 3. Pipeline
|
141
|
-
|
142
|
-
```ruby
|
143
|
-
require 'rumale'
|
144
|
-
|
145
|
-
# Load dataset.
|
146
|
-
samples, labels = Rumale::Dataset.load_libsvm_file('pendigits')
|
147
|
-
|
148
|
-
# Construct pipeline with kernel approximation and LogisticRegression.
|
149
|
-
rbf = Rumale::KernelApproximation::RBF.new(gamma: 1e-4, n_components: 800, random_seed: 1)
|
150
|
-
lr = Rumale::LinearModel::LogisticRegression.new(reg_param: 1e-3)
|
151
|
-
pipeline = Rumale::Pipeline::Pipeline.new(steps: { trns: rbf, clsf: lr })
|
152
|
-
|
153
|
-
# Define the splitting strategy and cross validation.
|
154
|
-
kf = Rumale::ModelSelection::StratifiedKFold.new(n_splits: 5, shuffle: true, random_seed: 1)
|
155
|
-
cv = Rumale::ModelSelection::CrossValidation.new(estimator: pipeline, splitter: kf)
|
156
|
-
|
157
|
-
# Perform 5-cross validation.
|
158
|
-
report = cv.perform(samples, labels)
|
159
|
-
|
160
|
-
# Output result.
|
161
|
-
mean_accuracy = report[:test_score].sum / kf.n_splits
|
162
|
-
puts("5-CV mean accuracy: %.1f %%" % (mean_accuracy * 100.0))
|
163
|
-
```
|
164
|
-
|
165
|
-
Execution of the above scripts result in the following.
|
166
|
-
|
167
|
-
```bash
|
168
|
-
$ ruby pipeline.rb
|
169
|
-
5-CV mean accuracy: 99.6 %
|
170
|
-
```
|
171
|
-
|
172
|
-
## Speed up
|
173
|
-
|
174
|
-
### Numo::Linalg
|
175
|
-
Rumale uses [Numo::NArray](https://github.com/ruby-numo/numo-narray) for typed arrays.
|
176
|
-
Loading the [Numo::Linalg](https://github.com/ruby-numo/numo-linalg) allows to perform matrix product of Numo::NArray using BLAS libraries.
|
177
|
-
For example, using the [OpenBLAS](https://github.com/xianyi/OpenBLAS) speeds up many estimators in Rumale.
|
178
|
-
|
179
|
-
Install OpenBLAS library.
|
180
|
-
|
181
|
-
macOS:
|
182
|
-
|
183
|
-
```bash
|
184
|
-
$ brew install openblas
|
185
|
-
```
|
186
|
-
|
187
|
-
Ubuntu:
|
188
|
-
|
189
|
-
```bash
|
190
|
-
$ sudo apt-get install libopenblas-dev liblapacke-dev
|
191
|
-
```
|
192
|
-
|
193
|
-
Fedora:
|
194
|
-
|
195
|
-
```bash
|
196
|
-
$ sudo dnf install openblas-devel lapack-devel
|
197
|
-
```
|
198
|
-
|
199
|
-
Windows (MSYS2):
|
200
|
-
|
201
|
-
```bash
|
202
|
-
$ pacman -S mingw-w64-x86_64-ruby mingw-w64-x86_64-openblas mingw-w64-x86_64-lapack
|
203
|
-
```
|
204
|
-
|
205
|
-
Install Numo::Linalg gem.
|
206
|
-
|
207
|
-
```bash
|
208
|
-
$ gem install numo-linalg
|
209
|
-
```
|
210
|
-
|
211
|
-
In ruby script, you only need to require the autoloader module of Numo::Linalg.
|
212
|
-
|
213
|
-
```ruby
|
214
|
-
require 'numo/linalg/autoloader'
|
215
|
-
require 'rumale'
|
216
|
-
```
|
217
|
-
|
218
|
-
### Numo::OpenBLAS
|
219
|
-
[Numo::OpenBLAS](https://github.com/yoshoku/numo-openblas) downloads and builds OpenBLAS during installation
|
220
|
-
and uses that as a background library for Numo::Linalg.
|
221
|
-
|
222
|
-
Install compilers for building OpenBLAS.
|
223
|
-
|
224
|
-
macOS:
|
225
|
-
|
226
|
-
```bash
|
227
|
-
$ brew install gcc gfortran make
|
228
|
-
```
|
229
|
-
|
230
|
-
Ubuntu:
|
231
|
-
|
232
|
-
```bash
|
233
|
-
$ sudo apt-get install gcc gfortran make
|
234
|
-
```
|
235
|
-
|
236
|
-
Fedora:
|
237
|
-
|
238
|
-
```bash
|
239
|
-
$ sudo dnf install gcc gcc-gfortran make
|
240
|
-
```
|
241
|
-
|
242
|
-
Install Numo::OpenBLAS gem.
|
243
|
-
|
244
|
-
```bash
|
245
|
-
$ gem install numo-openblas
|
246
|
-
```
|
247
|
-
|
248
|
-
Load Numo::OpenBLAS gem instead of Numo::Linalg.
|
249
|
-
|
250
|
-
```ruby
|
251
|
-
require 'numo/openblas'
|
252
|
-
require 'rumale'
|
253
|
-
```
|
254
|
-
|
255
|
-
### Numo::BLIS
|
256
|
-
[Numo::BLIS](https://github.com/yoshoku/numo-blis) downloads and builds BLIS during installation
|
257
|
-
and uses that as a background library for Numo::Linalg.
|
258
|
-
BLIS is one of the high-performance BLAS as with OpenBLAS,
|
259
|
-
and using that can be expected to speed up of processing in Rumale.
|
260
|
-
|
261
|
-
Install Numo::BLIS gem.
|
262
|
-
|
263
|
-
```bash
|
264
|
-
$ gem install numo-blis
|
265
|
-
```
|
266
|
-
|
267
|
-
Load Numo::BLIS gem instead of Numo::Linalg.
|
268
|
-
|
269
|
-
```ruby
|
270
|
-
require 'numo/blis'
|
271
|
-
require 'rumale'
|
272
|
-
```
|
273
|
-
|
274
|
-
### Parallel
|
275
|
-
Several estimators in Rumale support parallel processing.
|
276
|
-
Parallel processing in Rumale is realized by [Parallel](https://github.com/grosser/parallel) gem,
|
277
|
-
so install and load it.
|
278
|
-
|
279
|
-
```bash
|
280
|
-
$ gem install parallel
|
281
|
-
```
|
282
|
-
|
283
|
-
```ruby
|
284
|
-
require 'parallel'
|
285
|
-
require 'rumale'
|
286
|
-
```
|
287
|
-
|
288
|
-
Estimators that support parallel processing have n_jobs parameter.
|
289
|
-
When -1 is given to n_jobs parameter, all processors are used.
|
290
|
-
|
291
|
-
```ruby
|
292
|
-
estimator = Rumale::Ensemble::RandomForestClassifier.new(n_jobs: -1, random_seed: 1)
|
293
|
-
```
|
294
|
-
|
295
|
-
## Related Projects
|
296
|
-
- [Rumale::SVM](https://github.com/yoshoku/rumale-svm) provides support vector machine algorithms in LIBSVM and LIBLINEAR with Rumale interface.
|
297
|
-
- [Rumale::Torch](https://github.com/yoshoku/rumale-torch) provides the learning and inference by the neural network defined in torch.rb with Rumale interface.
|
298
|
-
|
299
|
-
## Novelties
|
300
|
-
|
301
|
-
* [Rumale SHOP](https://suzuri.jp/yoshoku)
|
302
|
-
|
303
|
-
## Contributing
|
304
|
-
|
305
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/rumale.
|
306
|
-
This project is intended to be a safe, welcoming space for collaboration,
|
307
|
-
and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
308
|
-
|
309
29
|
## License
|
310
30
|
|
311
|
-
The gem is available as open source under the terms of the [BSD
|
312
|
-
|
313
|
-
## Code of Conduct
|
314
|
-
|
315
|
-
Everyone interacting in the Rumale project’s codebases, issue trackers,
|
316
|
-
chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yoshoku/Rumale/blob/main/CODE_OF_CONDUCT.md).
|
31
|
+
The gem is available as open source under the terms of the [BSD-3-Clause License](https://opensource.org/licenses/BSD-3-Clause).
|
data/lib/rumale/version.rb
CHANGED
data/lib/rumale.rb
CHANGED
@@ -2,135 +2,24 @@
|
|
2
2
|
|
3
3
|
require 'numo/narray'
|
4
4
|
|
5
|
+
require 'rumale/core'
|
6
|
+
|
7
|
+
require 'rumale/clustering'
|
8
|
+
require 'rumale/decomposition'
|
9
|
+
require 'rumale/ensemble'
|
10
|
+
require 'rumale/evaluation_measure'
|
11
|
+
require 'rumale/feature_extraction'
|
12
|
+
require 'rumale/kernel_approximation'
|
13
|
+
require 'rumale/kernel_machine'
|
14
|
+
require 'rumale/linear_model'
|
15
|
+
require 'rumale/manifold'
|
16
|
+
require 'rumale/metric_learning'
|
17
|
+
require 'rumale/model_selection'
|
18
|
+
require 'rumale/naive_bayes'
|
19
|
+
require 'rumale/nearest_neighbors'
|
20
|
+
require 'rumale/neural_network'
|
21
|
+
require 'rumale/pipeline'
|
22
|
+
require 'rumale/preprocessing'
|
23
|
+
require 'rumale/tree'
|
24
|
+
|
5
25
|
require_relative 'rumale/version'
|
6
|
-
require_relative 'rumale/rumaleext'
|
7
|
-
require_relative 'rumale/validation'
|
8
|
-
require_relative 'rumale/values'
|
9
|
-
require_relative 'rumale/utils'
|
10
|
-
require_relative 'rumale/pairwise_metric'
|
11
|
-
require_relative 'rumale/dataset'
|
12
|
-
require_relative 'rumale/probabilistic_output'
|
13
|
-
require_relative 'rumale/base/base_estimator'
|
14
|
-
require_relative 'rumale/base/classifier'
|
15
|
-
require_relative 'rumale/base/regressor'
|
16
|
-
require_relative 'rumale/base/cluster_analyzer'
|
17
|
-
require_relative 'rumale/base/transformer'
|
18
|
-
require_relative 'rumale/base/splitter'
|
19
|
-
require_relative 'rumale/base/evaluator'
|
20
|
-
require_relative 'rumale/pipeline/pipeline'
|
21
|
-
require_relative 'rumale/pipeline/feature_union'
|
22
|
-
require_relative 'rumale/kernel_approximation/rbf'
|
23
|
-
require_relative 'rumale/kernel_approximation/nystroem'
|
24
|
-
require_relative 'rumale/linear_model/base_sgd'
|
25
|
-
require_relative 'rumale/linear_model/svc'
|
26
|
-
require_relative 'rumale/linear_model/svr'
|
27
|
-
require_relative 'rumale/linear_model/logistic_regression'
|
28
|
-
require_relative 'rumale/linear_model/linear_regression'
|
29
|
-
require_relative 'rumale/linear_model/ridge'
|
30
|
-
require_relative 'rumale/linear_model/lasso'
|
31
|
-
require_relative 'rumale/linear_model/elastic_net'
|
32
|
-
require_relative 'rumale/linear_model/nnls'
|
33
|
-
require_relative 'rumale/kernel_machine/kernel_svc'
|
34
|
-
require_relative 'rumale/kernel_machine/kernel_pca'
|
35
|
-
require_relative 'rumale/kernel_machine/kernel_fda'
|
36
|
-
require_relative 'rumale/kernel_machine/kernel_ridge'
|
37
|
-
require_relative 'rumale/kernel_machine/kernel_ridge_classifier'
|
38
|
-
require_relative 'rumale/multiclass/one_vs_rest_classifier'
|
39
|
-
require_relative 'rumale/nearest_neighbors/vp_tree'
|
40
|
-
require_relative 'rumale/nearest_neighbors/k_neighbors_classifier'
|
41
|
-
require_relative 'rumale/nearest_neighbors/k_neighbors_regressor'
|
42
|
-
require_relative 'rumale/naive_bayes/base_naive_bayes'
|
43
|
-
require_relative 'rumale/naive_bayes/bernoulli_nb'
|
44
|
-
require_relative 'rumale/naive_bayes/complement_nb'
|
45
|
-
require_relative 'rumale/naive_bayes/gaussian_nb'
|
46
|
-
require_relative 'rumale/naive_bayes/multinomial_nb'
|
47
|
-
require_relative 'rumale/naive_bayes/negation_nb'
|
48
|
-
require_relative 'rumale/tree/node'
|
49
|
-
require_relative 'rumale/tree/base_decision_tree'
|
50
|
-
require_relative 'rumale/tree/decision_tree_classifier'
|
51
|
-
require_relative 'rumale/tree/decision_tree_regressor'
|
52
|
-
require_relative 'rumale/tree/extra_tree_classifier'
|
53
|
-
require_relative 'rumale/tree/extra_tree_regressor'
|
54
|
-
require_relative 'rumale/tree/gradient_tree_regressor'
|
55
|
-
require_relative 'rumale/ensemble/ada_boost_classifier'
|
56
|
-
require_relative 'rumale/ensemble/ada_boost_regressor'
|
57
|
-
require_relative 'rumale/ensemble/gradient_boosting_classifier'
|
58
|
-
require_relative 'rumale/ensemble/gradient_boosting_regressor'
|
59
|
-
require_relative 'rumale/ensemble/random_forest_classifier'
|
60
|
-
require_relative 'rumale/ensemble/random_forest_regressor'
|
61
|
-
require_relative 'rumale/ensemble/extra_trees_classifier'
|
62
|
-
require_relative 'rumale/ensemble/extra_trees_regressor'
|
63
|
-
require_relative 'rumale/ensemble/stacking_classifier'
|
64
|
-
require_relative 'rumale/ensemble/stacking_regressor'
|
65
|
-
require_relative 'rumale/ensemble/voting_classifier'
|
66
|
-
require_relative 'rumale/ensemble/voting_regressor'
|
67
|
-
require_relative 'rumale/clustering/k_means'
|
68
|
-
require_relative 'rumale/clustering/mini_batch_k_means'
|
69
|
-
require_relative 'rumale/clustering/k_medoids'
|
70
|
-
require_relative 'rumale/clustering/gaussian_mixture'
|
71
|
-
require_relative 'rumale/clustering/dbscan'
|
72
|
-
require_relative 'rumale/clustering/hdbscan'
|
73
|
-
require_relative 'rumale/clustering/snn'
|
74
|
-
require_relative 'rumale/clustering/power_iteration'
|
75
|
-
require_relative 'rumale/clustering/spectral_clustering'
|
76
|
-
require_relative 'rumale/clustering/single_linkage'
|
77
|
-
require_relative 'rumale/decomposition/pca'
|
78
|
-
require_relative 'rumale/decomposition/nmf'
|
79
|
-
require_relative 'rumale/decomposition/factor_analysis'
|
80
|
-
require_relative 'rumale/decomposition/fast_ica'
|
81
|
-
require_relative 'rumale/manifold/tsne'
|
82
|
-
require_relative 'rumale/manifold/mds'
|
83
|
-
require_relative 'rumale/metric_learning/fisher_discriminant_analysis'
|
84
|
-
require_relative 'rumale/metric_learning/neighbourhood_component_analysis'
|
85
|
-
require_relative 'rumale/metric_learning/mlkr'
|
86
|
-
require_relative 'rumale/neural_network/adam'
|
87
|
-
require_relative 'rumale/neural_network/base_mlp'
|
88
|
-
require_relative 'rumale/neural_network/mlp_regressor'
|
89
|
-
require_relative 'rumale/neural_network/mlp_classifier'
|
90
|
-
require_relative 'rumale/feature_extraction/hash_vectorizer'
|
91
|
-
require_relative 'rumale/feature_extraction/feature_hasher'
|
92
|
-
require_relative 'rumale/feature_extraction/tfidf_transformer'
|
93
|
-
require_relative 'rumale/preprocessing/l2_normalizer'
|
94
|
-
require_relative 'rumale/preprocessing/l1_normalizer'
|
95
|
-
require_relative 'rumale/preprocessing/max_normalizer'
|
96
|
-
require_relative 'rumale/preprocessing/min_max_scaler'
|
97
|
-
require_relative 'rumale/preprocessing/max_abs_scaler'
|
98
|
-
require_relative 'rumale/preprocessing/standard_scaler'
|
99
|
-
require_relative 'rumale/preprocessing/bin_discretizer'
|
100
|
-
require_relative 'rumale/preprocessing/label_binarizer'
|
101
|
-
require_relative 'rumale/preprocessing/label_encoder'
|
102
|
-
require_relative 'rumale/preprocessing/one_hot_encoder'
|
103
|
-
require_relative 'rumale/preprocessing/ordinal_encoder'
|
104
|
-
require_relative 'rumale/preprocessing/binarizer'
|
105
|
-
require_relative 'rumale/preprocessing/polynomial_features'
|
106
|
-
require_relative 'rumale/preprocessing/kernel_calculator'
|
107
|
-
require_relative 'rumale/model_selection/k_fold'
|
108
|
-
require_relative 'rumale/model_selection/group_k_fold'
|
109
|
-
require_relative 'rumale/model_selection/stratified_k_fold'
|
110
|
-
require_relative 'rumale/model_selection/shuffle_split'
|
111
|
-
require_relative 'rumale/model_selection/group_shuffle_split'
|
112
|
-
require_relative 'rumale/model_selection/stratified_shuffle_split'
|
113
|
-
require_relative 'rumale/model_selection/time_series_split'
|
114
|
-
require_relative 'rumale/model_selection/cross_validation'
|
115
|
-
require_relative 'rumale/model_selection/grid_search_cv'
|
116
|
-
require_relative 'rumale/model_selection/function'
|
117
|
-
require_relative 'rumale/evaluation_measure/accuracy'
|
118
|
-
require_relative 'rumale/evaluation_measure/precision'
|
119
|
-
require_relative 'rumale/evaluation_measure/recall'
|
120
|
-
require_relative 'rumale/evaluation_measure/f_score'
|
121
|
-
require_relative 'rumale/evaluation_measure/roc_auc'
|
122
|
-
require_relative 'rumale/evaluation_measure/log_loss'
|
123
|
-
require_relative 'rumale/evaluation_measure/r2_score'
|
124
|
-
require_relative 'rumale/evaluation_measure/explained_variance_score'
|
125
|
-
require_relative 'rumale/evaluation_measure/mean_squared_error'
|
126
|
-
require_relative 'rumale/evaluation_measure/mean_squared_log_error'
|
127
|
-
require_relative 'rumale/evaluation_measure/mean_absolute_error'
|
128
|
-
require_relative 'rumale/evaluation_measure/median_absolute_error'
|
129
|
-
require_relative 'rumale/evaluation_measure/adjusted_rand_score'
|
130
|
-
require_relative 'rumale/evaluation_measure/purity'
|
131
|
-
require_relative 'rumale/evaluation_measure/mutual_information'
|
132
|
-
require_relative 'rumale/evaluation_measure/normalized_mutual_information'
|
133
|
-
require_relative 'rumale/evaluation_measure/silhouette_score'
|
134
|
-
require_relative 'rumale/evaluation_measure/davies_bouldin_score'
|
135
|
-
require_relative 'rumale/evaluation_measure/calinski_harabasz_score'
|
136
|
-
require_relative 'rumale/evaluation_measure/function'
|