Skip to content

Commit

Permalink
fix : minor eidt in weighted_kappa method #243
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Apr 22, 2020
1 parent e4c58d9 commit 8a6c073
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pycm/pycm_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def weighted_average(self, param, weight=None, none_omit=False):
except Exception:
return "None"

def weighted_kappa(self,weight):
def weighted_kappa(self,weight=None):
"""
Calculate weighted kappa.
Expand All @@ -705,8 +705,8 @@ def weighted_kappa(self,weight):
"""
if matrix_check(weight) is False:
warn(WEIGHTED_KAPPA_WARNING, RuntimeWarning)
return cm.Kappa
return self.Kappa
if set(weight.keys()) != set(self.classes):
warn(WEIGHTED_KAPPA_WARNING, RuntimeWarning)
return cm.Kappa
return self.Kappa
return weighted_kappa_calc(self.classes,self.table,self.P,self.TOP,self.POP,weight)

0 comments on commit 8a6c073

Please sign in to comment.