jruby_mahout 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/jruby_mahout.rb CHANGED
@@ -4,5 +4,11 @@ module JrubyMahout
4
4
  require File.join(ENV["MAHOUT_DIR"], 'mahout-integration-0.7.jar')
5
5
  require File.join(ENV["MAHOUT_DIR"], 'mahout-math-0.7.jar')
6
6
  Dir.glob(File.join(ENV["MAHOUT_DIR"], 'lib/*.jar')).each { |d| require d }
7
- Dir['./lib/jruby_mahout/*.rb'].each{ |f| require f }
7
+
8
+ require 'jruby_mahout/recommender'
9
+ require 'jruby_mahout/recommender_builder'
10
+ require 'jruby_mahout/data_model'
11
+ require 'jruby_mahout/evaluator'
12
+ require 'jruby_mahout/postgres_manager'
13
+ require 'jruby_mahout/mysql_manager'
8
14
  end
@@ -1,5 +1,7 @@
1
1
  module JrubyMahout
2
2
  class DataModel
3
+ java_import org.apache.mahout.cf.taste.impl.model.file.FileDataModel
4
+
3
5
  attr_accessor :data_model
4
6
 
5
7
  def initialize(data_model_type, params)
@@ -1,5 +1,7 @@
1
1
  module JrubyMahout
2
2
  class Evaluator
3
+ java_import org.apache.mahout.cf.taste.impl.eval.AverageAbsoluteDifferenceRecommenderEvaluator
4
+
3
5
  def initialize(data_model, recommender_builder)
4
6
  @data_model = data_model
5
7
  @recommender_builder = recommender_builder
@@ -1,34 +1,21 @@
1
1
  # Recommenders
2
- java_import org.apache.mahout.cf.taste.eval.RecommenderBuilder
3
- java_import org.apache.mahout.cf.taste.impl.similarity.PearsonCorrelationSimilarity
4
- java_import org.apache.mahout.cf.taste.impl.similarity.EuclideanDistanceSimilarity
5
- java_import org.apache.mahout.cf.taste.impl.similarity.SpearmanCorrelationSimilarity
6
- java_import org.apache.mahout.cf.taste.impl.similarity.LogLikelihoodSimilarity
7
- java_import org.apache.mahout.cf.taste.impl.similarity.TanimotoCoefficientSimilarity
8
- java_import org.apache.mahout.cf.taste.impl.similarity.PearsonCorrelationSimilarity
2
+
9
3
 
10
4
  # Neighborhoods
11
- java_import org.apache.mahout.cf.taste.impl.neighborhood.NearestNUserNeighborhood
5
+
12
6
 
13
7
  # Recommenders
14
- java_import org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender
15
- java_import org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender
16
- java_import org.apache.mahout.cf.taste.impl.recommender.slopeone.SlopeOneRecommender
8
+
17
9
 
18
10
  # Weighting
19
- java_import org.apache.mahout.cf.taste.common.Weighting
11
+
20
12
 
21
13
  # Evaluators
22
- java_import org.apache.mahout.cf.taste.impl.eval.AverageAbsoluteDifferenceRecommenderEvaluator
14
+
23
15
 
24
16
  # Data Models
25
- java_import org.apache.mahout.cf.taste.impl.model.jdbc.PostgreSQLJDBCDataModel
26
- java_import org.apache.mahout.cf.taste.impl.model.file.FileDataModel
17
+
27
18
 
28
19
 
29
20
  # Postgres
30
- begin
31
- java_import org.postgresql.ds.PGPoolingDataSource
32
- rescue Exception => e
33
- puts e
34
- end
21
+
@@ -1,5 +1,13 @@
1
1
  module JrubyMahout
2
2
  class PostgresManager
3
+ java_import org.apache.mahout.cf.taste.impl.model.jdbc.PostgreSQLJDBCDataModel
4
+
5
+ begin
6
+ java_import org.postgresql.ds.PGPoolingDataSource
7
+ rescue Exception => e
8
+ puts e
9
+ end
10
+
3
11
  attr_accessor :data_model, :data_source, :statement
4
12
 
5
13
  def initialize(params)
@@ -1,5 +1,21 @@
1
1
  module JrubyMahout
2
2
  class RecommenderBuilder
3
+ java_import org.apache.mahout.cf.taste.eval.RecommenderBuilder
4
+ java_import org.apache.mahout.cf.taste.impl.similarity.PearsonCorrelationSimilarity
5
+ java_import org.apache.mahout.cf.taste.impl.similarity.EuclideanDistanceSimilarity
6
+ java_import org.apache.mahout.cf.taste.impl.similarity.SpearmanCorrelationSimilarity
7
+ java_import org.apache.mahout.cf.taste.impl.similarity.LogLikelihoodSimilarity
8
+ java_import org.apache.mahout.cf.taste.impl.similarity.TanimotoCoefficientSimilarity
9
+ java_import org.apache.mahout.cf.taste.impl.similarity.PearsonCorrelationSimilarity
10
+
11
+ java_import org.apache.mahout.cf.taste.impl.neighborhood.NearestNUserNeighborhood
12
+
13
+ java_import org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender
14
+ java_import org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender
15
+ java_import org.apache.mahout.cf.taste.impl.recommender.slopeone.SlopeOneRecommender
16
+
17
+ java_import org.apache.mahout.cf.taste.common.Weighting
18
+
3
19
  attr_accessor :recommender_name, :item_based_allowed
4
20
  # public interface RecommenderBuilder
5
21
  # Implementations of this inner interface are simple helper classes which create a Recommender to be evaluated based on the given DataModel.
@@ -1,3 +1,3 @@
1
1
  module JrubyMahout
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jruby_mahout
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Vasily Vasinov
@@ -54,26 +54,33 @@ executables: []
54
54
  extensions: []
55
55
  extra_rdoc_files: []
56
56
  files:
57
- - .gitignore
58
- - .rspec
59
- - Gemfile
60
- - Gemfile.lock
57
+ - !binary |-
58
+ bGliL2pydWJ5X21haG91dC5yYg==
59
+ - !binary |-
60
+ bGliL2pydWJ5X21haG91dC9kYXRhX21vZGVsLnJi
61
+ - !binary |-
62
+ bGliL2pydWJ5X21haG91dC9ldmFsdWF0b3IucmI=
63
+ - !binary |-
64
+ bGliL2pydWJ5X21haG91dC9tYWhvdXRfaW1wb3J0cy5yYg==
65
+ - !binary |-
66
+ bGliL2pydWJ5X21haG91dC9teXNxbF9tYW5hZ2VyLnJi
67
+ - !binary |-
68
+ bGliL2pydWJ5X21haG91dC9wb3N0Z3Jlc19tYW5hZ2VyLnJi
69
+ - !binary |-
70
+ bGliL2pydWJ5X21haG91dC9yZWNvbW1lbmRlci5yYg==
71
+ - !binary |-
72
+ bGliL2pydWJ5X21haG91dC9yZWNvbW1lbmRlcl9idWlsZGVyLnJi
73
+ - !binary |-
74
+ bGliL2pydWJ5X21haG91dC92ZXJzaW9uLnJi
61
75
  - MIT-LICENSE
62
- - README.md
63
76
  - Rakefile
64
- - jruby_mahout.gemspec
65
- - lib/jruby_mahout.rb
66
- - lib/jruby_mahout/data_model.rb
67
- - lib/jruby_mahout/evaluator.rb
68
- - lib/jruby_mahout/mahout_imports.rb
69
- - lib/jruby_mahout/mysql_manager.rb
70
- - lib/jruby_mahout/postgres_manager.rb
71
- - lib/jruby_mahout/recommender.rb
72
- - lib/jruby_mahout/recommender_builder.rb
73
- - lib/jruby_mahout/version.rb
74
- - spec/recommender_data.csv
75
- - spec/recommender_spec.rb
76
- - spec/spec_helper.rb
77
+ - README.md
78
+ - !binary |-
79
+ c3BlYy9yZWNvbW1lbmRlcl9kYXRhLmNzdg==
80
+ - !binary |-
81
+ c3BlYy9yZWNvbW1lbmRlcl9zcGVjLnJi
82
+ - !binary |-
83
+ c3BlYy9zcGVjX2hlbHBlci5yYg==
77
84
  homepage: https://github.com/vasinov/jruby_mahout
78
85
  licenses:
79
86
  - MIT
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- .bundle/
2
- .idea/
3
- .DS_Store
4
- log/*.log
5
- pkg/
6
- .rbenv-version
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format documentation
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source "http://rubygems.org"
2
- gemspec
data/Gemfile.lock DELETED
@@ -1,27 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- jruby_mahout (0.2.0)
5
-
6
- GEM
7
- remote: http://rubygems.org/
8
- specs:
9
- diff-lcs (1.1.3)
10
- rake (10.0.1)
11
- rspec (2.12.0)
12
- rspec-core (~> 2.12.0)
13
- rspec-expectations (~> 2.12.0)
14
- rspec-mocks (~> 2.12.0)
15
- rspec-core (2.12.0)
16
- rspec-expectations (2.12.0)
17
- diff-lcs (~> 1.1.3)
18
- rspec-mocks (2.12.0)
19
-
20
- PLATFORMS
21
- java
22
- ruby
23
-
24
- DEPENDENCIES
25
- jruby_mahout!
26
- rake
27
- rspec
data/jruby_mahout.gemspec DELETED
@@ -1,22 +0,0 @@
1
- $LOAD_PATH << File.expand_path("../lib", __FILE__)
2
- require "jruby_mahout/version"
3
-
4
- Gem::Specification.new do |gem|
5
- gem.name = "jruby_mahout"
6
- gem.version = JrubyMahout::VERSION
7
- gem.authors = ["Vasily Vasinov"]
8
- gem.email = ["vasinov@me.com"]
9
- gem.homepage = "https://github.com/vasinov/jruby_mahout"
10
- gem.summary = "Jruby Mahout is a gem that unleashes the power of Apache Mahout in the world of Jruby."
11
- gem.description = "Jruby Mahout is a gem that unleashes the power of Apache Mahout in the world of Jruby. Mahout is a superior machine learning library written in Java. It deals with recommendations, clustering and classification machine learning problems at scale. Until now it was difficult to use it in Ruby projects. You'd have to implement Java interfaces in Jruby yourself, which is not quick especially if you just started exploring the world of machine learning."
12
- gem.license = "MIT"
13
-
14
- gem.files = Dir["{lib}/**/*"] + ["MIT-LICENSE", "README.md"]
15
- gem.test_files = Dir["spec/**/*"]
16
- gem.files = `git ls-files`.split($/)
17
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
- gem.require_paths = ["lib"]
19
-
20
- gem.add_development_dependency "rake"
21
- gem.add_development_dependency "rspec"
22
- end