You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I kept receiving the following error when computing meta-features in my dataset:
site-packages/pymfe/_internal.py:1568: UserWarning: It is not possible make equal discretization
warnings.warn("It is not possible make equal discretization")
At first, thought this happens because my dataset exhibits class imbalance, to a generate pseudo data, having class class proportion matching the dataset, like so:
I understand this got to do with _equal_freq_discretization(), precisely:
def _equal_freq_discretization(
data: np.ndarray, num_bins: int, tol: float = 1e-8
) -> np.ndarray:
"""Discretize a 1-D numeric array into an equal-frequency histogram."""
hist_divs = np.quantile(data, np.linspace(0, 1, num_bins + 1)[1:])
# Sometimes the 'hist_divs' is not appropriated.
# For example when all values are constants. It implies in 'hist_divs'
# repetitive values.
# To avoid partitions with the same value, we check if all partitions are
# different. Unfortunately, it leads to a non-equal frequency
# discretization.
prev_size = hist_divs.size
hist_divs = hist_divs[np.append(True, np.diff(hist_divs) > tol)]
if prev_size != hist_divs.size:
warnings.warn("It is not possible make equal discretization")
hist_divs = np.unique(hist_divs)
return np.digitize(x=data, bins=hist_divs, right=True)
But I cannot understand what's causing the warning (if I can avoid it), otherwise how would it affect final result?
The text was updated successfully, but these errors were encountered:
I kept receiving the following error when computing meta-features in my dataset:
At first, thought this happens because my dataset exhibits class imbalance, to a generate pseudo data, having class class proportion matching the dataset, like so:
This works fine, without that warning.
I understand this got to do with
_equal_freq_discretization()
, precisely:But I cannot understand what's causing the warning (if I can avoid it), otherwise how would it affect final result?
The text was updated successfully, but these errors were encountered: