Class: Weka::Core::Saver
- Inherits:
-
Object
- Object
- Weka::Core::Saver
- Defined in:
- lib/weka/core/saver.rb
Class Method Summary collapse
- .save_arff(file:, instances:) ⇒ Object
-
.save_c45(file:, instances:) ⇒ Object
Saves the given ‘instances` into a file with the given name and a *.data file in the same directory.
- .save_csv(file:, instances:) ⇒ Object
- .save_json(file:, instances:) ⇒ Object
Class Method Details
.save_arff(file:, instances:) ⇒ Object
9 10 11 |
# File 'lib/weka/core/saver.rb', line 9 def save_arff(file:, instances:) save_with(Converters::ArffSaver, file: file, instances: instances) end |
.save_c45(file:, instances:) ⇒ Object
Saves the given ‘instances` into a file with the given name and a *.data file in the same directory. The file with the given file name includes the instances’s attribute values, the *.data file holds the actual data.
Example:
Weka::Core::Saver.save_c45(
file: './path/to/example.names',
instances: instances
)
creates an example.names file and an example.data file in the ./path/to/ directory.
See: www.cs.washington.edu/dm/vfml/appendixes/c45.htm for more information about the C4.5 file format.
38 39 40 |
# File 'lib/weka/core/saver.rb', line 38 def save_c45(file:, instances:) save_with(Converters::C45Saver, file: file, instances: instances) end |
.save_csv(file:, instances:) ⇒ Object
13 14 15 |
# File 'lib/weka/core/saver.rb', line 13 def save_csv(file:, instances:) save_with(Converters::CSVSaver, file: file, instances: instances) end |
.save_json(file:, instances:) ⇒ Object
17 18 19 |
# File 'lib/weka/core/saver.rb', line 17 def save_json(file:, instances:) save_with(Converters::JSONSaver, file: file, instances: instances) end |