Module: Unsupervised_Util

Instance Method Summary collapse

Instance Method Details

#data(instances) ⇒ Object


15
16
17
18
# File 'lib/ruby-band/weka/filters/unsupervised/unsupervised_utils.rb', line 15

def data(instances)
  setInputFormat(instances)
  @input = instances
end

#descriptionObject


20
21
22
# File 'lib/ruby-band/weka/filters/unsupervised/unsupervised_utils.rb', line 20

def description
  globalInfo
end

#filter_options(options_string) ⇒ Object


10
11
12
13
# File 'lib/ruby-band/weka/filters/unsupervised/unsupervised_utils.rb', line 10

def filter_options(options_string)
  options = Utils.splitOptions(options_string)
  setOptions(options)
end

#options_listObject

Instance methods list


6
7
8
# File 'lib/ruby-band/weka/filters/unsupervised/unsupervised_utils.rb', line 6

def options_list
  listOptions.map {|key| "#{key.synopsis} #{key.description}"}.join("\n")
end

#set(&block) ⇒ Object


33
34
35
# File 'lib/ruby-band/weka/filters/unsupervised/unsupervised_utils.rb', line 33

def set(&block)
  self.instance_eval(&block)
end

#use(*args) ⇒ Object

*args is an optional Instances data object


25
26
27
28
29
30
31
# File 'lib/ruby-band/weka/filters/unsupervised/unsupervised_utils.rb', line 25

def use(*args)
  if args[0]
    Filter.useFilter(args[0],self)
  else
    Filter.useFilter(@input,self)
  end
end