Exemple #1
0
    def fit(self, X, T, E, X_val=None, T_val=None, E_val=None, **kwargs):
        """Fits an NGBoost survival model to the data.
        For additional parameters see ngboost.NGboost.fit

        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) (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,
        )
Exemple #2
0
    def fit(self, X, T, E, X_val=None, T_val=None, E_val=None, **kwargs):
        '''
        Fits an NGBoost survival model to the data. For additional parameters see ngboost.NGboost.fit

        Parameters:
            X                       : numpy array of predictors (n x p)
            T                       : numpy array of times to event or censoring (n). Should be floats 
            E                       : numpy array of event indicators (n). E[i] = 1 <=> T[i] is the time of an event, else censoring time
            T_val                   : validation-set times, if any
            E_val                   : validation-set event idicators, if any
        '''
        return super().fit(X,
                           Y_from_censored(T, E),
                           X_val=X_val,
                           Y_val=Y_from_censored(T_val, E_val),
                           **kwargs)
Exemple #3
0
 def d_score(self, Y):
     return super().d_score(Y_from_censored(Y))