예제 #1
0
def main():
    X1_train, X2_train, Y_train, X1_test, X2_test, Y_test = davis_data.setting3_split()
    learner = KronRLS(X1 = X1_train, X2 = X2_train, Y = Y_train)
    log_regparams = range(15, 35)
    for log_regparam in log_regparams:
        learner.solve(2.**log_regparam)
        P = learner.predict(X1_test, X2_test)
        perf = cindex(Y_test, P)
        print("regparam 2**%d, cindex %f" %(log_regparam, perf))
예제 #2
0
def main():
    X1_train, X2_train, Y_train, X1_test, X2_test, Y_test = davis_data.setting3_split()
    learner = TwoStepRLS(X1 = X1_train, X2 = X2_train, Y = Y_train, regparam1=1.0, regparam2=1.0)
    log_regparams1 = range(-8, -4)
    log_regparams2 = range(20,25)
    for log_regparam1 in log_regparams1:
        for log_regparam2 in log_regparams2:
            learner.solve(2.**log_regparam1, 2.**log_regparam2)
            P = learner.predict(X1_test, X2_test)
            perf = cindex(Y_test, P)
            print("regparam 2**%d 2**%d, test set cindex %f" %(log_regparam1, log_regparam2, perf))
            P = learner.leave_x2_out()
            perf = cindex(Y_train, P)
            print("regparam 2**%d 2**%d, leave-column-out cindex %f" %(log_regparam1, log_regparam2, perf))
예제 #3
0
파일: two_step3.py 프로젝트: disc5/RLScore
def main():
    X1_train, X2_train, Y_train, X1_test, X2_test, Y_test = davis_data.setting3_split(
    )
    learner = TwoStepRLS(X1=X1_train,
                         X2=X2_train,
                         Y=Y_train,
                         regparam1=1.0,
                         regparam2=1.0)
    log_regparams1 = range(-8, -4)
    log_regparams2 = range(20, 25)
    for log_regparam1 in log_regparams1:
        for log_regparam2 in log_regparams2:
            learner.solve(2.**log_regparam1, 2.**log_regparam2)
            P = learner.predict(X1_test, X2_test)
            perf = cindex(Y_test, P)
            print("regparam 2**%d 2**%d, test set cindex %f" %
                  (log_regparam1, log_regparam2, perf))
            P = learner.leave_x2_out()
            perf = cindex(Y_train, P)
            print("regparam 2**%d 2**%d, leave-column-out cindex %f" %
                  (log_regparam1, log_regparam2, perf))