sampleclean.activeml

ActiveLearningAlgorithm

abstract class ActiveLearningAlgorithm[M, A, C <: PointLabelingContext, G <: GroupLabelingContext] extends Serializable

An algorithm that uses active learning to iteratively train models on new labeled data.

M

model trained at each iteration

A

parameters for the model

C

point context for labeling new data

G

group context for labeling new data

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ActiveLearningAlgorithm
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ActiveLearningAlgorithm()

Abstract Value Members

  1. abstract def predict(model: M, point: Vector): Double

    Uses the model to predict a point's label.

    Uses the model to predict a point's label.

    model

    the trained model.

    point

    the point to predict.

    returns

    the predicted label.

  2. abstract def trainModel(data: RDD[LabeledPoint], parameters: A): M

    Trains a new model instance on the available data.

    Trains a new model instance on the available data.

    data

    training data for the model.

    parameters

    parameters for model training.

    returns

    the trained model.

Concrete 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. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  12. def getLabelsBlocking(pointsToLabel: RDD[(String, Vector, C)], crowdTask: CrowdTask[C, G, Double], groupContext: G, crowdTaskConfig: CrowdTaskConfiguration): RDD[(String, LabeledPoint)]

    Runs the crowd task to add labels to an RDD of unlabeled points.

    Runs the crowd task to add labels to an RDD of unlabeled points. Blocks until all points are labeled.

    pointsToLabel

    an RDD of unlabeled points.

    crowdTask

    the crowd task that will provide labels for the points (as Doubles).

    groupContext

    the group context for all of the points to show the crowd.

    crowdTaskConfig

    configuration for the crowd task.

    returns

    the original points with crowd labels added instead of context.

  13. def hashCode(): Int

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

    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  19. def toString(): String

    Definition Classes
    AnyRef → Any
  20. def train(labeledInput: RDD[(String, LabeledPoint)], unlabeledInput: RDD[(String, Vector, C)], groupContext: G, algParams: A, crowdTask: CrowdTask[C, G, Double], crowdTaskConfig: CrowdTaskConfiguration, pointSelector: ActivePointSelector[M, C]): ActiveLearningTrainingFuture[M]

    Trains a series of models, using uncertainty sampling to label new points for each new model.

    Trains a series of models, using uncertainty sampling to label new points for each new model.

    Specifically, this function:

    • bootstraps enough labels to train an initial model
    • selects a batch of new points to get labels for using uncertainty sampling
    • gets labels for the points asynchronously by sending them to the crowd
    • trains a new model with each new batch of labels.

    Uses default values for active learning framework parameters.

    labeledInput

    already labeled points. Each point is an (id, org.apache.spark.mllib.regression.LabeledPoint) tuple. Pass an empty RDD if there are no labeled points.

    unlabeledInput

    points without labels. Each point is an (id, feature vector, labeling context) tuple.

    groupContext

    context needed for labeling shared among all points.

    algParams

    parameters for training individual models.

    crowdTask

    crowd task for getting labels for unlabeled data.

    crowdTaskConfig

    configuration settings for running the crowd task.

    pointSelector

    point selector for picking the next points to label at each iteration.

    returns

    an ActiveLearningTrainingFuture, a future-like object with callbacks whenever new models are trained or new data is labeled.

  21. def train(labeledInput: RDD[(String, LabeledPoint)], unlabeledInput: RDD[(String, Vector, C)], groupContext: G, algParams: A, frameworkParams: ActiveLearningParameters, crowdTask: CrowdTask[C, G, Double], crowdTaskConfig: CrowdTaskConfiguration, pointSelector: ActivePointSelector[M, C]): ActiveLearningTrainingFuture[M]

    Trains a series of models, using active learning to label new points for each new model.

    Trains a series of models, using active learning to label new points for each new model.

    Specifically, this function:

    • bootstraps enough labels to train an initial model
    • selects a batch of new points to get labels for
    • gets labels for the points asynchronously by sending them to the crowd
    • trains a new model with each new batch of labels.
    labeledInput

    already labeled points. Each point is an (id, org.apache.spark.mllib.regression.LabeledPoint) tuple. Pass an empty RDD if there are no labeled points.

    unlabeledInput

    points without labels. Each point is an (id, feature vector, labeling context) tuple.

    groupContext

    context needed for labeling shared among all points.

    algParams

    parameters for training individual models.

    frameworkParams

    parameters for the active learning framework.

    crowdTask

    crowd task for getting labels for unlabeled data.

    crowdTaskConfig

    configuration settings for running the crowd task.

    pointSelector

    point selector for picking the next points to label at each iteration.

    returns

    an ActiveLearningTrainingFuture, a future-like object with callbacks whenever new models are trained or new data is labeled.

  22. def trainError(model: M, trainingData: RDD[LabeledPoint], trainN: Long): Double

    Classification Error on a training set.

    Classification Error on a training set.

    model

    a trained model.

    trainingData

    an RDD of org.apache.spark.mllib.regression.LabeledPoints used to train the model.

    trainN

    the size of trainingData.

    returns

    the fraction of training examples incorrectly classified by the model.

  23. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped