lib/refining/file.rb
# Load a file into the dataset
#
# @author Joel Azemar
#
# @return [Array] The dataset
Load a file into the dataset
Load a file into the dataset
def load
      csv_source = CSV.parse(::File.open(file_path).read)
      @original_headers = csv_source.shift 
      csv_source.map do |row|
        Row.new(
          id: row[0],
          original_value: row[1],
          value: row[2],
          distance: row[3],
          rank: row[4],
          extra_values: row[6..row.length]
        )
      end
    end
def load csv_source = CSV . parse ( :: File . open ( file_path ) . read ) @original_headers = csv_source . shift csv_source . map do | row | Row . new ( id : row [ 0 ] , original_value : row [ 1 ] , value : row [ 2 ] , distance : row [ 3 ] , rank : row [ 4 ] , extra_values : row [ 6 .. row . length ] ) end end
Load a file into the dataset
Load a file into the dataset
# remove headers
None
Array
author
None