Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def d_score(self, Y):
return super().d_score(Y_from_censored(Y))
class DistWithUncensoredScore(cls):
scores = [UncensoredScore]
return DistWithUncensoredScore
class RegressionDistn(Distn):
def predict(self): # predictions for regression are typically conditional means
return self.mean()
class ClassificationDistn(Distn):
def predict(self): # returns class assignments
return np.argmax(self.class_probs(), 1)
DistScore = cls.implementation(Score, cls.censored_scores)
class UncensoredScore(DistScore, DistScore.__base__):
def score(self, Y):
return super().score(Y_from_censored(Y))
def d_score(self, Y):
return super().d_score(Y_from_censored(Y))
class DistWithUncensoredScore(cls):
scores = [UncensoredScore]
return DistWithUncensoredScore
class RegressionDistn(Distn):
def predict(self): # predictions for regression are typically conditional means
return self.mean()
class ClassificationDistn(Distn):
def predict(self): # returns class assignments
return np.argmax(self.class_probs(), 1)