Documentation of 'smile.data.parser.LibsvmParser' Java class
LibsvmParser
smile.data.parser

Class LibsvmParser



  • public class LibsvmParser
    extends java.lang.Object
    LIBSVM (and SVMLight) data parser. The format of libsvm file is:

    <label> <index1>:<value1> <index2>:<value2> ...

    where <label> is the target value of the training data. For classification, it should be an integer which identifies a class (multi-class classification is supported). For regression, it's any real number. For one-class SVM, it's not used so can be any number. <index> is an integer starting from 1, and <value> is a real number. The indices must be in an ascending order. The labels in the testing data file are only used to calculate accuracy or error. If they are unknown, just fill this column with a number.

    • Constructor Summary

      Constructors 
      Constructor and Description
      LibsvmParser()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      SparseDataset parse(java.io.File file)
      Parse a libsvm sparse dataset from given file.
      SparseDataset parse(java.lang.String path)
      Parse a libsvm sparse dataset from given file.
      SparseDataset parse(java.lang.String name, java.io.File file)
      Parse a libsvm sparse dataset from given file.
      SparseDataset parse(java.lang.String name, java.io.InputStream stream)
      Parse a libsvm sparse dataset from an input stream.
      SparseDataset parse(java.lang.String name, java.lang.String path)
      Parse a libsvm sparse dataset from given file.
      SparseDataset parse(java.lang.String name, java.net.URI uri)
      Parse a libsvm sparse dataset from given URI.
      SparseDataset parse(java.net.URI uri)
      Parse a libsvm sparse dataset from given URI.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LibsvmParser

        public LibsvmParser()
        Constructor.
    • Method Detail

      • parse

        public SparseDataset parse(java.net.URI uri)
                            throws java.io.IOException,
                                   java.text.ParseException
        Parse a libsvm sparse dataset from given URI.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public SparseDataset parse(java.lang.String name,
                                   java.net.URI uri)
                            throws java.io.IOException,
                                   java.text.ParseException
        Parse a libsvm sparse dataset from given URI.
        Parameters:
        uri - the URI of data source.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public SparseDataset parse(java.lang.String path)
                            throws java.io.IOException,
                                   java.text.ParseException
        Parse a libsvm sparse dataset from given file.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public SparseDataset parse(java.lang.String name,
                                   java.lang.String path)
                            throws java.io.IOException,
                                   java.text.ParseException
        Parse a libsvm sparse dataset from given file.
        Parameters:
        path - the file path of data source.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public SparseDataset parse(java.io.File file)
                            throws java.io.IOException,
                                   java.text.ParseException
        Parse a libsvm sparse dataset from given file.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public SparseDataset parse(java.lang.String name,
                                   java.io.File file)
                            throws java.io.IOException,
                                   java.text.ParseException
        Parse a libsvm sparse dataset from given file.
        Parameters:
        file - the file of data source.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public SparseDataset parse(java.lang.String name,
                                   java.io.InputStream stream)
                            throws java.io.IOException,
                                   java.text.ParseException
        Parse a libsvm sparse dataset from an input stream.
        Parameters:
        name - the name of dataset.
        stream - the input stream of data.
        Throws:
        java.io.IOException
        java.text.ParseException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.