Class: JrubyMahout::DataModel

Inherits:
Object
  • Object
show all
Defined in:
lib/jruby_mahout/data_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_model_type, params) ⇒ DataModel

Returns a new instance of DataModel.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/jruby_mahout/data_model.rb', line 7

def initialize(data_model_type, params)
  case data_model_type
    when "file"
      @data_model = FileDataModel.new(java.io.File.new(params[:file_path]))
    when "mysql"
      # TODO: implement
      @data_model = nil
    when "postgres"
      @data_model = PostgresManager.new(params).setup_data_model(params)
    else
      @data_model = nil
  end
end

Instance Attribute Details

#data_modelObject

Returns the value of attribute data_model.



5
6
7
# File 'lib/jruby_mahout/data_model.rb', line 5

def data_model
  @data_model
end