Class: Datasets::Iris
Defined Under Namespace
Classes: Record
Instance Attribute Summary
Attributes inherited from Dataset
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize ⇒ Iris
constructor
A new instance of Iris.
Methods inherited from Dataset
Constructor Details
#initialize ⇒ Iris
Returns a new instance of Iris.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/datasets/iris.rb', line 13 def initialize super() .id = "iris" .name = "Iris" .url = "https://archive.ics.uci.edu/ml/datasets/Iris" .licenses = ["CC-BY-4.0"] .description = lambda do read_names end end |
Instance Method Details
#each ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/datasets/iris.rb', line 24 def each return to_enum(__method__) unless block_given? open_data do |csv| csv.each do |row| next if row[0].nil? record = Record.new(*row) yield(record) end end end |