lurn 0.1.1
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 +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +68 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/lurn/evaluation/classifier_evaluator.rb +83 -0
- data/lib/lurn/naive_bayes/bernoulli_naive_bayes.rb +107 -0
- data/lib/lurn/text/bernoulli_vectorizer.rb +68 -0
- data/lib/lurn/text/word_tokenizer.rb +43 -0
- data/lib/lurn/version.rb +3 -0
- data/lib/lurn.rb +10 -0
- data/lurn.gemspec +33 -0
- metadata +172 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b628aa2df6567044144aebc12d52f284b0eb93e9
|
4
|
+
data.tar.gz: 7d6089b8ca48eb371e39288ae034543b6f447e9d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0140373cd80d2594c4c34e5c9959f043b1f33ff527b5dd5e8ebcba7173153ee2ed3766b2f49888780040dbbe1b04e6bfce656bf0cd0b21294a9c0e50898bd798
|
7
|
+
data.tar.gz: dd31fabb232408c405fe7e40a630723fa39ab30f28982b8db6f0f6cf3dfeca4fc4bf4dbaae5df889e48c101617208993ee01701b1e2f34e0d550c499299d1789
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 daniel.carpenter
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# Lurn
|
2
|
+
|
3
|
+
Lurn is a ruby gem for performing machine learning. The API and design patterns in Lurn are inspired by sklearn, an analogous library for Python.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'lurn'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install lurn
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
### Bernoulli Naive Bayes
|
24
|
+
```ruby
|
25
|
+
require 'lurn'
|
26
|
+
|
27
|
+
documents = [
|
28
|
+
'ruby is a great programming language',
|
29
|
+
'the giants recently won the world series',
|
30
|
+
'java is a compiled programming language',
|
31
|
+
'the jets are a football team'
|
32
|
+
]
|
33
|
+
|
34
|
+
labels = ['computers','sports','computers','sports']
|
35
|
+
|
36
|
+
# vectorizers take raw data and transform it to a set of features that our
|
37
|
+
# model can understand - in this case an array of boolean values representing
|
38
|
+
# the presence or absence of a word in text
|
39
|
+
vectorizer = Lurn::Text::BernoulliVectorizer.new
|
40
|
+
vectorizer.fit(documents)
|
41
|
+
vectors = vectorizer.transform(documents)
|
42
|
+
|
43
|
+
model = Lurn::NaiveBayes::BernoulliNaiveBayes.new
|
44
|
+
model.fit(vectors, labels)
|
45
|
+
|
46
|
+
new_vectors = vectorizer.transform(['programming is fun'])
|
47
|
+
probabilities = model.predict_probabilities(new_vectors.first)
|
48
|
+
# => [0.9715681919147049, 0.028431808085295614]
|
49
|
+
|
50
|
+
# to get the class of the maximum probability, look at the same index of the
|
51
|
+
# unique_labels attribute on the model
|
52
|
+
model.unique_labels[0] # => 'computers'
|
53
|
+
```
|
54
|
+
|
55
|
+
## Development
|
56
|
+
|
57
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
58
|
+
|
59
|
+
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).
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/dansbits/lurn.
|
64
|
+
|
65
|
+
|
66
|
+
## License
|
67
|
+
|
68
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "lurn"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'terminal-table'
|
2
|
+
require 'csv'
|
3
|
+
|
4
|
+
module Lurn
|
5
|
+
module Evaluation
|
6
|
+
class ClassifierEvaluator
|
7
|
+
|
8
|
+
attr_accessor :unique_classes
|
9
|
+
|
10
|
+
def initialize(predicted, actual)
|
11
|
+
@classes = Daru::DataFrame.new(predicted: predicted, actual: actual)
|
12
|
+
@unique_classes = (predicted + actual).uniq
|
13
|
+
preprocess_classes
|
14
|
+
end
|
15
|
+
|
16
|
+
def precision(cls)
|
17
|
+
true_positives = true_positives(cls)
|
18
|
+
false_positives = false_positives(cls)
|
19
|
+
true_positives.to_f / (true_positives + false_positives).to_f
|
20
|
+
end
|
21
|
+
|
22
|
+
def recall(cls)
|
23
|
+
true_positives = true_positives(cls)
|
24
|
+
false_nevatives = false_negatives(cls)
|
25
|
+
|
26
|
+
true_positives.to_f / (true_positives + false_nevatives).to_f
|
27
|
+
end
|
28
|
+
|
29
|
+
def true_positives(cls)
|
30
|
+
@classes.filter_rows { |r| r[:predicted] == r[:actual] && r[:predicted] == cls }.size
|
31
|
+
end
|
32
|
+
|
33
|
+
def false_positives(cls)
|
34
|
+
@classes.filter_rows { |r| r[:predicted] == cls && r[:actual] != cls }.size
|
35
|
+
end
|
36
|
+
|
37
|
+
def false_negatives(cls)
|
38
|
+
@classes.filter_rows { |r| r[:actual] == cls && r[:predicted] != cls }.size
|
39
|
+
end
|
40
|
+
|
41
|
+
def summary
|
42
|
+
headings = ['Class','Precision','Recall']
|
43
|
+
|
44
|
+
::Terminal::Table.new(rows: summary_rows, headings: headings).to_s
|
45
|
+
end
|
46
|
+
|
47
|
+
def to_csv(file_path)
|
48
|
+
headings = ['Class','Precision','Recall']
|
49
|
+
|
50
|
+
CSV.open file_path, 'w' do |csv|
|
51
|
+
csv << headings
|
52
|
+
|
53
|
+
summary_rows.each do |row|
|
54
|
+
csv << row
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def summary_rows
|
62
|
+
rows = []
|
63
|
+
precision_sum = 0
|
64
|
+
recall_sum = 0
|
65
|
+
|
66
|
+
@unique_classes.each do |cls|
|
67
|
+
rows << [cls, self.precision(cls), self.recall(cls)]
|
68
|
+
precision_sum = precision_sum + self.precision(cls)
|
69
|
+
recall_sum = recall_sum + self.recall(cls)
|
70
|
+
end
|
71
|
+
|
72
|
+
rows << ['Overall Average', precision_sum / @unique_classes.length.to_f, recall_sum / @unique_classes.length.to_f]
|
73
|
+
|
74
|
+
rows
|
75
|
+
end
|
76
|
+
|
77
|
+
def preprocess_classes
|
78
|
+
@classes[:accurately_predicted] = @classes.map_rows { |r| r[:predicted] == r[:actual] }
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
require 'matrix'
|
2
|
+
|
3
|
+
module Lurn
|
4
|
+
module NaiveBayes
|
5
|
+
class BernoulliNaiveBayes
|
6
|
+
|
7
|
+
attr_accessor :probability_matrix, :label_probabilities, :unique_labels
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@k = 1.0
|
11
|
+
end
|
12
|
+
|
13
|
+
def fit(vectors, labels)
|
14
|
+
vectors = Matrix.rows(vectors)
|
15
|
+
|
16
|
+
@unique_labels = labels.uniq
|
17
|
+
@feature_count = vectors.column_size
|
18
|
+
|
19
|
+
document_count_matrix = build_document_count_matrix(vectors, labels)
|
20
|
+
@probability_matrix = build_probability_matrix(document_count_matrix, labels)
|
21
|
+
|
22
|
+
@label_probabilities = @unique_labels.map { |l1| labels.select { |l2| l1 == l2 }.count.to_f / labels.count.to_f }
|
23
|
+
end
|
24
|
+
|
25
|
+
def predict_probabilities(vector)
|
26
|
+
log_probabilties = predict_log_probabilities(vector)
|
27
|
+
|
28
|
+
log_probabilties.map { |p| Math.exp(p) }
|
29
|
+
end
|
30
|
+
|
31
|
+
def predict_log_probabilities(vector)
|
32
|
+
|
33
|
+
probabilities = @unique_labels.map do |label|
|
34
|
+
joint_log_likelihood(vector, label)
|
35
|
+
end
|
36
|
+
|
37
|
+
log_prob_x = Math.log(probabilities.map { |v| Math.exp(v) }.sum)
|
38
|
+
|
39
|
+
probabilities.map { |p| p - log_prob_x }
|
40
|
+
end
|
41
|
+
|
42
|
+
def max_class(vector)
|
43
|
+
log_probs = predict_log_probabilities(vector)
|
44
|
+
|
45
|
+
max_index = log_probs.index(log_probs.max)
|
46
|
+
|
47
|
+
unique_labels[max_index]
|
48
|
+
end
|
49
|
+
|
50
|
+
def max_probability(vector)
|
51
|
+
probs = predict_probabilities(vector)
|
52
|
+
|
53
|
+
probs.max
|
54
|
+
end
|
55
|
+
|
56
|
+
def to_h
|
57
|
+
{
|
58
|
+
probability_matrix: probability_matrix.to_a,
|
59
|
+
label_probabilities: label_probabilities,
|
60
|
+
unique_labels: unique_labels
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def build_probability_matrix(document_count_matrix, labels)
|
67
|
+
probability_matrix = Array.new(@unique_labels.count) { Array.new(@feature_count) { 0.0 } }
|
68
|
+
|
69
|
+
document_count_matrix.each_with_index do |value, row, col|
|
70
|
+
label = @unique_labels[row]
|
71
|
+
label_frequency = labels.select { |l| l == label }.count
|
72
|
+
|
73
|
+
probability_matrix[row][col] = Math.log((value.to_f + @k) / (label_frequency.to_f + (2.0 * @k)))
|
74
|
+
end
|
75
|
+
|
76
|
+
Matrix.rows(probability_matrix)
|
77
|
+
end
|
78
|
+
|
79
|
+
def build_document_count_matrix(vectors, labels)
|
80
|
+
matrix = Array.new(@unique_labels.count) { Array.new(@feature_count) { 0 } }
|
81
|
+
|
82
|
+
vectors.each_with_index do |value, row, col|
|
83
|
+
if value == true
|
84
|
+
label = labels[row]
|
85
|
+
label_index = @unique_labels.index(label)
|
86
|
+
matrix[label_index][col] += 1
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
Matrix.rows(matrix)
|
91
|
+
end
|
92
|
+
|
93
|
+
def joint_log_likelihood(vector, label)
|
94
|
+
label_index = @unique_labels.index(label)
|
95
|
+
|
96
|
+
vector = Vector.elements(vector.map { |e| e == true ? 1 : 0 })
|
97
|
+
probabilities = @probability_matrix.row(label_index)
|
98
|
+
neg_probs = probabilities.map { |prb| Math.log(1.0 - Math.exp(prb)) }
|
99
|
+
jll = vector.dot(probabilities - neg_probs)
|
100
|
+
jll += Math.log(@label_probabilities[label_index]) + neg_probs.sum
|
101
|
+
|
102
|
+
jll
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Lurn
|
2
|
+
module Text
|
3
|
+
class BernoulliVectorizer
|
4
|
+
|
5
|
+
attr_accessor :tokenizer
|
6
|
+
attr_accessor :vocabulary
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@tokenizer = options[:tokenizer] || WordTokenizer.new
|
10
|
+
@vocabulary = []
|
11
|
+
|
12
|
+
options[:max_df] ||= 50
|
13
|
+
options[:min_df] ||= 0
|
14
|
+
@options = options
|
15
|
+
end
|
16
|
+
|
17
|
+
def fit(documents)
|
18
|
+
@vocabulary = []
|
19
|
+
tokenized_docs = tokenize_documents(documents)
|
20
|
+
@vocabulary = tokenized_docs.flatten.uniq.sort
|
21
|
+
reduce_features(tokenized_docs)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_h
|
25
|
+
{
|
26
|
+
tokenizer_options: @tokenizer.to_h,
|
27
|
+
vocabulary: @vocabulary
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def transform(documents)
|
32
|
+
documents.map do |document|
|
33
|
+
tokens = @tokenizer.tokenize(document)
|
34
|
+
@vocabulary.map do |word|
|
35
|
+
tokens.include? word
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def reduce_features(tokenized_docs)
|
43
|
+
doc_frequencies = Array.new(@vocabulary.length, 0)
|
44
|
+
|
45
|
+
tokenized_docs.each do |tokens|
|
46
|
+
tokens.each do |token|
|
47
|
+
vocab_index = @vocabulary.index(token)
|
48
|
+
doc_frequencies[vocab_index] += 1
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
reduced_features = []
|
53
|
+
@vocabulary.each_with_index do |token, index|
|
54
|
+
freq = doc_frequencies[index]
|
55
|
+
if freq < @options[:max_df] && freq > @options[:min_df]
|
56
|
+
reduced_features.push token
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
@vocabulary = reduced_features
|
61
|
+
end
|
62
|
+
|
63
|
+
def tokenize_documents(documents)
|
64
|
+
documents.map { |doc| @tokenizer.tokenize(doc).uniq }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'lingua/stemmer'
|
2
|
+
|
3
|
+
module Lurn
|
4
|
+
module Text
|
5
|
+
class WordTokenizer
|
6
|
+
|
7
|
+
attr_accessor :options
|
8
|
+
|
9
|
+
STOP_WORDS = %w[
|
10
|
+
a about above after again against all am an and any are aren't as at be
|
11
|
+
because been before being below between both but by can't cannot could
|
12
|
+
couldn't did didn't do does doesn't doing don't down during each few for
|
13
|
+
from further had hadn't has hasn't have haven't having he he'd he'll
|
14
|
+
he's her here here's hers herself him himself his how how's i i'd i'll
|
15
|
+
i'm i've if in into is isn't it it's its itself let's me more most
|
16
|
+
mustn't my myself no nor not of off on once only or other ought our ours
|
17
|
+
]
|
18
|
+
|
19
|
+
def initialize(options = {})
|
20
|
+
@options = options
|
21
|
+
@options[:strip_punctuation] ||= false
|
22
|
+
@options[:strip_stopwords] ||= false
|
23
|
+
@options[:stem_words] ||= false
|
24
|
+
end
|
25
|
+
|
26
|
+
def tokenize(document)
|
27
|
+
document = document.gsub(/[[:punct:]]/, '') if @options[:strip_punctuation] == true
|
28
|
+
document = document.gsub(/\s+/, ' ').split(" ")
|
29
|
+
|
30
|
+
if(@options[:stem_words])
|
31
|
+
stemmer = Lingua::Stemmer.new(language: :en)
|
32
|
+
document = document.map { |word| stemmer.stem(word) }
|
33
|
+
end
|
34
|
+
|
35
|
+
document
|
36
|
+
end
|
37
|
+
|
38
|
+
def to_h
|
39
|
+
options
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/lurn/version.rb
ADDED
data/lib/lurn.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require "daru"
|
2
|
+
require "lurn/version"
|
3
|
+
require "lurn/text/word_tokenizer"
|
4
|
+
require "lurn/text/bernoulli_vectorizer"
|
5
|
+
require "lurn/naive_bayes/bernoulli_naive_bayes"
|
6
|
+
require "lurn/evaluation/classifier_evaluator"
|
7
|
+
|
8
|
+
module Lurn
|
9
|
+
# Your code goes here...
|
10
|
+
end
|
data/lurn.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'lurn/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "lurn"
|
8
|
+
spec.version = Lurn::VERSION
|
9
|
+
spec.authors = ["daniel.carpenter"]
|
10
|
+
spec.email = ["daniel.carpenter01@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{ A gem with tools for machine learning. }
|
13
|
+
spec.description = %q{ A gem with tools for machine learning. }
|
14
|
+
spec.homepage = "https://www.github.com/dansbits/lurn"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "terminal-table", "~> 1.7.3"
|
25
|
+
spec.add_dependency "ruby-stemmer", "~> 0.9.6"
|
26
|
+
spec.add_dependency "daru", '~> 0.1.6'
|
27
|
+
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
29
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
30
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
31
|
+
spec.add_development_dependency "awesome_print"
|
32
|
+
spec.add_development_dependency "byebug"
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lurn
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- daniel.carpenter
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: terminal-table
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.7.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.7.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ruby-stemmer
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.9.6
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.9.6
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: daru
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.1.6
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.1.6
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.13'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.13'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: awesome_print
|
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'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: byebug
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: " A gem with tools for machine learning. "
|
126
|
+
email:
|
127
|
+
- daniel.carpenter01@gmail.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".gitignore"
|
133
|
+
- ".rspec"
|
134
|
+
- ".travis.yml"
|
135
|
+
- Gemfile
|
136
|
+
- LICENSE.txt
|
137
|
+
- README.md
|
138
|
+
- Rakefile
|
139
|
+
- bin/console
|
140
|
+
- bin/setup
|
141
|
+
- lib/lurn.rb
|
142
|
+
- lib/lurn/evaluation/classifier_evaluator.rb
|
143
|
+
- lib/lurn/naive_bayes/bernoulli_naive_bayes.rb
|
144
|
+
- lib/lurn/text/bernoulli_vectorizer.rb
|
145
|
+
- lib/lurn/text/word_tokenizer.rb
|
146
|
+
- lib/lurn/version.rb
|
147
|
+
- lurn.gemspec
|
148
|
+
homepage: https://www.github.com/dansbits/lurn
|
149
|
+
licenses:
|
150
|
+
- MIT
|
151
|
+
metadata: {}
|
152
|
+
post_install_message:
|
153
|
+
rdoc_options: []
|
154
|
+
require_paths:
|
155
|
+
- lib
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
requirements: []
|
167
|
+
rubyforge_project:
|
168
|
+
rubygems_version: 2.5.1
|
169
|
+
signing_key:
|
170
|
+
specification_version: 4
|
171
|
+
summary: A gem with tools for machine learning.
|
172
|
+
test_files: []
|