Skip to content

Commit

Permalink
black & ruff updates
Browse files Browse the repository at this point in the history
Signed-off-by: Łukasz Ćmielowski <Lukasz.Cmielowski@pl.ibm.com>
  • Loading branch information
LukaszCmielowski committed Dec 20, 2024
1 parent 3f834fa commit 67ab5bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def calculate_one_hot_encoder_output_shapes(operator):
operator.outputs[0].type = FloatTensorType(
[N, len(int_categories)], doc_string=operator.outputs[0].type.doc_string
)
elif len(str_categories) > 0 and type(operator.inputs[0].type) == StringTensorType:
elif len(str_categories) > 0 and type(operator.inputs[0].type) is StringTensorType:
operator.outputs[0].type = FloatTensorType(
[N, len(str_categories)], doc_string=operator.outputs[0].type.doc_string
)
Expand Down
4 changes: 3 additions & 1 deletion onnxmltools/convert/lightgbm/_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def __init__(self, booster):
elif self.objective_.startswith("multiclass"):
self.operator_name = "LgbmClassifier"
self.classes_ = self._generate_classes(booster)
elif self.objective_.startswith(("regression", "poisson", "gamma", "quantile", "huber")):
elif self.objective_.startswith(
("regression", "poisson", "gamma", "quantile", "huber")
):
self.operator_name = "LgbmRegressor"
else:
raise NotImplementedError(
Expand Down
8 changes: 7 additions & 1 deletion tests/lightgbm/test_objective_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@


class ObjectiveTest(unittest.TestCase):
_regressor_objectives: Tuple[str] = ("regression", "poisson", "gamma", "quantile", "huber")
_regressor_objectives: Tuple[str] = (
"regression",
"poisson",
"gamma",
"quantile",
"huber",
)

@staticmethod
def _calc_initial_types(X: DataFrame) -> List[Tuple[str, TensorType]]:
Expand Down

0 comments on commit 67ab5bf

Please sign in to comment.