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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c54dbd4962bb9a0663ea90098f5b6f0f3b53545
4
- data.tar.gz: c0ac635518a8fffae07e3725471c717bfdfbf703
3
+ metadata.gz: 82ad55344b760f5b5fc48453c165ac225f943b5d
4
+ data.tar.gz: f95e098c3a20dae28375f3e61df444aa054daf33
5
5
  SHA512:
6
- metadata.gz: b4f73c45e8d1d696fc791b30a8f3c5c9c99ac83a708446da9382058fd494d3cd89457b1aebe6937876934932f2935da2eca54af3cd36d94ed54b9401874f5d4c
7
- data.tar.gz: 962ea49f993c4ead3db2684c79e90dd20939ad4ee48f53974bfe70919ac496a0d0b67fee1812b4c6a3f00a8c61507e48a22db11a5aa888cd04070aa1de88f5f1
6
+ metadata.gz: aeeba2a91ea65ec5ce46c68c6050ccaf67579b0ae80428b4b5484c7df2b0d035e76c6246b08ec3758babd4c48df41462c133faaaf231303ef8d6ce8579d38eb7
7
+ data.tar.gz: ea440252cf2b59f64671ffff77bd48df5544d66c4b691d77c5720ee84664e1e6f2ce5ad39ad3a8b4161dc4f49b7987199ef094f9b714c46d3c0ce1b384355c6c
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # KnnCv
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/knn_cv`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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
- ## Development
25
+ ```ruby
26
+ knn = KnnCv::Classifier.new k, data, Random.new
27
+ ```
28
28
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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 install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
31
+ To evaluate the behavior of the classifier over certain features, use the `fitness_for` method:
32
32
 
33
- ## Contributing
33
+ ```ruby
34
+ knn.fitness_for [0, 1, 0, 0, 1, 0, 1, 1, 1]
35
+ ```
34
36
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/knn_cv.
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 for Ruby based on the 'class' package for R}
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.
@@ -1,3 +1,3 @@
1
1
  module KnnCv
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/knn_cv.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require "knn_cv/version"
2
2
 
3
3
  module KnnCv
4
- # Your code goes here...
5
4
  end
6
5
 
7
6
  require "c_knn"
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.0
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 for Ruby based on the
115
- 'class' package for R
115
+ summary: A native kNN leave-one-out technique implementation
116
116
  test_files: []