"NameAge" (Built-in Predictor)
Examples
open all close allBasic Examples (2)
Use the built-in predictor "NameAge" to predict the age of a person from their first name:
Predict["NameAge", "Tom"]Obtain a PredictorFunction for this predictor:
p = Predict["NameAge"]Use the predictor function to predict the age of a person from their first name:
p["Stacy"]Predict many examples at once:
p[ {"Tom", "Stacy", "Claire"}]Scope (2)
Visualize the distribution of the age for a given name:
distribution = Predict["NameAge", "Claire", "Distribution"]Plot[PDF[distribution, x], {x, 0, 100}, Exclusions -> None, PlotRange -> All]The most likely value of this distribution is the following:
Predict["NameAge", "Claire"]Load the PredictorFunction corresponding to the built-in predictor:
p = Predict["NameAge"]Obtain information about the predictor from Information:
Information[p]Options (2)
IndeterminateThreshold (1)
Use a custom IndeterminateThreshold after loading the PredictorFunction:
p = Predict["NameAge"]p["Stacy", IndeterminateThreshold -> 0.6]Update the value of the threshold in the predictor:
p["Stacy", IndeterminateThreshold -> 0]UtilityFunction (1)
Obtain the utility function of the predictor that corresponds to a DiracDelta function:
utility = Information[Predict["NameAge"], "UtilityFunction"]This means by default, the value with the highest probability density is predicted:
Predict["NameAge", "Claire"]Change the utility function to predict the mean value instead of the most likely value:
Predict["NameAge", "Claire", UtilityFunction -> Function[-(#2 - #1) ^ 2], IndeterminateThreshold -> 0]