Skip to content

Commit

Permalink
fix dataset columns and remove delta warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
RektPunk committed Sep 11, 2024
1 parent 4051eae commit c922ed6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mqboost/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ def __init__(
self._predict_dtype: Callable = _funcs.get(TypeName.predict_dtype)

_data = to_dataframe(data)
self._columns = _data.columns
self.encoders: dict[str, MQLabelEncoder] = {}
for col in self._columns:
for col in _data.columns:
if _data[col].dtype == "object":
_encoder = MQLabelEncoder()
_data[col] = _encoder.fit_transform(_data[col])
self.encoders.update({col: _encoder})

self._data = prepare_x(x=_data, alphas=self._alphas)
self._columns = self._data.columns
if label is not None:
self._label = prepare_y(y=label, alphas=self._alphas)
self._is_none_label = False
Expand Down
2 changes: 1 addition & 1 deletion tests/test_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_mqobjective_check_loss_initialization():

def test_mqobjective_huber_loss_initialization():
"""Test MQObjective initialization with huber loss."""
delta = 0.1
delta = 0.05
mq_objective = MQObjective(
alphas=alphas,
objective=ObjectiveName.huber,
Expand Down

0 comments on commit c922ed6

Please sign in to comment.