Skip to content

Commit

Permalink
Merge pull request nidhaloff#98 from anjali-rgpt/utils-check
Browse files Browse the repository at this point in the history
Changed ImportError statement as from utils -> from igel.utils
  • Loading branch information
nidhaloff authored Aug 30, 2021
2 parents c8378d6 + 7225f4a commit e508086
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions igel/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
from sklearn.utils.multiclass import type_of_target

from igel.extras.kmedoids import KMedoids

import logging

logging.basicConfig(format='%(levelname)s - %(message)s', level=logging.INFO)
Expand Down
4 changes: 4 additions & 0 deletions igel/extras/kmedoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ def predict(self, X):
# yields the smallest distance
return pairwise_distances_argmin(X, Y = self.cluster_centers_, metric=self.metric)

def score(self,X):
"""Returns score"""
return -self.inertia_




Expand Down
8 changes: 2 additions & 6 deletions igel/igel.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
read_yaml,
)
except ImportError:
from utils import (
from igel.utils import (
read_yaml,
create_yaml,
extract_params,
Expand Down Expand Up @@ -517,11 +517,7 @@ def fit(self, **kwargs):
)

if self.model_type == "clustering":
if self.model.__class__.__name__ != 'KMedoids':
eval_results = self.model.score(x_train)
else:
eval_results = self.model.score_

eval_results = self.model.score(x_train)
else:
if x_test is None:
logger.info(
Expand Down

0 comments on commit e508086

Please sign in to comment.