Class/Object

org.clulab.learning

RFClassifier

Related Docs: object RFClassifier | package learning

Permalink

class RFClassifier[L, F] extends Classifier[L, F] with Serializable

An in-house implementation of random forests User: mihais Date: 11/23/15 Last Modified: Update for Scala 2.12: fork join changes.

Linear Supertypes
Serializable, Classifier[L, F], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RFClassifier
  2. Serializable
  3. Classifier
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RFClassifier(numTrees: Int = 100, maxTreeDepth: Int = 20, trainBagPct: Double = 0.66, utilityTooSmallThreshold: Double = 0, splitTooSmallPct: Double = 0.0, numThreads: Int = 0, howManyFeaturesPerNode: (Int) ⇒ Int = RFClassifier.featuresPerNodeSqrt, nilLabel: Option[L] = None)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def buildTree(job: RFJob[L, F]): RFTree

    Permalink

    Constructs a single decision tree from the given dataset sample

  6. def buildTreeMain(job: RFJob[L, F]): RFTree

    Permalink
  7. def classOf(d: Datum[L, F]): L

    Permalink

    Returns the argmax for this datum

    Returns the argmax for this datum

    Definition Classes
    RFClassifierClassifier
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def computeContingencyTables(job: RFJob[L, F], features: Array[Int]): Array[Array[(Counter[Int], Counter[Int])]]

    Permalink

    Computes the contingency tables for all given features and dataset partition For each feature and possible threshold (hence the double array), we store a distribution of datum labels that are <= than the threshold (_1 in the tuple), or larger than the threshold (_2 in the tuple) This method does not consider 0 values! See updateContingencyTables for that.

  10. def computeFeatureThresholds(dataset: CounterDataset[L, F]): Array[Array[Double]]

    Permalink

    Computes the value thresholds for all features in this dataset

    Computes the value thresholds for all features in this dataset

    dataset

    The dataset

    returns

    An array of thresholds (Double) for each feature in the dataset; feature indices are used for indexing

  11. def debugUtility(utility: Utility, job: RFJob[L, F]): Unit

    Permalink
  12. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def featureUtility(feature: Int, thresholds: Array[Double], contingencyTables: Array[(Counter[Int], Counter[Int])], activeNodes: Set[(Int, Double)], currentUtility: Double): Option[Utility]

    Permalink

    Computes the utility of the given feature

  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  18. def informationGain(feature: Int, thresholds: Array[Double], contingencyTables: Array[(Counter[Int], Counter[Int])], activeNodes: Set[(Int, Double)], currentEntropy: Double): Option[Utility]

    Permalink

    Computes the utility of the given feature using information gain

  19. def informationGainForThreshold(feature: Int, threshold: Double, contingencyTable: (Counter[Int], Counter[Int]), currentEntropy: Double): Option[Utility]

    Permalink

    Computes IG for a given feature and threshold

  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. def mkBag(dataset: CounterDataset[L, F], indices: Array[Int], thresholds: Array[Array[Double]], trainIndicesLength: Int, entropy: Double, random: Random, offset: Int): RFJob[L, F]

    Permalink
  22. def mkLeftJob(job: RFJob[L, F], feature: Int, threshold: Double, entropy: Double, activeNodes: Set[(Int, Double)]): RFJob[L, F]

    Permalink

    Constructs a job from the datums containing values of this feature smaller or equal than the threshold

  23. def mkRightJob(job: RFJob[L, F], feature: Int, threshold: Double, entropy: Double, activeNodes: Set[(Int, Double)]): RFJob[L, F]

    Permalink

    Constructs a job from the datums containing values of this feature larger than the threshold

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

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. def printContingencyTables(tables: Array[Array[(Counter[Int], Counter[Int])]], thresholds: Array[Array[Double]]): Unit

    Permalink
  28. def prune(tree: RFTree): RFTree

    Permalink
  29. def quantiles(values: Counter[Double], binCount: Int): Array[Double]

    Permalink

    Computes binCount-1 quantile values, such that the sequence of values is split into binCount bins

  30. def randomFeatureSelection(presentFeatures: Set[Int], numFeats: Int, random: Random): Array[Int]

    Permalink

    Randomly picks selectedFeats features between 0 ..

    Randomly picks selectedFeats features between 0 .. numFeats

  31. def sameLabels(job: RFJob[L, F]): Boolean

    Permalink
  32. def saveTo(writer: Writer): Unit

    Permalink

    Saves to writer.

    Saves to writer. Does NOT close the writer

    Definition Classes
    RFClassifierClassifier
  33. def saveTo(fileName: String): Unit

    Permalink

    Saves the current model to a file

    Saves the current model to a file

    Definition Classes
    Classifier
  34. def scoresOf(d: Datum[L, F]): Counter[L]

    Permalink

    Returns the scores of all possible labels for this datum Convention: if the classifier can return probabilities, these must be probabilities

    Returns the scores of all possible labels for this datum Convention: if the classifier can return probabilities, these must be probabilities

    Definition Classes
    RFClassifierClassifier
  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  37. def train(dataset: CounterDataset[L, F], indices: Array[Int]): Unit

    Permalink

    Trains a classifier using a CounterDataset (better to compute feature utility)

  38. def train(dataset: Dataset[L, F], indices: Array[Int]): Unit

    Permalink

    Trains a classifier, using only the datums specified in indices indices is useful for bagging

    Trains a classifier, using only the datums specified in indices indices is useful for bagging

    Definition Classes
    RFClassifierClassifier
  39. def train(dataset: Dataset[L, F], spans: Option[Iterable[(Int, Int)]] = None): Unit

    Permalink

    Trains the classifier on the given dataset spans is useful during cross validation

    Trains the classifier on the given dataset spans is useful during cross validation

    Definition Classes
    Classifier
  40. var treeCount: Int

    Permalink
  41. var trees: Option[Array[RFTree]]

    Permalink
  42. def updateContingencyTables(tables: Array[(Counter[Int], Counter[Int])], label: Int, fv: Double, thresholds: Array[Double]): Unit

    Permalink
  43. def updateContingencyTables(features: Array[Int], contingencyTables: Array[Array[(Counter[Int], Counter[Int])]], overallLabels: Counter[Int]): Unit

    Permalink
  44. var verbose: Boolean

    Permalink
  45. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Classifier[L, F]

Inherited from AnyRef

Inherited from Any

Ungrouped