ActiveClassification
ActiveClassification[f,{conf1,conf2,…}]
gives an object representing the result of active classification obtained by using the function f to determine classes for the example configurations confi.
ActiveClassification[f,reg]
generates configurations within the region specified by reg.
ActiveClassification[f,sampler]
generates configurations by applying the function sampler.
ActiveClassification[f,{conf1,conf2,…}nsampler]
applies the function nsampler to successively generate configurations starting from one of the confi.
Details and Options
- ActiveClassification[…] returns an ActiveClassificationObject[…] whose properties can be obtained using ActiveClassificationObject[…]["prop"].
- Possible properties include:
-
"EvaluationHistory" configurations explored and classes assigned to them "Method" method used for active classification "ClassifierFunction" best ClassifierFunction[…] obtained "ClassifierMeasurementsObject" latest ClassifierMeasurementsObject[…] obtained "LearningCurve" plot of mean cross-entropy evolution "Properties" list of all available properties - Configurations can be of any form accepted by Classify (single data element, list of data elements, association of data elements, etc.) and of any type accepted by Classify (numerical, textual, sounds, images, etc.).
- When applied to a configuration conf, the output of the function f is interpreted as a label.
- In ActiveClassification[f,spec], spec defines the domain of the function f. A domain can be defined by a list of configurations, a geometric region or a configuration generator function.
- In ActiveClassification[f,sampler], sampler[] must output a configuration suitable for f to be applied to it.
- In ActiveClassification[f,{conf1,conf2,…}nsampler], nsampler[conf] must output a configuration.
- ActiveClassification has the same options as Classify, with the following additions and changes: [List of all options]
-
InitialEvaluationHistory None initial set of configurations and classes MaxIterations 2000 maximum number of iterations Method Automatic method used to determine configurations to query and the classification algorithm to use RandomSeeding 1234 what seeding of pseudorandom generators should be done internally - Possible settings for Method include:
-
Automatic automatically choose method "Randomized" choose random configurations from the domain "MaxEntropy" choose configurations for which the classifier has maximum uncertainty assoc association specifying the evaluation strategy and classification method - In the form Methodassoc, the association can have elements:
-
"EvaluationStrategy" method for determining which configurations to query "ClassificationMethod" method to use for classification - Possible settings for RandomSeeding include:
-
Automatic automatically reseed every time the function is called Inherited use externally seeded random numbers seed use an explicit integer or strings as a seed -
AcceptanceThreshold Automatic rarer-probability threshold for anomaly detector AnomalyDetector None anomaly detector used by the classifier ClassPriors Automatic explicit prior probabilities for classes FeatureExtractor Identity how to extract features from which to learn FeatureNames Automatic feature names to assign for input data FeatureTypes Automatic feature types to assume for input data IndeterminateThreshold 0 below what probability to return Indeterminate InitialEvaluationHistory None initial set of configurations and classes MaxIterations 2000 maximum number of iterations Method Automatic method used to determine configurations to query and the classification algorithm to use MissingValueSynthesis Automatic how to synthesize missing values PerformanceGoal Automatic aspects of performance to try to optimize RandomSeeding 1234 what seeding of pseudorandom generators should be done internally RecalibrationFunction Automatic how to post-process class probabilities TargetDevice "CPU" the target device on which to perform training TimeGoal Automatic how long to spend training the classifier TrainingProgressReporting Automatic how to report progress during training UtilityFunction Automatic utility as function of actual and predicted class ValidationSet Automatic the set of data on which to evaluate the model during training
List of all options
Examples
open allclose allBasic Examples (3)
Train an ActiveClassificationObject[…] to classify whether an integer is greater than 50:
Extract the resulting classifier:
Train a classification object with the domain defined by an interval:
Train a classification object to classify whether a matrix is positive semidefinite, with the domain defined by a configuration generator:
Scope (2)
Define a piecewise function with three possible output values:
Train a classification object to classify the possible outputs from the function, with the domain defined by a configuration generator:
Obtain the list of object properties:
Obtain the history of explored configurations:
Obtain the classifiers trained during the active classification, along with their properties:
Obtain the method used to choose configurations to add to the training set:
Display the performances of the classifiers trained during active classification:
Display the confusion matrix of the final classifier for a test set:
Define a function that checks whether a point belongs to a given region, then define a neighborhood configuration generator:
Train a classification object to classify whether a point is a member of a given region:
Display the confusion matrix of the classifier on a test set:
Options (3)
InitialEvaluationHistory (1)
Define a function that checks whether the ASCII character corresponding to an integer is a letter, then define a set of configurations:
Construct an initial training set:
Train a classification object to classify whether an integer corresponds to a letter by including the preceding information:
The examples in the first row in the training history now correspond to the initial training set:
MaxIterations (1)
Method (1)
Define a region composed of a number of subregions, and a function that tells whether the blood pressure corresponding to a point in the region is "Low", "Ideal" or "High":
Train a classification object by specifying the method:
The configurations are explored randomly, with the data generating distribution:
Specify a different method for active classification:
The algorithm now prefers to explore configurations near the boundaries where the model is more uncertain:
Specify the method as an association, choosing the evaluation strategy and the classification method:
Applications (3)
Grade Classifier (1)
Region Member Classifier (1)
Construct a geometric region corresponding to the map of the USA:
Define a function that tells whether a point lies inside this region:
Train a classification object for this function:
Obtain the corresponding classifier:
Plot the configurations explored during training. The density is higher close to the region boundary:
Program Choice Classifier (1)
Define two programs to compute the ManhattanDistance between two elements:
Define a function that selects the program that more quickly computes the ManhattanDistance between two elements constructed from the three integers:
Set the domain of the function via a configuration generator:
Train a classification object to classify which program is faster:
Display the accuracy and confusion matrix of the classifier on a test set:
Possible Issues (1)
Specifying the domain of the function via a neighborhood configuration generator requires care.
Define a function that checks whether a point belongs to the unit rectangle, then define a neighborhood configuration generator:
Active classification may not work properly if the initial configuration and neighborhood configuration generator are not chosen properly:
Text
Wolfram Research (2017), ActiveClassification, Wolfram Language function, https://reference.wolfram.com/language/ref/ActiveClassification.html (updated 2017).
CMS
Wolfram Language. 2017. "ActiveClassification." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/ActiveClassification.html.
APA
Wolfram Language. (2017). ActiveClassification. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ActiveClassification.html