Predict¶
-
class
jamie.predict.
Bootstrap
(random_state, n=1000)¶ Get bootstrap means and confidence intervals from a sample.
- Parameters
-
sample
(array)¶ Get bootstrap samples from array.
- Parameters
array (array-like) – Sample to perform bootstrap on
- Returns
dict – Dictionary containing probability, lower_ci, upper_ci (95% confidence intervals).
-
class
jamie.predict.
Predict
(model_snapshot, random_state=0, bootstrap_size=1000)¶ Predict job classification using saved model snapshots.
- Parameters
model_snapshot (
jamie.snapshots.ModelSnapshot
) – Model snapshot to use for predictionrandom_state (int, default=0) – Random state, passed to
Bootstrap
instancebootstrap_size (int, default=1000) – Number of bootstrap draws, passed to
Bootstrap
instance
-
property
dataframe
¶ Returns predictions as pd.DataFrame
-
predict
(save=True, skip_existing=True)¶ Record predictions in MongoDB
- Parameters
save (bool, default=True) – Whether to save results in model snapshot folder, on by default. Results are always saved in the MongoDB instance
skip_existing (bool, default=True) – Whether to skip existing predictions or overwrite them. You can set this to False to force prediction of the entire dataset. Note that different model snapshots correspond to different prediction snapshots.
- Returns
self (
Predict
) – Returns copy of itself
-
save
(output=None)¶ Save predictions in prediction snapshot folder