disco 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/CHANGELOG.md +4 -0
- data/lib/disco/recommender.rb +4 -7
- data/lib/disco/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1d7b56a9c40088874bbd79ff7fa5bf8783a4406a9e5dadf1dddb04303ca7fee
|
4
|
+
data.tar.gz: 0d843da83fc246b5da2aa097eba3534d729b51d9b03c368226b884fe33e61795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49341b30e2ffa7348c19af2c0073f8f9e15afe3dcd856922fb5ae3fd3cd6e5ab555731c38bf3678f5f4efb064ecfce994d24b6238aa93fbc62e4621d7de036ab
|
7
|
+
data.tar.gz: 9bb387230927cf55e94c3614c4a68881031206c9ee2dee2d48c06f6053134cdff0af4c4d24eba825acf3429394556368378bd51860f4dfcddf0dd1742309794f
|
data/CHANGELOG.md
CHANGED
data/lib/disco/recommender.rb
CHANGED
@@ -261,7 +261,6 @@ module Disco
|
|
261
261
|
end
|
262
262
|
|
263
263
|
def to_json
|
264
|
-
require "base64"
|
265
264
|
require "json"
|
266
265
|
|
267
266
|
obj = {
|
@@ -270,8 +269,8 @@ module Disco
|
|
270
269
|
item_ids: @item_map.keys,
|
271
270
|
rated: @user_map.map { |_, u| (@rated[u] || {}).keys },
|
272
271
|
global_mean: @global_mean,
|
273
|
-
user_factors:
|
274
|
-
item_factors:
|
272
|
+
user_factors: [@user_factors.to_binary].pack("m0"),
|
273
|
+
item_factors: [@item_factors.to_binary].pack("m0"),
|
275
274
|
factors: @factors,
|
276
275
|
epochs: @epochs,
|
277
276
|
verbose: @verbose
|
@@ -432,16 +431,14 @@ module Disco
|
|
432
431
|
end
|
433
432
|
|
434
433
|
def json_load(obj)
|
435
|
-
require "base64"
|
436
|
-
|
437
434
|
@implicit = obj["implicit"]
|
438
435
|
@user_map = obj["user_ids"].map.with_index.to_h
|
439
436
|
@item_map = obj["item_ids"].map.with_index.to_h
|
440
437
|
@rated = obj["rated"].map.with_index.to_h { |r, i| [i, r.to_h { |v| [v, true] }] }
|
441
438
|
@global_mean = obj["global_mean"].to_f
|
442
439
|
@factors = obj["factors"].to_i
|
443
|
-
@user_factors = Numo::SFloat.from_binary(
|
444
|
-
@item_factors = Numo::SFloat.from_binary(
|
440
|
+
@user_factors = Numo::SFloat.from_binary(obj["user_factors"].unpack1("m0"), [@user_map.size, @factors])
|
441
|
+
@item_factors = Numo::SFloat.from_binary(obj["item_factors"].unpack1("m0"), [@item_map.size, @factors])
|
445
442
|
@epochs = obj["epochs"].to_i
|
446
443
|
@verbose = obj["verbose"]
|
447
444
|
|
data/lib/disco/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: disco
|
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
|
- Andrew Kane
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2024-
|
10
|
+
date: 2024-12-30 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: libmf
|
@@ -38,7 +37,6 @@ dependencies:
|
|
38
37
|
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: 0.9.2
|
41
|
-
description:
|
42
40
|
email: andrew@ankane.org
|
43
41
|
executables: []
|
44
42
|
extensions: []
|
@@ -61,7 +59,6 @@ homepage: https://github.com/ankane/disco
|
|
61
59
|
licenses:
|
62
60
|
- MIT
|
63
61
|
metadata: {}
|
64
|
-
post_install_message:
|
65
62
|
rdoc_options: []
|
66
63
|
require_paths:
|
67
64
|
- lib
|
@@ -76,8 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
73
|
- !ruby/object:Gem::Version
|
77
74
|
version: '0'
|
78
75
|
requirements: []
|
79
|
-
rubygems_version: 3.
|
80
|
-
signing_key:
|
76
|
+
rubygems_version: 3.6.2
|
81
77
|
specification_version: 4
|
82
78
|
summary: Recommendations for Ruby and Rails using collaborative filtering
|
83
79
|
test_files: []
|