svmkit 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +3 -0
- data/lib/svmkit/tree/decision_tree_classifier.rb +3 -4
- data/lib/svmkit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f4ee565e18136b7f40832368ef78df514b7390a20929d40efb623d2ba7c0378
|
4
|
+
data.tar.gz: e05f3ff80b02ee41a7ce4c32cf6bc6cc99f30771ae9f719eb4fea716680da229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48cc0e18b0aa8a5ace9ceb07744249b799f61ffc04b177bbbb229529754c6e138f13dcd9f5ff04c2b61a380abcef01a6d0f4c175a86b7829c00aad9b91181521
|
7
|
+
data.tar.gz: 2b84b8983d392015dc30cb69851e4df11c4d1b30e6e521763179e648e239482c0fb508ccacf46e03cbbe8f2765b123df4a595a3f7f2a2384b0d1c0f085cd78fd
|
data/HISTORY.md
CHANGED
@@ -112,8 +112,7 @@ module SVMKit
|
|
112
112
|
# @return [Numo::DFloat] (shape: [n_samples, n_classes]) Predicted probability of each class per sample.
|
113
113
|
def predict_proba(x)
|
114
114
|
SVMKit::Validation.check_sample_array(x)
|
115
|
-
|
116
|
-
probs[true, @classes]
|
115
|
+
Numo::DFloat[*(Array.new(x.shape[0]) { |n| predict_at_node(@tree, x[n, true]) })]
|
117
116
|
end
|
118
117
|
|
119
118
|
# Return the index of the leaf that each sample reached.
|
@@ -214,11 +213,11 @@ module SVMKit
|
|
214
213
|
end
|
215
214
|
|
216
215
|
def put_leaf(node, y)
|
217
|
-
node.probs =
|
216
|
+
node.probs = Numo::DFloat[*(@classes.to_a.map { |c| y.eq(c).count })] / node.n_samples
|
218
217
|
node.leaf = true
|
219
218
|
node.leaf_id = @n_leaves
|
220
219
|
@n_leaves += 1
|
221
|
-
@leaf_labels.push(node.probs.max_index)
|
220
|
+
@leaf_labels.push(@classes[node.probs.max_index])
|
222
221
|
node
|
223
222
|
end
|
224
223
|
|
data/lib/svmkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svmkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshoku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: numo-narray
|