Package

smile

io

Permalink

package io

I/O functions.

Linear Supertypes
Operators, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. io
  2. Operators
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. trait Operators extends AnyRef

    Permalink

    High level I/O operators.

Value Members

  1. def read(file: String): AnyRef

    Permalink

    Reads an object/model back from a file created by write command.

    Reads an object/model back from a file created by write command.

    Definition Classes
    Operators
  2. def readArff(file: String, responseIndex: Int = 1): AttributeDataset

    Permalink

    Reads an ARFF file.

    Reads an ARFF file.

    Definition Classes
    Operators
  3. def readBinarySparseData(file: String): BinarySparseDataset

    Permalink

    Reads binary sparse dataset.

    Reads binary sparse dataset. Each item is stored as an integer array, which are the indices of nonzero elements in ascending order

    Definition Classes
    Operators
  4. def readCsv(file: String, response: Option[(Attribute, Int)] = None, comment: String = "%", missing: String = "?", header: Boolean = false, rowNames: Boolean = false): AttributeDataset

    Permalink

    Reads a CSV file with response variable.

    Reads a CSV file with response variable.

    Definition Classes
    Operators
  5. def readGct(file: String): AttributeDataset

    Permalink

    Reads GCT microarray gene expression file.

    Reads GCT microarray gene expression file.

    Definition Classes
    Operators
  6. def readLibsvm(file: String): SparseDataset

    Permalink

    Reads a LivSVM file.

    Reads a LivSVM file.

    Definition Classes
    Operators
  7. def readPcl(file: String): AttributeDataset

    Permalink

    Reads PCL microarray gene expression file.

    Reads PCL microarray gene expression file.

    Definition Classes
    Operators
  8. def readRes(file: String): AttributeDataset

    Permalink

    Reads RES microarray gene expression file.

    Reads RES microarray gene expression file.

    Definition Classes
    Operators
  9. def readSparseData(file: String, arrayIndexOrigin: Int = 0): SparseDataset

    Permalink

    Reads spare dataset in coordinate triple tuple list format.

    Reads spare dataset in coordinate triple tuple list format. Coordinate file stores a list of (row, column, value) tuples:

    instanceID attributeID value
    instanceID attributeID value
    instanceID attributeID value
    instanceID attributeID value
    ...
    instanceID attributeID value
    instanceID attributeID value
    instanceID attributeID value

    Ideally, the entries are sorted (by row index, then column index) to improve random access times. This format is good for incremental matrix construction.

    Optionally, there may be 2 header lines

    D    // The number of instances
    W    // The number of attributes

    or 3 header lines

    D    // The number of instances
    W    // The number of attributes
    N    // The total number of nonzero items in the dataset.

    These header lines will be ignored.

    file

    the file path.

    arrayIndexOrigin

    the starting index of array. By default, it is 0 as in C/C++ and Java. But it could be 1 to parse data produced by other programming language such as Fortran.

    Definition Classes
    Operators
  10. def readSparseMatrix(file: String): SparseMatrix

    Permalink

    Reads Harwell-Boeing column-compressed sparse matrix.

    Reads Harwell-Boeing column-compressed sparse matrix.

    Definition Classes
    Operators
  11. def readTable(file: String, response: Option[(Attribute, Int)] = None, delimiter: String = "\\s+", comment: String = "%", missing: String = "?", header: Boolean = false, rowNames: Boolean = false): AttributeDataset

    Permalink

    Reads a delimited text file with response variable.

    Reads a delimited text file with response variable. By default, the parser expects a white-space-separated-values file. Each line in the file corresponds to a row in the table. Within a line, fields are separated by white spaces, each field belonging to one table column. This class can also be used to read other text tabular files by setting delimiter character such ash ','. The file may contain comment lines (starting with '%') and missing values (indicated by placeholder '?').

    file

    the file path

    response

    optional response variable attribute and the column index of response variable. The column index starts at 0.

    delimiter

    delimiter string

    comment

    the start of comment lines

    missing

    the missing value placeholder

    header

    true if the first row is header/column names

    rowNames

    true if the first column is row id/names

    returns

    an attribute dataset

    Definition Classes
    Operators
  12. def readTxt(file: String): AttributeDataset

    Permalink

    Reads TXT microarray gene expression file.

    Reads TXT microarray gene expression file. The TXT format is a tab delimited file format that describes an expression dataset. It is organized as follows:

    The first line contains the labels Name and Description followed by the identifiers for each sample in the dataset. The Description is optional.

    Line format:

    Name(tab)Description(tab)(sample 1 name)(tab)(sample 2 name) (tab) ... (sample N name)

    Example:

    Name Description DLBC1_1 DLBC2_1 ... DLBC58_0

    The remainder of the file contains data for each of the genes. There is one line for each gene. Each line contains the gene name, gene description, and a value for each sample in the dataset. If the first line contains the Description label, include a description for each gene. If the first line does not contain the Description label, do not include descriptions for any gene. Gene names and descriptions can contain spaces since fields are separated by tabs.

    Line format:

    (gene name) (tab) (gene description) (tab) (col 1 data) (tab) (col 2 data) (tab) ... (col N data)

    Example:

    AFFX-BioB-5_at AFFX-BioB-5_at (endogenous control) -104 -152 -158 ... -44
    Definition Classes
    Operators
  13. def readWavefrontObj(file: String): (Array[Array[Double]], Array[Array[Int]])

    Permalink

    Reads a Wavefront OBJ file.

    Reads a Wavefront OBJ file. The OBJ file format is a simple format of 3D geometry including the position of each vertex, the UV position of each texture coordinate vertex, vertex normals, and the faces that make each polygon defined as a list of vertices, and texture vertices. Vertices are stored in a counter-clockwise order by default, making explicit declaration of face normals unnecessary. OBJ coordinates have no units, but OBJ files can contain scale information in a human readable comment line.

    Note that we parse only vertex and face elements. All other information ignored.

    file

    the file path

    returns

    a tuple of vertex array and edge array.

    Definition Classes
    Operators
  14. def write[T <: AnyRef](x: T, file: String): Unit

    Permalink

    Writes an object/model to a file.

    Writes an object/model to a file.

    Definition Classes
    Operators

Inherited from Operators

Inherited from AnyRef

Inherited from Any

Ungrouped