Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wbo4958 committed Jan 24, 2025
1 parent a28d7f1 commit 2945920
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions python/pyspark/ml/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def setParams(
return self._set(**kwargs)

def isLargerBetter(self) -> bool:
"""Override this function to make it run on connect"""
return True


Expand Down Expand Up @@ -471,9 +472,8 @@ def setParams(
return self._set(**kwargs)

def isLargerBetter(self) -> bool:
if self.getMetricName() in ["r2", "var"]:
return True
return False
"""Override this function to make it run on connect"""
return self.getMetricName() in ["r2", "var"]


@inherit_doc
Expand Down Expand Up @@ -709,14 +709,13 @@ def setParams(
return self._set(**kwargs)

def isLargerBetter(self) -> bool:
if self.getMetricName() in [
"""Override this function to make it run on connect"""
return not self.getMetricName() in [
"weightedFalsePositiveRate",
"falsePositiveRateByLabel",
"logLoss",
"hammingLoss",
]:
return False
return True
]


@inherit_doc
Expand Down Expand Up @@ -862,9 +861,8 @@ def setParams(
return self._set(**kwargs)

def isLargerBetter(self) -> bool:
if self.getMetricName() == "hammingLoss":
return False
return True
"""Override this function to make it run on connect"""
return self.getMetricName() != "hammingLoss"


@inherit_doc
Expand Down Expand Up @@ -1026,6 +1024,7 @@ def setWeightCol(self, value: str) -> "ClusteringEvaluator":
return self._set(weightCol=value)

def isLargerBetter(self) -> bool:
"""Override this function to make it run on connect"""
return True


Expand Down Expand Up @@ -1165,6 +1164,7 @@ def setParams(
return self._set(**kwargs)

def isLargerBetter(self) -> bool:
"""Override this function to make it run on connect"""
return True


Expand Down

0 comments on commit 2945920

Please sign in to comment.