asreview.models.balance.DoubleBalance

class asreview.models.balance.DoubleBalance(a=2.155, alpha=0.94, b=0.789, beta=1.0, random_state=None)[source]

Double balance strategy (double).

Class to get the two way rebalancing function and arguments. It super samples ones depending on the number of 0’s and total number of samples in the training data.

Parameters:
  • a (float) – Governs the weight of the 1’s. Higher values mean linearly more 1’s in your training sample.

  • alpha (float) – Governs the scaling the weight of the 1’s, as a function of the ratio of ones to zeros. A positive value means that the lower the ratio of zeros to ones, the higher the weight of the ones.

  • b (float) – Governs how strongly we want to sample depending on the total number of samples. A value of 1 means no dependence on the total number of samples, while lower values mean increasingly stronger dependence on the number of samples.

  • beta (float) – Governs the scaling of the weight of the zeros depending on the number of samples. Higher values means that larger samples are more strongly penalizing zeros.

Attributes

default_param

Get the default parameters of the model.

label

name

param

Get the (assigned) parameters of the model.

Methods

full_hyper_space()

hyper_space()

sample(X, y, train_idx)

Resample the training data.