Beispiel #1
0
def _process_parallel_coxph(inp):
    """
    """
    node_id, activity, isdead, nbdays, seed, metadata_mat = inp
    pvalue = coxph(activity,
                   isdead,
                   nbdays,
                   seed=seed,
                   metadata_mat=metadata_mat)

    return node_id, pvalue
Beispiel #2
0
def _process_parallel_survival_feature_importance_per_cluster(inp):
    """
    """

    feature, array, survival, metadata_mat, pval_thres = inp
    nbdays, isdead = survival.T.tolist()

    pvalue = coxph(array, isdead, nbdays, metadata_mat=metadata_mat)

    if not np.isnan(pvalue) and pvalue < pval_thres:
        return (feature, pvalue)
    return None, None
Beispiel #3
0
    def test_1_coxph_function(self):
        """test if the coxph function works """
        from simdeep.coxph_from_r import coxph

        isdead = [0, 1, 1, 1, 0, 1, 0, 0, 1, 0]
        nbdays = [24, 10, 25, 50, 14, 10, 100, 10, 50, 10]
        values = [0, 1, 1, 0, 1, 2, 0, 1, 0, 0]

        pvalue = coxph(values, isdead, nbdays, isfactor=True)

        self.assertTrue(isinstance(pvalue, float))
        self.assertTrue(pvalue < 0.05)