Class: Datasets::Adult
Defined Under Namespace
Classes: Record
Instance Attribute Summary
Attributes inherited from Dataset
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(type: :train) ⇒ Adult
constructor
A new instance of Adult.
Methods inherited from Dataset
Constructor Details
#initialize(type: :train) ⇒ Adult
Returns a new instance of Adult.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/datasets/adult.rb', line 25 def initialize(type: :train) unless [:train, :test].include?(type) raise ArgumentError, 'Please set type :train or :test' end super() @type = type @metadata.id = "adult-#{@type}" @metadata.name = "Adult: #{@type}" @metadata.url = "https://archive.ics.uci.edu/ml/datasets/adult" @metadata.licenses = ["CC-BY-4.0"] @metadata.description = lambda do read_names end end |