Model One Syst

class simple_one_syst_model.model.Model(get_train_set=None, systematics=None)

Bases: object

This is a model class to be submitted by the participants in their submission.

Atributes:
  • get_train_set (callable): A function that returns a dictionary with data, labels, weights, detailed_labels and settings.

  • systematics (object): A function that can be used to get a dataset with systematics added.

  • model (object): The model object.

  • name (str): The name of the model.

  • stat_analysis (object): The statistical analysis object.

Methods:
  • fit(): Trains the model.

  • predict(test_set): Predicts the values for the test set.

fit()

Trains the model.

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.

Args:
  • test_set (dict): A dictionary containing the 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_one_syst_model.model.balance_set(training_set)

Balances the training set by equalizing the number of background and signal events.

Args:

training_set (dict): A dictionary containing the data, labels, weights, detailed_labels, and settings.

Returns:

dict: A dictionary containing the balanced training set.

simple_one_syst_model.model.train_test_split(data_set, test_size=0.2, random_state=42, reweight=False)

Splits the data into training and testing sets.

Args:
  • data_set (dict): A dictionary containing the data, labels, weights, detailed_labels, and settings

  • test_size (float, optional): The size of the testing set. Defaults to 0.2.

  • random_state (int, optional): The random state. Defaults to 42.

  • reweight (bool, optional): Whether to reweight the data. Defaults to False.

Returns:

tuple: A tuple containing the training and testing