Skip to content
Snippets Groups Projects
Commit 24fa02e0 authored by Shashank Singh's avatar Shashank Singh
Browse files

Fixed number of replicates for Figure 4.

parent 0ff76562
No related branches found
No related tags found
No related merge requests found
......@@ -2,13 +2,13 @@ import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
from knn_regressors import passive_knn_regressor, passive_kernel_regressor, active_knn_regressor
from knn_regressors import passive_knn_regressor, active_knn_regressor
from SIR_simulation import Sampler
plt.rc('font', size=22) # Increase matplotlib default font size
np.random.seed(0) # Fix random seed for reproducibility
num_replicates = 1**10 # Number of IID replications of experiment
num_replicates = 2**10 # Number of IID replications of experiment
ns = np.logspace(4, 12, 9, base=2., dtype=int)
sim_len = 20
......@@ -24,7 +24,7 @@ for replicate in tqdm(range(num_replicates)):
# Simulated data for passive estimators
Xs, Ys, Zs = sampler.generate_joint_samples(n)
passive_errors[replicate, n_idx] = passive_kernel_regressor(Xs, Ys, Zs, Xs_ground_truth, method='cv') - Ys_ground_truth
passive_errors[replicate, n_idx] = passive_knn_regressor(Xs, Ys, Zs, Xs_ground_truth, method='cv') - Ys_ground_truth
active_estimates, Xs_active, Ys_active, Zs_active = active_knn_regressor(sampler, Xs_ground_truth, n, method='cv')
active_errors[replicate, n_idx] = active_estimates - Ys_ground_truth
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment