Skip to content

Commit

Permalink
flake8/linter cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Oct 6, 2024
1 parent 1c0651a commit 80e4f82
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/sageworks/algorithms/dataframe/knn_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,14 @@ def from_model(cls, model: Model, id_column: str):
class_labels = None

# Pass the extracted arguments to the existing __init__ method
return cls(df,features=features, target=target, id_column=id_column,
classification=classification, class_labels=class_labels)
return cls(
df,
features=features,
target=target,
id_column=id_column,
classification=classification,
class_labels=class_labels,
)

def get_neighbor_indices_and_distances(self):
"""Retrieve neighbor indices and distances for all points in the dataset."""
Expand Down Expand Up @@ -230,7 +236,7 @@ def _reorder_class_labels(self):

# Regression Test using Training and Test DataFrames
reg_spider = KNNSpider(
training_df, ["feat1", "feat2", "feat3"], target="target", id_column="ID", classification=False
training_df, ["feat1", "feat2", "feat3"], target="target", id_column="ID", classification=False
)
reg_predictions = reg_spider.predict(test_df)
print("Regression Predictions (Test Data):\n", reg_predictions)
Expand Down Expand Up @@ -274,4 +280,4 @@ def _reorder_class_labels(self):

# Test the `from_model` class method
model = Model("wine-classification")
spider_from_model = KNNSpider.from_model(model, id_column="id")
spider_from_model = KNNSpider.from_model(model, id_column="id")

0 comments on commit 80e4f82

Please sign in to comment.