edu.arizona.sista.learning

RFClassifier

Related Docs: object RFClassifier | package learning

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

An in-house implementation of random forests User: mihais Date: 11/23/15

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
Learn more about member selection
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)

Value Members

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

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

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

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

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

    Constructs a single decision tree from the given dataset sample

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

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

    Returns the argmax for this datum

    Returns the argmax for this datum

    Definition Classes
    RFClassifierClassifier
  8. def clone(): AnyRef

    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])]]

    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]]

    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

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

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

    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]

    Computes the utility of the given feature

  15. def finalize(): Unit

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

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

    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]

    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]

    Computes IG for a given feature and threshold

  20. final def isInstanceOf[T0]: Boolean

    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]

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

    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]

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

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

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

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

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

  28. def prune(tree: RFTree): RFTree

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

    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]

    Randomly picks selectedFeats features between 0 ..

    Randomly picks selectedFeats features between 0 .. numFeats

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

  32. def saveTo(writer: Writer): Unit

    Saves to writer.

    Saves to writer. Does NOT close the writer

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

    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]

    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

    Definition Classes
    AnyRef
  36. def toString(): String

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

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

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

    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

    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

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

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

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

  44. var verbose: Boolean

  45. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Classifier[L, F]

Inherited from AnyRef

Inherited from Any

Ungrouped