rumale-naive_bayes 2.0.0 → 2.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae6deb13a661df09919ac0216ff5c6e6b86b6c3197f26299f421d10b3ad94a5a
4
- data.tar.gz: 57835aef6656906a1824ebad77874c791c169b342ffbe8e447058e716f45f118
3
+ metadata.gz: 1e931847f9dbd35df07d330579b4b9be457ac1b4b2e8c1c5097c97bc668f8aee
4
+ data.tar.gz: '029bfcd306e8ac8f97705ec3ab22eef77ec6163c71b1523eca6eb512f63d39f0'
5
5
  SHA512:
6
- metadata.gz: 20e82d0fcf8c18f09a8c225c2cc4e8af11bad920af84dc43d4a6669c3f70358b78b91356be612f79677b3045ee7697415bb9e7006b26c942864654caaa9d6087
7
- data.tar.gz: 4c4e90457be587ef3c4ae65cc75d9877912867ed9a2ba7df19e9ff77e2e17e2854461f107c984c88c92978de8124499a9622e3db1786aaee90291970611f55d7
6
+ metadata.gz: c0d32512058d926784e33b5dc87798bd38959708002a7b35449fe6364e1b6b3e1531e65b5ee90a4cfe5230adc17748310db1fbe282a9b6f0fb590cf3c3cac965
7
+ data.tar.gz: fcb6ad290c77cd556a53d0549c748cc4e339e1a8f4ca0d29b2715007d9c4d377b215ed062e482eee0ab1f30b7a4dc1ac198a406ca19feaaa0c5d6a112070a3fe
@@ -65,9 +65,9 @@ module Rumale
65
65
  x = ::Rumale::Validation.check_convert_sample_array(x)
66
66
 
67
67
  n_classes = @classes.size
68
- bin_x = x.gt(0)
68
+ bin_x = Numo::DFloat.cast(x.gt(0))
69
69
  log_likelihoods = Array.new(n_classes) do |l|
70
- Math.log(@class_priors[l]) + (Numo::DFloat[*bin_x] * Numo::NMath.log(@feature_probs[l, true])).sum(axis: 1)
70
+ Math.log(@class_priors[l]) + (bin_x * Numo::NMath.log(@feature_probs[l, true])).sum(axis: 1)
71
71
  end
72
72
  Numo::DFloat[*log_likelihoods].transpose.dup
73
73
  end
@@ -5,6 +5,6 @@ module Rumale
5
5
  # This module consists of the classes that implement naive bayes models.
6
6
  module NaiveBayes
7
7
  # @!visibility private
8
- VERSION = '2.0.0'
8
+ VERSION = '2.0.1'
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumale-naive_bayes
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: 2.0.0
32
+ version: 2.0.1
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 2.0.0
39
+ version: 2.0.1
40
40
  description: |
41
41
  Rumale::NaiveBayes provides naive bayes models,
42
42
  such as Gaussian Naive Bayes, Multinomial Naive Bayes, and Bernoulli Naive Bayes,