Sha256: ee24250bdb88d3b1525a06baf6f8ab11ca14cc359e48cdd6048817061ab8323a

Contents?: true

Size: 534 Bytes

Versions: 51

Compression:

Stored size: 534 Bytes

Contents

module EasyML
  module Splitters
    class BaseSplitter
      include ActiveModel::Validations
      include EasyML::Concerns::Configurable

      attr_reader :splitter

      def split(datasource, &block)
        datasource.in_batches do |df|
          split_df(df).tap do |splits|
            yield splits if block_given?
          end
        end
      end

      def split_df(df)
        df
      end

      def initialize(splitter)
        @splitter = splitter
      end

      delegate :dataset, to: :splitter
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
easy_ml-0.2.0.pre.rc31 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc30 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc29 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc28 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc27 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc26 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc25 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc24 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc23 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc22 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc21 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc20 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc19 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc18 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc17 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc16 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc15 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc14 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc13 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc12 app/models/easy_ml/splitters/base_splitter.rb