Sha256: 34be3cb33f0a376f1eefa60a8d7db36a295d8490d8f3c9e7e8c9d19a7b6a56ff

Contents?: true

Size: 673 Bytes

Versions: 1

Compression:

Stored size: 673 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.values, sample.mean ]
        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

1 entries across 1 versions & 1 rubygems

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