is an option for Classify and related functions that specifies explicit prior probabilities to assume for output classes, independent of anything deduced from the training set.
- ClassPriors<|class1p1,class2p2,…|> specifies that the prior probability to classify a particular input as being in class classi should be pi.
- By default, the class priors are computed from the class frequencies of the training set.
- In ClassPriors<|class1p1,class2p2,…|>, unspecified class priors will be set to their rescaled default value to ensure normalization of the distribution.
Examplesopen allclose all
Basic Examples (1)
Restrict the built-in language classifier to only two languages:
Train a classifier to recognize if an organism is diseased on a balanced training set:
Find the probability that a new organism is diseased:
Find the probability that the same organism is diseased, incorporating prior knowledge that diseased organisms represent only 1% of the population:
Train a classifier able to predict if a website user will buy a given item based on his behavior:
Define and visualize a model for the probability of buying the item as a function of the outside temperature:
Use this model and WeatherData to increase the prediction performance for a Parisian user, without additional training:
Wolfram Research (2014), ClassPriors, Wolfram Language function, https://reference.wolfram.com/language/ref/ClassPriors.html.
Wolfram Language. 2014. "ClassPriors." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ClassPriors.html.
Wolfram Language. (2014). ClassPriors. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ClassPriors.html