Class: Core::Type::Instances::Base

Inherits:
Core::Type::Instances show all
Defined in:
lib/ruby-band/core/type/instances.rb

Overview

Class used for the creation of a new dataset (Instances class)

Instance Method Summary collapse

Methods inherited from Core::Type::Instances

#add_instance, #add_nominal_attribute, #add_numeric_attribute, #att, #check_array, #check_numeric_instance, #date, #dim, #each_column, #each_column_with_index, #each_row, #each_row_with_index, #mean, #merge_with, #n_col, #n_rows, #nominal, #numeric, #populate_by_row, #return_attr_data, #string, #summary, #to_ARFF, #to_Apache_matrix, #to_Apache_matrix_block, #to_CSV, #to_a2d, #to_json_format, #variance

Constructor Details

#initialize(&block) ⇒ Base

Returns a new instance of Base.



322
323
324
325
326
327
328
# File 'lib/ruby-band/core/type/instances.rb', line 322

def initialize(&block)
  attributes_vector = FastVector.new
  @positions = []
  self.instance_eval(&block) if block
  @positions.each {|value| attributes_vector.addElement(value)}
  super('Instances',attributes_vector,0)
end