libmf 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/libmf.bundle +0 -0
- data/lib/libmf/model.rb +4 -9
- data/lib/libmf/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 907cba459d6d4af0607aa2662b0f32b5afc30a1940cbf6c4e7712553cb95709c
|
4
|
+
data.tar.gz: 16e84358005ebb5432a2765c00dd79fe26f9822cbdfcb0570d829099c11e5470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56e8dd57eb146cf81ffd11c193565e632f623d0ade5c2650344e19951502bd492becf6268066da6c630936e5bb08e3ee068d9ecb7f942457955c88b1faf9e5eb
|
7
|
+
data.tar.gz: 2764dab3e8d5d3044bf78482988addeb40c026b592cb57ccec3984f70244eeaf77a0a8a4e597a8607d9cf41c74e69ab47391f1003ba163a45b84b010821a76c5
|
data/CHANGELOG.md
CHANGED
data/lib/libmf.bundle
ADDED
Binary file
|
data/lib/libmf/model.rb
CHANGED
@@ -52,11 +52,11 @@ module Libmf
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def p_factors
|
55
|
-
reshape(model[:p].read_array_of_float(factors * rows),
|
55
|
+
reshape(model[:p].read_array_of_float(factors * rows), factors)
|
56
56
|
end
|
57
57
|
|
58
58
|
def q_factors
|
59
|
-
reshape(model[:q].read_array_of_float(factors * columns),
|
59
|
+
reshape(model[:q].read_array_of_float(factors * columns), factors)
|
60
60
|
end
|
61
61
|
|
62
62
|
private
|
@@ -100,13 +100,8 @@ module Libmf
|
|
100
100
|
prob
|
101
101
|
end
|
102
102
|
|
103
|
-
def reshape(arr,
|
104
|
-
|
105
|
-
new_arr = rows.times.map { [] }
|
106
|
-
arr.each_with_index do |v, i|
|
107
|
-
new_arr[i % rows] << v
|
108
|
-
end
|
109
|
-
new_arr
|
103
|
+
def reshape(arr, factors)
|
104
|
+
arr.each_slice(factors).to_a
|
110
105
|
end
|
111
106
|
end
|
112
107
|
end
|
data/lib/libmf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libmf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- LICENSE.txt
|
92
92
|
- README.md
|
93
93
|
- ext/libmf/extconf.rb
|
94
|
+
- lib/libmf.bundle
|
94
95
|
- lib/libmf.rb
|
95
96
|
- lib/libmf/ffi.rb
|
96
97
|
- lib/libmf/model.rb
|