Method: DeepMiner::VectorMatrix#get_column

Defined in:
lib/deep_miner/vector_matrix.rb

#get_column(index, objectify = false) ⇒ Object



62
63
64
65
66
67
68
69
70
# File 'lib/deep_miner/vector_matrix.rb', line 62

def get_column(index, objectify = false)
  fail ArgumentError, 'Index must be in matrix bounds' if index < 0 || index > @m - 1
  column = []
  0.upto(@n - 1) do |i|
    column << @matrix[i][index]
  end
  return VectorMatrix.new(nil, nil, nil, [] << column) if objectify
  column
end