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.rc52 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc51 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc50 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc49 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc48 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc47 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc46 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc45 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc44 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc43 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc41 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc40 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc39 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc38 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc37 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc36 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc35 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc34 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc33 app/models/easy_ml/splitters/base_splitter.rb
easy_ml-0.2.0.pre.rc32 app/models/easy_ml/splitters/base_splitter.rb