Skip to content
Snippets Groups Projects
Commit 6eeab2b0 authored by Pietro Zambelli's avatar Pietro Zambelli
Browse files

Change order smaller hopkins are better and add __repr__ method to ApplyW

parent 092e5907
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ else:
print("=" * 50)
print(f"BEST PRE-PROCESSING (10/{len(pre_scores)}):")
print(pre_scores.sort_values("hopkins", ascending=False).loc[:10, :])
print(pre_scores.sort_values("hopkins", ascending=True).loc[:10, :])
print("-" * 50)
print("Hopkins statistics of main pre-processing options")
print(pre_scores["hopkins"].describe())
......
......@@ -12,10 +12,6 @@ from justclust.hopkins import hopkins
# from pathlib import Path
class ApplyW:
def __init__(self, weights):
self.weights = weights
......@@ -23,6 +19,9 @@ class ApplyW:
def fit_transform(self, X, *args, **kwargs):
return X * self.weights
def __repr__(self):
return f"ApplyW(weights={self.weights!r})"
def get_preprocs(selected=None, apply_weight=None):
scalers = [
......@@ -196,6 +195,6 @@ def explore_preprocs(
)
scores = pd.DataFrame.from_records(res)
scores.sort_values("hopkins", ascending=False, inplace=True)
scores.sort_values("hopkins", ascending=True, inplace=True)
return scores
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment