How to use the ngboost.distns.distn.Distn function in ngboost

To help you get started, we’ve selected a few ngboost examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stanfordmlgroup / ngboost / ngboost / distns / distn.py View on Github external
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)
github stanfordmlgroup / ngboost / ngboost / distns / distn.py View on Github external
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)