How to use the ngboost.helpers.Y_from_censored 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 / api.py View on Github external
Parameters:
            X                       : DataFrame object or List or numpy array of predictors (n x p) in Numeric format
            T                       : DataFrame object or List or numpy array of times to event or censoring (n). Should be floats 
            E                       : DataFrame object or List or numpy array of event indicators (n). E[i] = 1 <=> T[i] is the time of an event, else censoring time
            T_val                   : DataFrame object or List or validation-set times, in Numeric format if any
            E_val                   : DataFrame object or List or validation-set event idicators, in Numeric format if any
        """
        
        X = check_array(X)
        
        if X_val is not None:
            X_val = check_array(X_val)
        
        return super().fit(
            X,
            Y_from_censored(T, E),
            X_val=X_val,
            Y_val=Y_from_censored(T_val, E_val),
            **kwargs,
        )
github stanfordmlgroup / ngboost / ngboost / api.py View on Github external
T                       : DataFrame object or List or numpy array of times to event or censoring (n). Should be floats 
            E                       : DataFrame object or List or numpy array of event indicators (n). E[i] = 1 <=> T[i] is the time of an event, else censoring time
            T_val                   : DataFrame object or List or validation-set times, in Numeric format if any
            E_val                   : DataFrame object or List or validation-set event idicators, in Numeric format if any
        """
        
        X = check_array(X)
        
        if X_val is not None:
            X_val = check_array(X_val)
        
        return super().fit(
            X,
            Y_from_censored(T, E),
            X_val=X_val,
            Y_val=Y_from_censored(T_val, E_val),
            **kwargs,
        )
github stanfordmlgroup / ngboost / ngboost / distns / distn.py View on Github external
def score(self, Y):
                return super().score(Y_from_censored(Y))
github stanfordmlgroup / ngboost / ngboost / distns / distn.py View on Github external
def d_score(self, Y):
                return super().d_score(Y_from_censored(Y))