Skip to content

Commit

Permalink
Merge pull request #2 from snigdhagit/snigdha_mle
Browse files Browse the repository at this point in the history
added point estimators as methods
  • Loading branch information
jonathan-taylor committed Aug 29, 2018
2 parents aa8e376 + 8f214d2 commit 03f1d8f
Show file tree
Hide file tree
Showing 5 changed files with 576 additions and 29 deletions.
42 changes: 42 additions & 0 deletions snigdha/batch_estimation.py
@@ -0,0 +1,42 @@
from copy import copy
from argparse import Namespace

import numpy as np, pandas as pd

from compare_fdr import main as main_fdr
from compare_intervals import main as main_intervals
from compare_estimators import main as main_estimators


base_opts = Namespace(all_methods=False,
all_methods_noR=False,
concat=False,
cor_thresh=0.5,
csvfile='estimators.csv',
htmlfile='estimators.html',
instance='bestsubset_instance',
level=0.2,
list_instances=False,
list_methods=False,
methods=['selective_MLE_half_1se', 'randomized_LASSO_half_1se', 'randomized_relaxed_LASSO_half_1se',
'LASSO_1se', 'relaxed_LASSO_1se'],
n=500,
nsim=50,
p=100,
rho=[0.35],
s=5,
snr=[0.10, 0.15],
use_BH=True,
verbose=True,
wide_only=False)


# estimator results

estimator_opts = copy(base_opts)
estimator_opts.csvfile = 'estimation.csv'
estimator_opts.use_BH = False
main_estimators(estimator_opts)

estimation = pd.read_csv('estimation_summary.csv')

42 changes: 21 additions & 21 deletions snigdha/batch.py → snigdha/batch_inference.py
Expand Up @@ -8,25 +8,25 @@
from compare_estimators import main as main_estimators


base_opts = Namespace(all_methods=False,
all_methods_noR=False,
concat=False,
cor_thresh=0.5,
csvfile='estimators.csv',
htmlfile='estimators.html',
instance='bestsubset_instance',
level=0.2,
list_instances=False,
list_methods=False,
methods=['lee_1se', 'randomized_lasso_half_1se'],
n=500,
nsim=2,
p=200,
rho=[0.4],
s=5,
snr=[0.4, 0.6],
use_BH=True,
verbose=True,
base_opts = Namespace(all_methods=False,
all_methods_noR=False,
concat=False,
cor_thresh=0.5,
csvfile='estimators.csv',
htmlfile='estimators.html',
instance='bestsubset_instance',
level=0.2,
list_instances=False,
list_methods=False,
methods=['lee_1se', 'liu_1se','randomized_lasso_half_1se'],
n=500,
nsim=20,
p=100,
rho=[0.35],
s=5,
snr=[0.10],
use_BH=True,
verbose=True,
wide_only=False)

# BH results
Expand Down Expand Up @@ -62,9 +62,9 @@
marginal = pd.read_csv('fdr_marginal_summary.csv')
BH = pd.read_csv('fdr_BH_summary.csv')

half1 = pd.merge(marginal, BH, left_on=['snr', 'class_name'], right_on=['snr', 'class_name'],
half1 = pd.merge(marginal, BH, left_on=['snr', 'class_name'], right_on=['snr', 'class_name'],
suffixes=(' (marginal)', ' (BH)'))
half2 = pd.merge(estimation, intervals, left_on=['snr', 'class_name'], right_on=['snr', 'class_name'],
half2 = pd.merge(estimation, intervals, left_on=['snr', 'class_name'], right_on=['snr', 'class_name'],
suffixes=(' (estimation)', ' (intervals)'))
full = pd.merge(half1, half2, left_on=['snr', 'class_name'], right_on=['snr', 'class_name'])

Expand Down

0 comments on commit 03f1d8f

Please sign in to comment.