Sha256: c68d0c29e7618ba218b1ea88d62af17897739cb95f47958c3d9cc59b04446f6b

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

require "flex_station_data/presenters/sample_csv"
require "flex_station_data/presenters/linear_regression/sample_regression_hash"

module FlexStationData
  module Presenters
    module LinearRegression
      class VerboseSampleCsv < Presenters::SampleCsv
        include Concerns::Presenter

        def sample_values
          [ *sample.readings, sample.mean ].map(&:values)
        end

        def regressions_hash
          SampleRegressionHash.present(times, *sample_values, **options)
        end

        def regressions_csv
          regressions_hash.to_a.map(&:flatten)
        end

        def values_csv
          super + regressions_csv
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flex-station-data-0.3.1 lib/flex_station_data/presenters/linear_regression/verbose_sample_csv.rb
flex-station-data-0.3.0 lib/flex_station_data/presenters/linear_regression/verbose_sample_csv.rb