class Matrix

Public Instance Methods

add_ones() click to toggle source
# File lib/aprendizaje_maquina/matrixx.rb, line 2
def add_ones
        matrix = self.to_a.map{ |i| i.insert(0,1) }
        matrix = Matrix.rows(matrix,copy = true)
        matrix
end
normalize() click to toggle source
# File lib/aprendizaje_maquina/matrixx.rb, line 8
def normalize
        array = []
        self.column_count.times do |i|
                array << self.column(i).normalize
        end
        matrix_normal = Matrix.rows(array,copy = true).transpose
        matrix_normal
end