weka 0.7.2-java → 0.7.3-java
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 +4 -4
- data/.rubocop.yml +29 -1
- data/CHANGELOG.md +9 -1
- data/MIT-LICENSE.txt +1 -1
- data/README.md +2 -2
- data/lib/weka/class_builder.rb +2 -0
- data/lib/weka/classifiers/utils.rb +1 -2
- data/lib/weka/clusterers/utils.rb +1 -2
- data/lib/weka/core/dense_instance.rb +7 -5
- data/lib/weka/core/instances.rb +18 -16
- data/lib/weka/version.rb +1 -1
- data/weka.gemspec +3 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2dee943ecd6d4df29a0339de43d88b1d72171dcf84db300270fbc31cf4cedcf
|
4
|
+
data.tar.gz: d6bec02306fbccec16ac31089dfb65d544673c4c6ebec870bb8cfa19cdc9c486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b2f624be137dd9fe055d495f2fd356880d14da95ca8923f823f20f7a8cce4d54c09c6b173a4e7a17173f488a2c99b1cad73c8c86720a3c3eca80487a9413208
|
7
|
+
data.tar.gz: 7d33b187f59f8de850cf23909728a6154c30490cf329cea8b50c26407906f90bd07a232b295217a63567529a17ef1b980fcf6da1125f79b8d0d29aa12c793d87
|
data/.rubocop.yml
CHANGED
@@ -14,7 +14,10 @@ Style/Documentation:
|
|
14
14
|
Enabled: false
|
15
15
|
|
16
16
|
Metrics/LineLength:
|
17
|
-
Max:
|
17
|
+
Max: 105
|
18
|
+
|
19
|
+
Metrics/ClassLength:
|
20
|
+
Max: 250
|
18
21
|
|
19
22
|
Layout/MultilineMethodCallIndentation:
|
20
23
|
EnforcedStyle: indented
|
@@ -29,3 +32,28 @@ Metrics/ModuleLength:
|
|
29
32
|
Metrics/BlockLength:
|
30
33
|
Exclude:
|
31
34
|
- "**/*_spec.rb"
|
35
|
+
|
36
|
+
Lint/ConstantDefinitionInBlock:
|
37
|
+
Exclude:
|
38
|
+
- "**/*_spec.rb"
|
39
|
+
|
40
|
+
Layout/EmptyLineBetweenDefs:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
Layout/HashAlignment:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
Lint/BooleanSymbol:
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Style/HashEachMethods:
|
50
|
+
Exclude:
|
51
|
+
- lib/weka/core/instances.rb
|
52
|
+
- spec/classifiers/evaluation_spec.rb
|
53
|
+
|
54
|
+
Naming/PredicateName:
|
55
|
+
Exclude:
|
56
|
+
- lib/weka/core/instances.rb
|
57
|
+
|
58
|
+
Metrics/CyclomaticComplexity:
|
59
|
+
Max: 8
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.7.3] – 2021-01-21
|
11
|
+
### Changed
|
12
|
+
- Update Weka Jar dependency to weka-dev v3.9.5
|
13
|
+
Please also refer to the weka changelog for included updates & fixes:
|
14
|
+
https://www.cs.waikato.ac.nz/~ml/weka/CHANGELOG-3-9-5
|
15
|
+
- Update dev dependencies
|
16
|
+
|
10
17
|
## [0.7.2] – 2020-03-20
|
11
18
|
### Changed
|
12
19
|
- Update Weka Jar dependency to weka-dev v3.9.4
|
@@ -84,7 +91,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
84
91
|
## [0.1.0] – 2015-12-26
|
85
92
|
Initial release
|
86
93
|
|
87
|
-
[Unreleased]: https://github.com/paulgoetze/weka-jruby/compare/v0.7.
|
94
|
+
[Unreleased]: https://github.com/paulgoetze/weka-jruby/compare/v0.7.3...HEAD
|
95
|
+
[0.7.3]: https://github.com/paulgoetze/weka-jruby/compare/v0.7.2...v0.7.3
|
88
96
|
[0.7.2]: https://github.com/paulgoetze/weka-jruby/compare/v0.7.1...v0.7.2
|
89
97
|
[0.7.1]: https://github.com/paulgoetze/weka-jruby/compare/v0.7.0...v0.7.1
|
90
98
|
[0.7.0]: https://github.com/paulgoetze/weka-jruby/compare/v0.6.0...v0.7.0
|
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -51,7 +51,7 @@ Then, run `rake spec` to run the tests. You can also run `bin/console` or `rake
|
|
51
51
|
|
52
52
|
## Contributing
|
53
53
|
|
54
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/paulgoetze/weka-jruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant Code of Conduct](https://github.com/paulgoetze/weka-jruby/blob/
|
54
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/paulgoetze/weka-jruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant Code of Conduct](https://github.com/paulgoetze/weka-jruby/blob/main/CODE_OF_CONDUCT.md).
|
55
55
|
|
56
56
|
For development we use the [git branching model](http://nvie.com/posts/a-successful-git-branching-model/) described by [nvie](https://github.com/nvie).
|
57
57
|
|
@@ -74,4 +74,4 @@ The original ideas for wrapping Weka in JRuby come from [@arrigonialberto86](htt
|
|
74
74
|
|
75
75
|
## License
|
76
76
|
|
77
|
-
The gem is available as open source under the terms of the [MIT License](https://github.com/paulgoetze/weka-jruby/blob/
|
77
|
+
The gem is available as open source under the terms of the [MIT License](https://github.com/paulgoetze/weka-jruby/blob/main/MIT-LICENSE.txt).
|
data/lib/weka/class_builder.rb
CHANGED
@@ -88,6 +88,7 @@ module Weka
|
|
88
88
|
|
89
89
|
def include_utils
|
90
90
|
return unless utils_defined?
|
91
|
+
|
91
92
|
"include #{utils}"
|
92
93
|
end
|
93
94
|
|
@@ -116,6 +117,7 @@ module Weka
|
|
116
117
|
|
117
118
|
def downcase_first_char(string)
|
118
119
|
return if string.nil? || string.empty?
|
120
|
+
|
119
121
|
string[0].downcase + string[1..-1]
|
120
122
|
end
|
121
123
|
end
|
@@ -81,8 +81,7 @@ module Weka
|
|
81
81
|
java_import 'java.util.Random'
|
82
82
|
include Checks
|
83
83
|
|
84
|
-
attr_reader :training_instances
|
85
|
-
attr_reader :instances_structure
|
84
|
+
attr_reader :training_instances, :instances_structure
|
86
85
|
|
87
86
|
def train_with_instances(instances)
|
88
87
|
ensure_class_attribute_assigned!(instances)
|
@@ -18,17 +18,19 @@ module Weka
|
|
18
18
|
enumerate_attributes.to_a
|
19
19
|
end
|
20
20
|
|
21
|
-
def each_attribute
|
21
|
+
def each_attribute(&block)
|
22
22
|
if block_given?
|
23
|
-
enumerate_attributes.each
|
23
|
+
enumerate_attributes.each(&block)
|
24
24
|
else
|
25
25
|
enumerate_attributes
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def each_attribute_with_index
|
30
|
-
|
31
|
-
|
29
|
+
def each_attribute_with_index(&block)
|
30
|
+
if block_given?
|
31
|
+
enumerate_attributes.each_with_index(&block)
|
32
|
+
else
|
33
|
+
enumerate_attributes
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
data/lib/weka/core/instances.rb
CHANGED
@@ -59,9 +59,8 @@ module Weka
|
|
59
59
|
def attributes(include_class_attribute: false)
|
60
60
|
attrs = enumerate_attributes.to_a
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
end
|
62
|
+
class_available = include_class_attribute && class_attribute_defined?
|
63
|
+
attrs.insert(class_index, class_attribute) if class_available
|
65
64
|
|
66
65
|
attrs
|
67
66
|
end
|
@@ -99,31 +98,35 @@ module Weka
|
|
99
98
|
check_for_attribute_type(type)
|
100
99
|
end
|
101
100
|
|
102
|
-
def each
|
101
|
+
def each(&block)
|
103
102
|
if block_given?
|
104
|
-
enumerate_instances.each
|
103
|
+
enumerate_instances.each(&block)
|
105
104
|
else
|
106
105
|
enumerate_instances
|
107
106
|
end
|
108
107
|
end
|
109
108
|
|
110
|
-
def each_with_index
|
111
|
-
|
112
|
-
|
109
|
+
def each_with_index(&block)
|
110
|
+
if block_given?
|
111
|
+
enumerate_instances.each_with_index(&block)
|
112
|
+
else
|
113
|
+
enumerate_instances
|
113
114
|
end
|
114
115
|
end
|
115
116
|
|
116
|
-
def each_attribute
|
117
|
+
def each_attribute(&block)
|
117
118
|
if block_given?
|
118
|
-
enumerate_attributes.each
|
119
|
+
enumerate_attributes.each(&block)
|
119
120
|
else
|
120
121
|
enumerate_attributes
|
121
122
|
end
|
122
123
|
end
|
123
124
|
|
124
|
-
def each_attribute_with_index
|
125
|
-
|
126
|
-
|
125
|
+
def each_attribute_with_index(&block)
|
126
|
+
if block_given?
|
127
|
+
enumerate_attributes.each_with_index(&block)
|
128
|
+
else
|
129
|
+
enumerate_attributes
|
127
130
|
end
|
128
131
|
end
|
129
132
|
|
@@ -306,9 +309,7 @@ module Weka
|
|
306
309
|
end
|
307
310
|
|
308
311
|
def ensure_attribute_defined!(name)
|
309
|
-
if attribute_names(include_class_attribute: true).include?(name.to_s)
|
310
|
-
return
|
311
|
-
end
|
312
|
+
return if attribute_names(include_class_attribute: true).include?(name.to_s)
|
312
313
|
|
313
314
|
error = "\"#{name}\" is not defined."
|
314
315
|
hint = 'Only defined attributes can be used as class attribute!'
|
@@ -325,6 +326,7 @@ module Weka
|
|
325
326
|
|
326
327
|
def map_attribute_type(type)
|
327
328
|
return -1 unless Attribute::TYPES.include?(type.downcase.to_sym)
|
329
|
+
|
328
330
|
Attribute.const_get(type.upcase)
|
329
331
|
end
|
330
332
|
|
data/lib/weka/version.rb
CHANGED
data/weka.gemspec
CHANGED
@@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
27
27
|
spec.add_development_dependency 'rake', '~> 13.0'
|
28
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.10'
|
29
29
|
|
30
|
-
spec.add_runtime_dependency 'jar-dependencies', '~> 0.4'
|
31
|
-
spec.requirements << 'jar nz.ac.waikato.cms.weka, weka-dev, 3.9.
|
30
|
+
spec.add_runtime_dependency 'jar-dependencies', '~> 0.4.1'
|
31
|
+
spec.requirements << 'jar nz.ac.waikato.cms.weka, weka-dev, 3.9.5'
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Paul Götze
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '3.
|
46
|
+
version: '3.10'
|
47
47
|
name: rspec
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
@@ -51,13 +51,13 @@ dependencies:
|
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.10'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: 0.4.1
|
61
61
|
name: jar-dependencies
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 0.4.1
|
69
69
|
description: A JRuby wrapper for the Weka library (http://www.cs.waikato.ac.nz/ml/weka/)
|
70
70
|
email:
|
71
71
|
- paul.christoph.goetze@gmail.com
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements:
|
150
|
-
- jar nz.ac.waikato.cms.weka, weka-dev, 3.9.
|
150
|
+
- jar nz.ac.waikato.cms.weka, weka-dev, 3.9.5
|
151
151
|
rubygems_version: 3.0.6
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|