Class: Glymour::Statistics::VariableContainer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, variables = []) ⇒ VariableContainer

Returns a new instance of VariableContainer.



7
8
9
10
11
12
13
14
15
16
# File 'lib/stats_module.rb', line 7

def initialize(table, variables=[])
  number_unnamed = 0
  @table = table
  @variables = variables
  @variables.each do |var|
    var.variable_container = self
    var.set_intervals if var.num_classes
    var.name ||= "unnamed_variable#{number_unnamed += 1}"
  end
end

Instance Attribute Details

#number_unnamedObject (readonly)

Returns the value of attribute number_unnamed.



4
5
6
# File 'lib/stats_module.rb', line 4

def number_unnamed
  @number_unnamed
end

#tableObject (readonly)

Returns the value of attribute table.



4
5
6
# File 'lib/stats_module.rb', line 4

def table
  @table
end

#variablesObject

Returns the value of attribute variables.



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

def variables
  @variables
end