Class: EasyML::Data::Dataset::Splits::Split

Inherits:
Object
  • Object
show all
Includes:
Utils, GlueGun::DSL
Defined in:
lib/easy_ml/data/dataset/splits/split.rb

Direct Known Subclasses

FileSplit, InMemorySplit

Instance Method Summary collapse

Methods included from Utils

#append_to_csv, #expand_dir, #null_check

Instance Method Details

#cleanupObject

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/easy_ml/data/dataset/splits/split.rb', line 35

def cleanup
  raise NotImplementedError, "Subclasses must implement #cleanup"
end

#read(segment, split_ys: false, target: nil, drop_cols: [], &block) ⇒ Object

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/easy_ml/data/dataset/splits/split.rb', line 19

def read(segment, split_ys: false, target: nil, drop_cols: [], &block)
  raise NotImplementedError, "Subclasses must implement #read"
end

#save(segment, df) ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/easy_ml/data/dataset/splits/split.rb', line 15

def save(segment, df)
  raise NotImplementedError, "Subclasses must implement #save"
end

#split_atObject

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/easy_ml/data/dataset/splits/split.rb', line 39

def split_at
  raise NotImplementedError, "Subclasses must implement #split_at"
end

#test(&block) ⇒ Object



27
28
29
# File 'lib/easy_ml/data/dataset/splits/split.rb', line 27

def test(&block)
  read(:test, &block)
end

#train(&block) ⇒ Object



23
24
25
# File 'lib/easy_ml/data/dataset/splits/split.rb', line 23

def train(&block)
  read(:train, &block)
end

#valid(&block) ⇒ Object



31
32
33
# File 'lib/easy_ml/data/dataset/splits/split.rb', line 31

def valid(&block)
  read(:valid, &block)
end