Commit 78c35b93 authored by nd-02110114's avatar nd-02110114
Browse files

🚨 fix lint error

parent ba97b824
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ class Model(BaseEstimator):
  """

  def __init__(self,
               model_instance: Optional[Any] = None,
               model_instance=None,
               model_dir: Optional[str] = None,
               **kwargs) -> None:
    """Abstract class for all models.
+2 −4
Original line number Diff line number Diff line
@@ -82,11 +82,9 @@ class SklearnModel(Model):
    w = np.squeeze(dataset.w)
    # Some scikit-learn models don't use weights.
    if self.use_weights:
      # FIXME: BaseEstimator doesn't guarantee the class has `fit` method.
      self.model_instance.fit(X, y, w)  # type: ignore
      self.model_instance.fit(X, y, w)
      return
    # FIXME: BaseEstimator doesn't guarantee the class has `fit` method.
    self.model_instance.fit(X, y)  # type: ignore
    self.model_instance.fit(X, y)

  def predict_on_batch(self, X: np.ndarray) -> np.ndarray:
    """Makes predictions on batch of data.
+2 −1
Original line number Diff line number Diff line
@@ -52,7 +52,8 @@ class XGBoostModel(SklearnModel):
    else:
      self.early_stopping_rounds = 50

  def fit(self, dataset: Dataset, **kwargs) -> None:
  # FIXME: Return type "None" of "fit" incompatible with return type "float" in supertype "Model"
  def fit(self, dataset: Dataset, **kwargs) -> None:  # type: ignore[override]
    """Fits XGBoost model to data.

    dataset: Dataset