Limit the number of neighbors based on the dataframe
This commit is contained in:
@@ -130,6 +130,10 @@ class KNNStrategy(MVStrategy):
|
||||
df.fillna(usable_data, inplace=True)
|
||||
return df
|
||||
|
||||
def count_max(self, df: DataFrame, label: str) -> int:
|
||||
usable_data = df.dropna(subset=self.training_features)
|
||||
return usable_data[label].count()
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "kNN"
|
||||
|
||||
|
Reference in New Issue
Block a user