nak

NakContext

object NakContext

An object that provides common functions needed for using Nak.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. NakContext
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def condense(features: Seq[FeatureObservation[Int]]): Seq[FeatureObservation[Int]]

    Given a sequence of feature observations (a feature and its magnitude), combine multiple instances of the same feature, and then sort the result.

    Given a sequence of feature observations (a feature and its magnitude), combine multiple instances of the same feature, and then sort the result.

    E.g. Seq[("foo",1.0),("bar",1.0),("foo",2.0)] becomes Seq[("bar",1.0),("foo",3.0)]

  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def fromCsvFile(filename: String): Iterator[Example[String, Seq[FeatureObservation[String]]]]

    Convert examples stored in CSV format (one per line) into a sequence of Examples.

  13. def fromLabeledDirs(topdir: File)(implicit codec: Codec): Iterator[Example[String, String]]

    Convert examples that are stored as files in directories, where each directory name acts as the label for all the files it contains.

    Convert examples that are stored as files in directories, where each directory name acts as the label for all the files it contains. (E.g. the 20 News Groups data.)

  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. def loadClassifier[C <: Classifier](filename: String): C

    Read a classifier from disk by using Java deserialization.

  18. def loadClassifierFromResource[C <: Classifier](resource: String): C

    Read a classifier from the classpath using Java deserialization.

  19. def maxLabel(labels: Seq[String])(scores: Seq[Double]): String

    Given the labels and scores that have been produced for each, return the label with the highest score.

  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def saveClassifier(classifier: Classifier, filename: String): Unit

    Save a classifier to disk by using Java serialization.

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toString(): String

    Definition Classes
    AnyRef → Any
  26. def trainBinomialClassifier[I](config: LiblinearConfig, featurizer: Featurizer[I, String], rawExamples: Seq[Example[(Int, Int), I]]): IndexedClassifier[String] with FeaturizedClassifier[String, I]

  27. def trainBinomialModel(config: LiblinearConfig, examples: TraversableOnce[Example[(Int, Int), Seq[FeatureObservation[Int]]]], numFeatures: Int): Model

  28. def trainClassifier(config: LiblinearConfig, examples: TraversableOnce[Example[Int, Seq[FeatureObservation[Int]]]], lmap: Map[String, Int], fmap: Map[String, Int]): IndexedClassifier[String]

    Trains a classifier given indexed examples and the label and feature maps produced by indexation.

  29. def trainClassifier[I](config: LiblinearConfig, featurizer: Featurizer[I, String], rawExamples: Seq[Example[String, I]]): IndexedClassifier[String] with FeaturizedClassifier[String, I]

    Trains a classifier given examples and featurizer.

    Trains a classifier given examples and featurizer. Handles indexation of features, and creates a classifier that can be applied directly to new raw observations.

    This is the easiest way to build and use a classifier.

  30. def trainClassifierHashed[I](config: LiblinearConfig, featurizer: Featurizer[I, String], rawExamples: Seq[Example[String, I]], maxNumberOfFeatures: Int = 10000): IndexedClassifier[String] with FeaturizedClassifier[String, I]

    Trains a classifier given examples and featurizer.

    Trains a classifier given examples and featurizer. Uses the hashing trick for indexing features, and creates a classifier that can be applied directly to new raw observations.

    This is the easiest way to build and use a classifier that uses the hashing trick. For more details on the hashing trick, see: http://hunch.net/~jl/projects/hash_reps/index.html

  31. def trainModel(config: LiblinearConfig, examples: TraversableOnce[Example[Int, Seq[FeatureObservation[Int]]]], numFeatures: Int): Model

    Trains a liblinear model given indexed examples.

    Trains a liblinear model given indexed examples. Note: a model is basically just the parameters. The classifiers returned by trainClassifier methods wrap the parameters into a number of convenience methods that makes it easier to use the model.

  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped