Simple Stat Only Model
- class simple_stat_only_model.model.Model(get_train_set=None, systematics=None)
Bases:
object
- fit()
Trains the model.
- Params:
None
- Functionality:
This function can be used to train a model. If re_train is True, it balances the dataset, fits the model using the balanced dataset, and saves the model. If re_train is False, it loads the saved model and calculates the saved information. The saved information is used to compute the train results.
- Returns:
None
- predict(test_set)
Predicts the values for the test set.
- Parameters:
test_set (dict): A dictionary containing the test data, and weights.
- Returns:
dict: A dictionary with the following keys: * ‘mu_hat’: The predicted value of mu. * ‘delta_mu_hat’: The uncertainty in the predicted value of mu. * ‘p16’: The lower bound of the 16th percentile of mu. * ‘p84’: The upper bound of the 84th percentile of mu.
- simple_stat_only_model.model.calculate_saved_info(model, train_set)
- simple_stat_only_model.model.compute_mu(score, weight, saved_info)
- simple_stat_only_model.model.train_test_split(data_set, test_size=0.2, random_state=42, reweight=False)