--predict_classifiers_to_feats

Switch

--predict_probabilities_to_feats

Description

Produces probabilites for each outcome class and writes the probability of the max encoded class into a SQL table.

Argument and Default Value

Feature name for the SQL table.

Details

Given a classification model (--load_model), this switch will predict probabilities on the groups given in the outcome table, for each class, and puts the probability of the max encoded class into a MySQL table. This is useful for a set of groups that you don't have the outcomes for, but you have a prediction model for it.

The table created will look like:

feat$p_modelType_ARGUMENT$message_table$group_id

where modelType is the first 4 letter of the model name. If you used rfc for instance, it will look like

feat$p_rfc_ARGUMENT$message_table$group_id.

Make sure the features are in the right order (i.e. the order they were put into when creating the model). A good place to check for that is the name of the pickle file (if you're using a pre:doc:fwflag_made picklefile, like those in here)

You need to make an output table that contains non null values for the outcomes & groups that you want probabilities for, cause it uses the --predict_classifiers code to run this, which is why it also outputs comparisons between the values in the outcome table and the predicted outcomes.

See Applying A Pickle Model for more details on applying pickled models.

Other Switches

Required Switches:

Example Commands

dlatkInterface.py -d dla_tutorial -t msgs -c user_id -f 'feat$cat_met_a30_2000_cp_w$msgs$user_id$1gra'  \
--outcome_table blog_outcomes --outcomes genderDummy \
--predict_probabilities_to_feats lbp_prob_gender  --load --picklefile \
~/gender.2000fbtopics.lr.pickle