xlearn 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3a03335ce34564c93d235425d33019acd9aac39c9793efa93df4253f7adf9f7
4
- data.tar.gz: 81620576716d572343c803af08db4ee75ab40efcf0d43cb53703c0365cd3c3a3
3
+ metadata.gz: db5aa58044f0c7a4b39541599ac60363e32db0ef0583ea5ab2d200b5d355228d
4
+ data.tar.gz: 6d43254012b3ccf9a2ff23cceeff218e5260970d900d6b5634f122aa6c9b0127
5
5
  SHA512:
6
- metadata.gz: e394c80b5f461a82d209f48e652d664fa2400a232f5209e4f26d2048cdb8d3b3aaa86c80a09f52de4b95b9d8c7f86136b94c3b9b9f615f58f5449c353ca64b3c
7
- data.tar.gz: 1b834d1a743a039890c90f22807ae2874859cf972170dd138e996c0a4810763e492da7fb66fe1162936b3614ac920eaae93a780c0a5ac469c4bec9dbb6fa1206
6
+ metadata.gz: c539cdce4f80deab0306e45b32ed27a98d5e6e90151b7c8d1af4e06d90ed96c404b86beefd79b0d7018b757c2fcee5bf739fd6632dd0fc5baf12a30c5ac94c3b
7
+ data.tar.gz: 6b93fea811923b106daf660a0dd876ba1e79fcd525c6f8caca4fc1c83ca835caf60644e4db974a09a6bffc0718dcd0d8a41798745eeee818685ddd58d6bd89b4
@@ -1,3 +1,8 @@
1
+ ## 0.1.5 (2020-08-22)
2
+
3
+ - Added support for Rover
4
+ - Improved error message when not fit
5
+
1
6
  ## 0.1.4 (2020-02-11)
2
7
 
3
8
  - Fixed `Could not find xLearn` error on some Linux platforms
data/NOTICE.txt CHANGED
@@ -1,3 +1,4 @@
1
+ Copyright XLearn contributors
1
2
  Copyright 2019-2020 Andrew Kane
2
3
 
3
4
  Licensed under the Apache License, Version 2.0 (the "License");
data/README.md CHANGED
@@ -8,7 +8,7 @@ Supports:
8
8
  - Factorization machines
9
9
  - Field-aware factorization machines
10
10
 
11
- [![Build Status](https://travis-ci.org/ankane/xlearn.svg?branch=master)](https://travis-ci.org/ankane/xlearn)
11
+ [![Build Status](https://travis-ci.org/ankane/xlearn.svg?branch=master)](https://travis-ci.org/ankane/xlearn) [![Build status](https://ci.appveyor.com/api/projects/status/r7upg4073w7xct35/branch/master?svg=true)](https://ci.appveyor.com/project/ankane/xlearn/branch/master)
12
12
 
13
13
  ## Installation
14
14
 
@@ -129,16 +129,22 @@ Data can be an array of arrays
129
129
  [[1, 2, 3], [4, 5, 6]]
130
130
  ```
131
131
 
132
- Or a Daru data frame
132
+ Or a Numo array
133
133
 
134
134
  ```ruby
135
- Daru::DataFrame.from_csv("houses.csv")
135
+ Numo::NArray.cast([[1, 2, 3], [4, 5, 6]])
136
+ ```
137
+
138
+ Or a Rover data frame
139
+
140
+ ```ruby
141
+ Rover.read_csv("houses.csv")
136
142
  ```
137
143
 
138
- Or a Numo NArray
144
+ Or a Daru data frame
139
145
 
140
146
  ```ruby
141
- Numo::DFloat.new(3, 2).seq
147
+ Daru::DataFrame.from_csv("houses.csv")
142
148
  ```
143
149
 
144
150
  ## Performance
@@ -12,6 +12,9 @@ module XLearn
12
12
  elsif daru?(data)
13
13
  nrow, ncol = data.shape
14
14
  flat_data = data.map_rows(&:to_a).flatten
15
+ elsif rover?(data)
16
+ nrow, ncol = data.shape
17
+ flat_data = data.each_row.map(&:values).flatten
15
18
  elsif narray?(data)
16
19
  nrow, ncol = data.shape
17
20
  # TODO convert to SFloat and pass pointer
@@ -61,5 +64,9 @@ module XLearn
61
64
  def narray?(data)
62
65
  defined?(Numo::NArray) && data.is_a?(Numo::NArray)
63
66
  end
67
+
68
+ def rover?(data)
69
+ defined?(Rover::DataFrame) && data.is_a?(Rover::DataFrame)
70
+ end
64
71
  end
65
72
  end
@@ -48,6 +48,8 @@ module XLearn
48
48
  end
49
49
 
50
50
  def predict(x, out_path: nil)
51
+ raise Error, "Not trained" unless @model_file
52
+
51
53
  if x.is_a?(String)
52
54
  check_call FFI.XLearnSetTest(@handle, x)
53
55
  check_call FFI.XLearnSetBool(@handle, "from_file", true)
@@ -1,3 +1,3 @@
1
1
  module XLearn
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -0,0 +1,108 @@
1
+ Copyright XLearn contributors
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
15
+ ---
16
+
17
+ Copyright (C) 2011 Paul Mineiro
18
+ All rights reserved.
19
+
20
+ Redistribution and use in source and binary forms, with
21
+ or without modification, are permitted provided that the
22
+ following conditions are met:
23
+
24
+ * Redistributions of source code must retain the
25
+ above copyright notice, this list of conditions and
26
+ the following disclaimer.
27
+
28
+ * Redistributions in binary form must reproduce the
29
+ above copyright notice, this list of conditions and
30
+ the following disclaimer in the documentation and/or
31
+ other materials provided with the distribution.
32
+
33
+ * Neither the name of Paul Mineiro nor the names
34
+ of other contributors may be used to endorse or promote
35
+ products derived from this software without specific
36
+ prior written permission.
37
+
38
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
39
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
40
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
41
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
42
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
43
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
44
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
45
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
46
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
47
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
48
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
51
+ POSSIBILITY OF SUCH DAMAGE.
52
+
53
+ Contact: Paul Mineiro <paul@mineiro.com>
54
+
55
+ ---
56
+
57
+ Copyright 2011 Martin T. Sandsmark <sandsmark@samfundet.no>
58
+ Redistribution and use in source and binary forms, with or without
59
+ modification, are permitted provided that the following conditions
60
+ are met:
61
+ 1. Redistributions of source code must retain the above copyright
62
+ notice, this list of conditions and the following disclaimer.
63
+ 2. Redistributions in binary form must reproduce the above copyright
64
+ notice, this list of conditions and the following disclaimer in the
65
+ documentation and/or other materials provided with the distribution.
66
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
67
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
68
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
69
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
70
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
71
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
72
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
73
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
75
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
76
+
77
+ ---
78
+
79
+ Protocol Buffers - Google's data interchange format
80
+
81
+ Copyright 2008 Google Inc. All rights reserved.
82
+ https://developers.google.com/protocol-buffers/
83
+
84
+ Redistribution and use in source and binary forms, with or without
85
+ modification, are permitted provided that the following conditions are
86
+ met:
87
+
88
+ * Redistributions of source code must retain the above copyright
89
+ notice, this list of conditions and the following disclaimer.
90
+ * Redistributions in binary form must reproduce the above
91
+ copyright notice, this list of conditions and the following disclaimer
92
+ in the documentation and/or other materials provided with the
93
+ distribution.
94
+ * Neither the name of Google Inc. nor the names of its
95
+ contributors may be used to endorse or promote products derived from
96
+ this software without specific prior written permission.
97
+
98
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
99
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
100
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
101
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
102
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
103
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
104
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
105
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
106
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
107
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
108
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xlearn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-12 00:00:00.000000000 Z
11
+ date: 2020-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rover-df
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description:
98
112
  email: andrew@chartkick.com
99
113
  executables: []
@@ -114,6 +128,7 @@ files:
114
128
  - lib/xlearn/utils.rb
115
129
  - lib/xlearn/version.rb
116
130
  - vendor/LICENSE
131
+ - vendor/NOTICE
117
132
  - vendor/libxlearn_api.dylib
118
133
  - vendor/libxlearn_api.so
119
134
  - vendor/xlearn_api.dll