knn_cv 0.1.0 → 0.1.2
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 +4 -4
- data/README.md +14 -9
- data/knn_cv.gemspec +3 -2
- data/lib/knn_cv/version.rb +1 -1
- data/lib/knn_cv.rb +0 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82ad55344b760f5b5fc48453c165ac225f943b5d
|
4
|
+
data.tar.gz: f95e098c3a20dae28375f3e61df444aa054daf33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeeba2a91ea65ec5ce46c68c6050ccaf67579b0ae80428b4b5484c7df2b0d035e76c6246b08ec3758babd4c48df41462c133faaaf231303ef8d6ce8579d38eb7
|
7
|
+
data.tar.gz: ea440252cf2b59f64671ffff77bd48df5544d66c4b691d77c5720ee84664e1e6f2ce5ad39ad3a8b4161dc4f49b7987199ef094f9b714c46d3c0ce1b384355c6c
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# KnnCv
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
A native kNN leave-one-out technique implementation (oriented to feature selection) for Ruby based on the 'class' package for R.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,15 +20,22 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
This gem provides very basic functionality in a straight-forward manner. `Classifier` objects can be created in order to evaluate kNN several times:
|
26
24
|
|
27
|
-
|
25
|
+
```ruby
|
26
|
+
knn = KnnCv::Classifier.new k, data, Random.new
|
27
|
+
```
|
28
28
|
|
29
|
-
|
29
|
+
where `k` represents the number of neighbors to be considered, `data` must be an `Array` of instances, which in turn are numeric `Array`s. The third argument is a `Random` object that can be used to ensure reproducibility.
|
30
30
|
|
31
|
-
To
|
31
|
+
To evaluate the behavior of the classifier over certain features, use the `fitness_for` method:
|
32
32
|
|
33
|
-
|
33
|
+
```ruby
|
34
|
+
knn.fitness_for [0, 1, 0, 0, 1, 0, 1, 1, 1]
|
35
|
+
```
|
34
36
|
|
35
|
-
|
37
|
+
The argument must be a binary `Array` (or other type of object that converts to a binary `Array`, such as [`BitArray`](https://github.com/ingramj/bitarray)).
|
38
|
+
|
39
|
+
## Contributing
|
36
40
|
|
41
|
+
Bug reports and pull requests are welcome at https://github.com/fdavidcl/knn_cv.
|
data/knn_cv.gemspec
CHANGED
@@ -9,9 +9,10 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["David Charte"]
|
10
10
|
spec.email = ["fdavidcl@outlook.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{A native kNN leave-one-out technique implementation
|
13
|
-
spec.description = %q{A native kNN leave-one-out technique implementation for Ruby based on the 'class' package for R}
|
12
|
+
spec.summary = %q{A native kNN leave-one-out technique implementation}
|
13
|
+
spec.description = %q{A native kNN leave-one-out technique implementation for Ruby based on the 'class' package for R.}
|
14
14
|
spec.homepage = "https://github.com/fdavidcl/ruby-knn_cv"
|
15
|
+
spec.licenses = ["GPL-3.0+"]
|
15
16
|
|
16
17
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
18
|
# delete this section to allow pushing this gem to any host.
|
data/lib/knn_cv/version.rb
CHANGED
data/lib/knn_cv.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knn_cv
|
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
|
- David Charte
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: A native kNN leave-one-out technique implementation for Ruby based on
|
70
|
-
the 'class' package for R
|
70
|
+
the 'class' package for R.
|
71
71
|
email:
|
72
72
|
- fdavidcl@outlook.com
|
73
73
|
executables: []
|
@@ -90,7 +90,8 @@ files:
|
|
90
90
|
- lib/knn_cv.rb
|
91
91
|
- lib/knn_cv/version.rb
|
92
92
|
homepage: https://github.com/fdavidcl/ruby-knn_cv
|
93
|
-
licenses:
|
93
|
+
licenses:
|
94
|
+
- GPL-3.0+
|
94
95
|
metadata: {}
|
95
96
|
post_install_message:
|
96
97
|
rdoc_options: []
|
@@ -111,6 +112,5 @@ rubyforge_project:
|
|
111
112
|
rubygems_version: 2.5.1
|
112
113
|
signing_key:
|
113
114
|
specification_version: 4
|
114
|
-
summary: A native kNN leave-one-out technique implementation
|
115
|
-
'class' package for R
|
115
|
+
summary: A native kNN leave-one-out technique implementation
|
116
116
|
test_files: []
|