sberbank-ai-lab / LightAutoML

LAMA - automatic model creation framework
Apache License 2.0
893 stars 92 forks source link

report deco error #99

Open raijinspecial opened 2 years ago

raijinspecial commented 2 years ago

Hi, thanks as always for this great library! I keep running into an issue when trying to use the report decorator:

---------------------------------------------------------------------------
UFuncTypeError Traceback (most recent call last)
in
----> 1 oof_pred2 = rml.fit_predict(bldf[ucols],
2 #log_file = f'{target}_log.log',
3 roles = roles,
4 verbose = 1,
5 )

~/.conda/envs/mamba/lib/python3.9/site-packages/lightautoml/report/report_deco.py in fit_predict(self, *args, **kwargs)
701 # generate train data section
702 self._train_data_overview = self._data_genenal_info(train_data)
--> 703 self._describe_roles(train_data)
704 self._describe_dropped_features(train_data)
705 self._generate_train_set_section()

~/.conda/envs/mamba/lib/python3.9/site-packages/lightautoml/report/report_deco.py in _describe_roles(self, train_data)
972 values = train_data[feature_name].dropna().values
973 item["min"] = np.min(values)
--> 974 item["quantile_25"] = np.quantile(values, 0.25)
975 item["average"] = np.mean(values)
976 item["median"] = np.median(values)

<__array_function__ internals> in quantile(*args, **kwargs)

~/.conda/envs/mamba/lib/python3.9/site-packages/numpy/lib/function_base.py in quantile(a, q, axis, out, overwrite_input, interpolation, keepdims)
3977 if not _quantile_is_valid(q):
3978 raise ValueError("Quantiles must be in the range [0, 1]")
-> 3979 return _quantile_unchecked(
3980 a, q, axis, out, overwrite_input, interpolation, keepdims)
3981

~/.conda/envs/mamba/lib/python3.9/site-packages/numpy/lib/function_base.py in _quantile_unchecked(a, q, axis, out, overwrite_input, interpolation, keepdims)
3984 interpolation='linear', keepdims=False):
3985 """Assumes that q is in [0, 1], and is an ndarray"""
-> 3986 r, k = _ureduce(a, func=_quantile_ureduce_func, q=q, axis=axis, out=out,
3987 overwrite_input=overwrite_input,
3988 interpolation=interpolation)

~/.conda/envs/mamba/lib/python3.9/site-packages/numpy/lib/function_base.py in _ureduce(a, func, **kwargs)
3562 keepdim = (1,) * a.ndim
3563
-> 3564 r = func(a, **kwargs)
3565 return r, keepdim
3566

~/.conda/envs/mamba/lib/python3.9/site-packages/numpy/lib/function_base.py in _quantile_ureduce_func(failed resolving arguments)
4110 x_above = take(ap, indices_above, axis=0)
4111
-> 4112 r = _lerp(x_below, x_above, weights_above, out=out)
4113
4114 # if any slice contained a nan, then all results on that slice are also nan

~/.conda/envs/mamba/lib/python3.9/site-packages/numpy/lib/function_base.py in _lerp(a, b, t, out)
4007 def _lerp(a, b, t, out=None):
4008 """ Linearly interpolate from a to b by a factor of t """
-> 4009 diff_b_a = subtract(b, a)
4010 # asanyarray is a stop-gap until gh-13105
4011 lerp_interpolation = asanyarray(add(a, diff_b_a*t, out=out))

UFuncTypeError: ufunc 'subtract' did not contain a loop with signature matching types (dtype(' None

At first I thought it was an issue when there are object-type columns, but now I'm not sure, is there a workaround for this?

alexmryzhkov commented 2 years ago

Hi @raijinspecial,

Thanks for helping us to make LightAutoML better! Could you please share a small subsample of the dataset you have to reproduce the issue with the code for Task, roles and rml creation?

Alex

github-actions[bot] commented 2 years ago

Stale issue message

alexmryzhkov commented 2 years ago

Hi @raijinspecial,

Any updates on this issue?

Alex