Exemplo n.º 1
0
l_tau = ['tau_dr', 'tau_ols', 'tau_ols_ps', 'tau_resid']
output = 'results/2019-10-30_' + exp_name + '.csv'
l_scores = []

for args['citcio'] in [False, True]:
    for args['model'] in ["dlvm", "lrmf"]:
        for args['seed'] in range_seed:
            for args['prop_miss'] in range_prop_miss:
                for args['n'] in range_n:
                    for args['p'] in range_p:

                        t0 = time.time()
                        score = exp_mi(**args)
                        args['time'] = int(time.time() - t0)
                        l_scores.append(
                            np.concatenate((list(args.values()), score)))
                        print('exp with ', args)
                        print('........... DONE')
                        print('in ', int(args["time"]), ' s  \n\n')

                    score_data = pd.DataFrame(l_scores,
                                              columns=list(args.keys()) +
                                              l_tau)
                    score_data.to_csv(output + '_temp')

print('saving ' + exp_name + 'at: ' + output)
score_data.to_csv(output)

print('*' * 20)
print('Exp: ' + exp_name + ' succesfully ended.')
print('*' * 20)
Exemplo n.º 2
0
l_scores = []

for args['seed'] in range_seed:
    for args['citcio'] in [False, True]:
        for args['model'] in ["dlvm", "lrmf"]:
            for args['n'] in range_n:
                for args['sig_prior'] in range_sig_prior:
                    for args['n_epochs'] in range_n_epochs:
                        for args['prop_miss'] in range_prop_miss:
                            for args['p'] in range_p:

                                t0 = time.time()
                                score = exp_miwae(**args)
                                args['time'] = int(time.time() - t0)
                                l_scores.append(
                                    np.concatenate(
                                        (list(args.values()), score)))
                                print('exp with ', args)
                                print('........... DONE')
                                print('in ', int(args["time"]), ' s  \n\n')

                            score_data = pd.DataFrame(
                                l_scores, columns=list(args.keys()) + l_tau)
                            score_data.to_csv(output + '_temp')

print('saving ' + exp_name + 'at: ' + output)
score_data.to_csv(output)

print('*' * 20)
print('Exp: ' + exp_name + ' succesfully ended.')
print('*' * 20)
Exemplo n.º 3
0
args['m'] = 10
print('starting exp: ' + exp_name)
l_tau = ['tau_dr', 'tau_ols', 'tau_ols_ps']
output = 'results/2019-10-24_'+exp_name+'.csv'
l_scores = []

for args['citcio'] in [False, True]:
    for args['model'] in ["dlvm","lrmf"]:
        for args['seed'] in range_seed:
            for args['prop_miss'] in range_prop_miss:
                for args['n'] in range_n:
                    for args['p'] in range_p:     
                        
                        t0 = time.time()
                        score = exp_mi(**args)
                        args['time'] = int(time.time() - t0)
                        l_scores.append(np.concatenate((list(args.values()),score)))
                        print('exp with ', args)
                        print('........... DONE')
                        print('in ', int(args["time"]) , ' s  \n\n')

                    score_data = pd.DataFrame(l_scores, columns=list(args.keys()) + l_tau)
                    score_data.to_csv(output + '_temp')

print('saving ' +exp_name + 'at: ' + output)
score_data.to_csv(output)

print('*'*20)
print('Exp: '+ exp_name+' succesfully ended.')
print('*'*20)
Exemplo n.º 4
0
                            if args['model'] == "lrmf":
                                Z, X, w, y, ps = gen_lrmf(n=args['n'], d=args['d'], p=args['p'], 
                                                          citcio = args['citcio'], prop_miss = args['prop_miss'], 
                                                          seed = args['seed'])
                            elif args['model'] == "dlvm":
                                Z, X, w, y, ps = gen_dlvm(n=args['n'], d=args['d'], p=args['p'], 
                                                          citcio = args['citcio'], prop_miss = args['prop_miss'], 
                                                          seed = args['seed'])
                            
                            X_miss = ampute(X, prop_miss = args['prop_miss'], seed = args['seed'])

                            # Complete
                            t0 = time.time()
                            tau = exp_complete(Z, X, w, y)
                            args['time'] = int(time.time() - t0)
                            l_scores.append(np.concatenate((['Z'], list(args.values()), [None]*7, tau['Z'])))
                            l_scores.append(np.concatenate((['X'], list(args.values()), [None]*7, tau['X'])))
                            

                            # Mean-imputation
                            t0 = time.time()
                            tau = exp_mean(X_miss, w, y)
                            args['time'] = int(time.time() - t0)
                            l_scores.append(np.concatenate((['Mean_imp'], list(args.values()), [None]*7, tau)))


                            # MI
                            tau = []
                            t0 = time.time()
                            for m in range_m:
                                tau.append(exp_mi(X_miss, w, y, m=m))