libsvmloader 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.coveralls.yml +1 -0
- data/.github/workflows/build.yml +22 -0
- data/.github/workflows/coverage.yml +26 -0
- data/.gitignore +9 -0
- data/.rubocop.yml +20 -0
- data/CHANGELOG.md +27 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +1 -1
- data/README.md +31 -4
- data/Steepfile +20 -0
- data/lib/libsvmloader.rb +78 -57
- data/lib/libsvmloader/version.rb +3 -9
- data/libsvmloader.gemspec +17 -16
- data/sig/libsvmloader.rbs +18 -0
- metadata +15 -68
- data/.travis.yml +0 -5
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/exe/libsvmloader +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3c9126689f92d7501d691bdf6bbebf04ada08073d76839bf4599d70224f693e9
|
4
|
+
data.tar.gz: e4b83b0e4afc8c3760bd54b79349d8e5920a2cf7503194ee5a223bfec2517fd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bb9d9de0b39b85a2ec0a206b8f8e2dbb7d4ba50ebabd672231432bfb1c895c5db5f0d433df0db03d2b8acad4429484c8ae07951a0ffde92d3a87a8144f92b35
|
7
|
+
data.tar.gz: f1b8262ac0e2dbfd8e990c0935cf6360e7b3c3e5ab43892899e3a92dcb22b377dc60f09bd98c92126b629d5a3bff6d649a64e2945459627b069425813c8f5396
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: github-ci
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: build
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-20.04
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby: [ '2.6', '2.7', '3.0' ]
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
15
|
+
uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby }}
|
18
|
+
- name: Build and test with Rake
|
19
|
+
run: |
|
20
|
+
gem install --no-document bundler
|
21
|
+
bundle install --jobs 4 --retry 3
|
22
|
+
bundle exec rake
|
@@ -0,0 +1,26 @@
|
|
1
|
+
name: coverage
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ main ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
coverage:
|
11
|
+
runs-on: ubuntu-20.04
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby 2.7
|
15
|
+
uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: '2.7'
|
18
|
+
- name: Build and test with Rake
|
19
|
+
run: |
|
20
|
+
gem install bundler
|
21
|
+
bundle install
|
22
|
+
bundle exec rake
|
23
|
+
- name: Coveralls GitHub Action
|
24
|
+
uses: coverallsapp/github-action@v1.1.2
|
25
|
+
with:
|
26
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
NewCops: enable
|
6
|
+
|
7
|
+
Metrics/LineLength:
|
8
|
+
Max: 120
|
9
|
+
|
10
|
+
Metrics/ModuleLength:
|
11
|
+
Max: 200
|
12
|
+
|
13
|
+
Metrics/ClassLength:
|
14
|
+
Max: 200
|
15
|
+
|
16
|
+
Metrics/MethodLength:
|
17
|
+
Max: 40
|
18
|
+
|
19
|
+
Style/FormatStringToken:
|
20
|
+
Enabled: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# 0.3.0
|
2
|
+
- Add type declaration file: sig/libsvmloader.rbs
|
3
|
+
- Refactor to avoid returning nil on array access.
|
4
|
+
- Fix some configuration files.
|
5
|
+
|
6
|
+
# 0.2.1
|
7
|
+
- Fixed the bug that failed to load if there is a space at the end of the line.
|
8
|
+
|
9
|
+
# 0.2.0
|
10
|
+
## Breaking changes
|
11
|
+
|
12
|
+
LibSVMLoader has been modified to return the samples and labels of dataset as Ruby Array.
|
13
|
+
Thus, LibSVMLoader does not require NMatrix.
|
14
|
+
|
15
|
+
# 0.1.3
|
16
|
+
- Changed the visibility of protected methods to the private.
|
17
|
+
- Fixed the description in the gemspec file.
|
18
|
+
|
19
|
+
# 0.1.2
|
20
|
+
- Changed the way to read a file.
|
21
|
+
|
22
|
+
# 0.1.1
|
23
|
+
- Fixed to fail reading zero vectors.
|
24
|
+
|
25
|
+
# 0.1.0
|
26
|
+
- Added basic class.
|
27
|
+
- Added the methods that read and write a file with libsvm format.
|
data/Gemfile
CHANGED
@@ -4,3 +4,11 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in libsvmloader.gemspec
|
6
6
|
gemspec
|
7
|
+
|
8
|
+
gem 'bundler', '~> 2.0'
|
9
|
+
gem 'rake', '~> 13.0'
|
10
|
+
gem 'rspec', '~> 3.0'
|
11
|
+
gem 'simplecov', '~> 0.19'
|
12
|
+
gem 'simplecov-lcov', '~> 0.8'
|
13
|
+
gem 'rbs', '~> 1.2'
|
14
|
+
gem 'steep', '~> 0.44'
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# LibSVMLoader
|
2
2
|
|
3
|
+
[](https://github.com/yoshoku/LibSVMLoader/actions?query=workflow%3Abuild)
|
4
|
+
[](https://coveralls.io/github/yoshoku/LibSVMLoader?branch=main)
|
5
|
+
[](https://badge.fury.io/rb/libsvmloader)
|
6
|
+
[](https://github.com/yoshoku/LibSVMLoader/blob/main/LICENSE.txt)
|
7
|
+
|
3
8
|
LibSVMLoader loads (and dumps) dataset file with the libsvm file format.
|
4
9
|
|
5
10
|
## Installation
|
@@ -28,15 +33,37 @@ samples, labels = LibSVMLoader.load_libsvm_file('foo.t')
|
|
28
33
|
LibSVMLoader.dump_libsvm_file(samples, labels, 'bar.t')
|
29
34
|
|
30
35
|
# for regression task
|
31
|
-
samples, target_variables = LibSVMLoader.load_libsvm_file('foo.t', label_dtype:
|
36
|
+
samples, target_variables = LibSVMLoader.load_libsvm_file('foo.t', label_dtype: 'float')
|
32
37
|
LibSVMLoader.dump_libsvm_file(samples, target_variables, 'bar.t')
|
33
38
|
```
|
34
39
|
|
35
|
-
|
40
|
+
When using with Numo::NArray:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
require 'libsvmloader'
|
44
|
+
require 'numo/narray'
|
45
|
+
|
46
|
+
samples, labels = LibSVMLoader.load_libsvm_file('foo.t')
|
47
|
+
|
48
|
+
samples_na = Numo::NArray[*samples]
|
49
|
+
labels_na = Numo::NArray[*labels]
|
50
|
+
|
51
|
+
LibSVMLoader.dump_libsvm_file(samples_na.to_a, labels_na.to_a, 'bar.t')
|
52
|
+
```
|
53
|
+
|
54
|
+
When using with NMatrix:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
require 'libsvmloader'
|
58
|
+
require 'nmatrix/nmatrix'
|
59
|
+
|
60
|
+
samples, labels = LibSVMLoader.load_libsvm_file('foo.t')
|
36
61
|
|
37
|
-
|
62
|
+
samples_nm = N[*samples]
|
63
|
+
labels_nm = N[*labels]
|
38
64
|
|
39
|
-
|
65
|
+
LibSVMLoader.dump_libsvm_file(samples_nm.to_a, labels_nm.to_a, 'bar.t')
|
66
|
+
```
|
40
67
|
|
41
68
|
## Contributing
|
42
69
|
|
data/Steepfile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
target :lib do
|
2
|
+
signature "sig"
|
3
|
+
#
|
4
|
+
check "lib" # Directory name
|
5
|
+
# check "Gemfile" # File name
|
6
|
+
# check "app/models/**/*.rb" # Glob
|
7
|
+
# # ignore "lib/templates/*.rb"
|
8
|
+
#
|
9
|
+
# # library "pathname", "set" # Standard libraries
|
10
|
+
# # library "strong_json" # Gems
|
11
|
+
end
|
12
|
+
|
13
|
+
# target :spec do
|
14
|
+
# signature "sig", "sig-private"
|
15
|
+
#
|
16
|
+
# check "spec"
|
17
|
+
#
|
18
|
+
# # library "pathname", "set" # Standard libraries
|
19
|
+
# # library "rspec"
|
20
|
+
# end
|
data/lib/libsvmloader.rb
CHANGED
@@ -1,95 +1,116 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
3
|
require 'libsvmloader/version'
|
3
|
-
require '
|
4
|
+
require 'csv'
|
4
5
|
|
5
6
|
# LibSVMLoader loads (and dumps) dataset file with the libsvm file format.
|
6
7
|
class LibSVMLoader
|
7
8
|
class << self
|
8
|
-
# Load a dataset with the libsvm file format
|
9
|
+
# Load a dataset with the libsvm file format.
|
9
10
|
#
|
10
|
-
# @param filename [String]
|
11
|
+
# @param filename [String] Path to a dataset file.
|
11
12
|
# @param zero_based [Boolean] Whether the column index starts from 0 (true) or 1 (false).
|
12
|
-
# @param
|
13
|
-
# @param
|
14
|
-
# @param value_dtype [Symbol] The data type of the NMatrix consisting of feature vectors.
|
13
|
+
# @param label_dtype [String] Data type of labels or target values ('int', 'float', 'complex').
|
14
|
+
# @param value_dtype [String] Data type of feature vectors ('int', 'float', 'complex').
|
15
15
|
#
|
16
|
-
# @return [Array<
|
16
|
+
# @return [Array<Array>]
|
17
17
|
# Returns array containing the (n_samples x n_features) matrix for feature vectors
|
18
|
-
# and (n_samples
|
19
|
-
def load_libsvm_file(filename, zero_based: false,
|
20
|
-
label_dtype: :int32, value_dtype: :float64)
|
21
|
-
ftvecs = []
|
18
|
+
# and (n_samples) vector for labels or target values.
|
19
|
+
def load_libsvm_file(filename, zero_based: false, label_dtype: 'int', value_dtype: 'float')
|
22
20
|
labels = []
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
ftvecs = []
|
22
|
+
maxids = []
|
23
|
+
label_class = parse_dtype(label_dtype)
|
24
|
+
value_class = parse_dtype(value_dtype)
|
25
|
+
CSV.foreach(filename, col_sep: "\s", headers: false) do |row|
|
26
|
+
label, ftvec, maxid = parse_libsvm_row(row, zero_based, label_class, value_class)
|
27
|
+
labels.push(label)
|
28
|
+
ftvecs.push(ftvec)
|
29
|
+
maxids.push(maxid)
|
31
30
|
end
|
32
|
-
[
|
33
|
-
NMatrix.new([labels.size, 1], labels, dtype: label_dtype)]
|
31
|
+
[convert_to_matrix(ftvecs, maxids.max + 1, value_class), labels]
|
34
32
|
end
|
35
33
|
|
36
34
|
# Dump the dataset with the libsvm file format.
|
37
35
|
#
|
38
|
-
# @param data [
|
39
|
-
# @param labels [
|
40
|
-
# @param filename [String]
|
36
|
+
# @param data [Array] (n_samples x n_features) matrix consisting of feature vectors.
|
37
|
+
# @param labels [Array] (n_samples) vector consisting of labels or target values.
|
38
|
+
# @param filename [String] Path to the output libsvm file.
|
41
39
|
# @param zero_based [Boolean] Whether the column index starts from 0 (true) or 1 (false).
|
42
40
|
def dump_libsvm_file(data, labels, filename, zero_based: false)
|
43
|
-
n_samples =
|
44
|
-
|
45
|
-
|
41
|
+
n_samples = data.size < labels.size ? data.size : labels.size
|
42
|
+
label_format = detect_format(labels[0])
|
43
|
+
value_format = detect_format(data.flatten[0])
|
46
44
|
File.open(filename, 'w') do |file|
|
47
|
-
n_samples.times
|
48
|
-
file.puts(dump_libsvm_line(labels[n], data.row(n),
|
49
|
-
label_type, value_type, zero_based))
|
50
|
-
end
|
45
|
+
n_samples.times { |n| file.puts(dump_libsvm_line(labels[n], data[n], label_format, value_format, zero_based)) }
|
51
46
|
end
|
52
47
|
end
|
53
48
|
|
54
|
-
|
49
|
+
private
|
55
50
|
|
56
|
-
def
|
57
|
-
|
58
|
-
|
59
|
-
|
51
|
+
def parse_libsvm_row(row, zero_based, label_type, value_type)
|
52
|
+
label = convert_type(row.shift, label_type)
|
53
|
+
adj_idx = zero_based == false ? 1 : 0
|
54
|
+
max_idx = -1
|
55
|
+
ftvec = []
|
56
|
+
while (el = row.shift)
|
60
57
|
idx, val = el.split(':')
|
61
|
-
idx = idx.to_i -
|
62
|
-
|
58
|
+
idx = idx.to_i - adj_idx
|
59
|
+
max_idx = idx if max_idx < idx
|
60
|
+
ftvec.push([idx, convert_type(val, value_type)])
|
63
61
|
end
|
64
|
-
max_idx = ftvec.map { |el| el[0] }.max
|
65
|
-
max_idx ||= 0
|
66
62
|
[label, ftvec, max_idx]
|
67
63
|
end
|
68
64
|
|
69
|
-
def
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
65
|
+
def parse_dtype(dtype)
|
66
|
+
case dtype.to_s
|
67
|
+
when /^(int)/i
|
68
|
+
:int
|
69
|
+
when /^(float)/i
|
70
|
+
:float
|
71
|
+
when /^(complex)/i
|
72
|
+
:complex
|
73
|
+
else
|
74
|
+
:string
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def convert_type(value, dtype)
|
79
|
+
case dtype
|
80
|
+
when :int
|
81
|
+
value.to_i
|
82
|
+
when :float
|
83
|
+
value.to_f
|
84
|
+
when :complex
|
85
|
+
value.to_c
|
86
|
+
else
|
87
|
+
value
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def convert_to_matrix(data, n_features, value_type)
|
92
|
+
z = convert_type(0, value_type)
|
93
|
+
data.map do |ft|
|
94
|
+
vec = Array.new(n_features) { z }
|
95
|
+
ft.each { |idx, val| vec[idx] = val }
|
96
|
+
vec
|
77
97
|
end
|
78
|
-
mat
|
79
98
|
end
|
80
99
|
|
81
|
-
def
|
100
|
+
def detect_format(data)
|
82
101
|
type = '%s'
|
83
|
-
type = '%d' if
|
84
|
-
type = '%.10g' if
|
102
|
+
type = '%d' if data.is_a?(Integer)
|
103
|
+
type = '%.10g' if data.is_a?(Float)
|
85
104
|
type
|
86
105
|
end
|
87
106
|
|
88
|
-
def dump_libsvm_line(label, ftvec,
|
89
|
-
line = format(
|
90
|
-
ftvec.
|
91
|
-
|
92
|
-
|
107
|
+
def dump_libsvm_line(label, ftvec, label_format, value_format, zero_based)
|
108
|
+
line = format(label_format, label)
|
109
|
+
ftvec.each_with_index do |val, n|
|
110
|
+
unless val.zero?
|
111
|
+
idx = n + (zero_based == false ? 1 : 0)
|
112
|
+
line += format(" %d:#{value_format}", idx, val)
|
113
|
+
end
|
93
114
|
end
|
94
115
|
line
|
95
116
|
end
|
data/lib/libsvmloader/version.rb
CHANGED
data/libsvmloader.gemspec
CHANGED
@@ -1,27 +1,28 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require 'libsvmloader/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
8
|
-
spec.version = LibSVMLoader::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
7
|
+
spec.name = 'libsvmloader'
|
8
|
+
spec.version = LibSVMLoader::VERSION
|
9
|
+
spec.authors = ['yoshoku']
|
10
|
+
spec.email = ['yoshoku@outlook.com']
|
11
11
|
|
12
|
-
spec.summary =
|
13
|
-
|
14
|
-
|
12
|
+
spec.summary = <<MSG
|
13
|
+
LibSVMLoader loads (and dumps) dataset file with the libsvm file format.
|
14
|
+
MSG
|
15
|
+
spec.description = <<MSG
|
16
|
+
LibSVMLoader is a class that loads (and dumps) dataset file with the libsvm file format.
|
17
|
+
The feature vectors and labels of dataset are represented by Ruby Array.
|
18
|
+
MSG
|
19
|
+
spec.homepage = 'https://github.com/yoshoku/libsvmloader'
|
20
|
+
spec.license = 'MIT'
|
15
21
|
|
16
22
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
23
|
f.match(%r{^(test|spec|features)/})
|
18
24
|
end
|
19
|
-
spec.bindir =
|
25
|
+
spec.bindir = 'exe'
|
20
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
-
spec.require_paths = [
|
22
|
-
|
23
|
-
spec.add_development_dependency "bundler", "~> 1.15"
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
-
spec.add_development_dependency "nmatrix", "~> 0.2.3"
|
27
|
+
spec.require_paths = ['lib']
|
27
28
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# LibSVMLoader loads (and dumps) dataset file with the libsvm file format.
|
2
|
+
class LibSVMLoader
|
3
|
+
VERSION: String
|
4
|
+
|
5
|
+
def self.load_libsvm_file: (String filename, ?zero_based: bool zero_based,
|
6
|
+
?label_dtype: String label_dtype, ?value_dtype: String value_dtype) -> Array[Array[untyped]]
|
7
|
+
def self.dump_libsvm_file: (Array[Array[untyped]] data, Array[Numeric | String] labels, String filename,
|
8
|
+
?zero_based: bool zero_based) -> void
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def self.parse_libsvm_row: (Array[String] row, bool zero_based, Symbol label_type, Symbol value_type) -> Array[untyped]
|
13
|
+
def self.parse_dtype: (String | Symbol dtype) -> Symbol
|
14
|
+
def self.convert_type: (untyped value, Symbol dtype) -> untyped
|
15
|
+
def self.convert_to_matrix: (Array[untyped] data, Integer n_features, Symbol value_type) -> Array[Array[untyped]]
|
16
|
+
def self.detect_format: (untyped data) -> String
|
17
|
+
def self.dump_libsvm_line: (Numeric | String label, Array[untyped] ftvec, String label_format, String value_format, bool zero_based) -> String
|
18
|
+
end
|
metadata
CHANGED
@@ -1,93 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libsvmloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshoku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.15'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.15'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: nmatrix
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.2.3
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.2.3
|
69
|
-
description:
|
11
|
+
date: 2021-06-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: |
|
14
|
+
LibSVMLoader is a class that loads (and dumps) dataset file with the libsvm file format.
|
15
|
+
The feature vectors and labels of dataset are represented by Ruby Array.
|
70
16
|
email:
|
71
17
|
- yoshoku@outlook.com
|
72
|
-
executables:
|
73
|
-
- libsvmloader
|
18
|
+
executables: []
|
74
19
|
extensions: []
|
75
20
|
extra_rdoc_files: []
|
76
21
|
files:
|
22
|
+
- ".coveralls.yml"
|
23
|
+
- ".github/workflows/build.yml"
|
24
|
+
- ".github/workflows/coverage.yml"
|
77
25
|
- ".gitignore"
|
78
26
|
- ".rspec"
|
79
|
-
- ".
|
27
|
+
- ".rubocop.yml"
|
28
|
+
- CHANGELOG.md
|
80
29
|
- CODE_OF_CONDUCT.md
|
81
30
|
- Gemfile
|
82
31
|
- LICENSE.txt
|
83
32
|
- README.md
|
84
33
|
- Rakefile
|
85
|
-
-
|
86
|
-
- bin/setup
|
87
|
-
- exe/libsvmloader
|
34
|
+
- Steepfile
|
88
35
|
- lib/libsvmloader.rb
|
89
36
|
- lib/libsvmloader/version.rb
|
90
37
|
- libsvmloader.gemspec
|
38
|
+
- sig/libsvmloader.rbs
|
91
39
|
homepage: https://github.com/yoshoku/libsvmloader
|
92
40
|
licenses:
|
93
41
|
- MIT
|
@@ -107,8 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
55
|
- !ruby/object:Gem::Version
|
108
56
|
version: '0'
|
109
57
|
requirements: []
|
110
|
-
|
111
|
-
rubygems_version: 2.6.13
|
58
|
+
rubygems_version: 3.1.6
|
112
59
|
signing_key:
|
113
60
|
specification_version: 4
|
114
61
|
summary: LibSVMLoader loads (and dumps) dataset file with the libsvm file format.
|
data/.travis.yml
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "libsvmloader"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/exe/libsvmloader
DELETED