Package smile.io

Interface Write


public interface Write
Writes data to external storage systems.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static void
    arff(DataFrame data, Path path, String relation)
    Writes the data frame to an ARFF file.
    static void
    arrow(DataFrame data, Path path)
    Writes an Apache Arrow file.
    static void
    csv(DataFrame data, Path path)
    Writes a CSV file.
    static void
    csv(DataFrame data, Path path, org.apache.commons.csv.CSVFormat format)
    Writes a CSV file.
    static Path
    Writes an object to a temporary file and returns the path of file.
    static void
    Writes a serializable object to a file.
  • Method Details

    • object

      static Path object(Serializable o) throws IOException
      Writes an object to a temporary file and returns the path of file. The temporary file will be deleted when the VM exits.
      Parameters:
      o - the object to serialize.
      Returns:
      the path of temporary file.
      Throws:
      IOException - when fails to write the stream.
    • object

      static void object(Serializable o, Path path) throws IOException
      Writes a serializable object to a file.
      Parameters:
      o - the object to serialize.
      path - the file path.
      Throws:
      IOException - when fails to write the stream.
    • csv

      static void csv(DataFrame data, Path path) throws IOException
      Writes a CSV file.
      Parameters:
      data - the data frame.
      path - the output file path.
      Throws:
      IOException - when fails to write the file.
    • csv

      static void csv(DataFrame data, Path path, org.apache.commons.csv.CSVFormat format) throws IOException
      Writes a CSV file.
      Parameters:
      data - the data frame.
      path - the output file path.
      format - the CSV file format.
      Throws:
      IOException - when fails to write the file.
    • arrow

      static void arrow(DataFrame data, Path path) throws IOException
      Writes an Apache Arrow file. Apache Arrow is a cross-language development platform for in-memory data. It specifies a standardized language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware.
      Parameters:
      data - the data frame.
      path - the output file path.
      Throws:
      IOException - when fails to write the file.
    • arff

      static void arff(DataFrame data, Path path, String relation) throws IOException
      Writes the data frame to an ARFF file.
      Parameters:
      data - the data frame.
      path - the output file path.
      relation - the relation name of ARFF.
      Throws:
      IOException - when fails to write the file.