diff --git a/src/sageworks/algorithms/dataframe/knn_spider.py b/src/sageworks/algorithms/dataframe/knn_spider.py index 5c1461f9f..d0ce2b62b 100644 --- a/src/sageworks/algorithms/dataframe/knn_spider.py +++ b/src/sageworks/algorithms/dataframe/knn_spider.py @@ -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.""" @@ -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) @@ -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") \ No newline at end of file + spider_from_model = KNNSpider.from_model(model, id_column="id")