<jupyter_start><jupyter_text>My training of AB emus isn't working... going to explore<jupyter_code>import matplotlib
#matplotlib.use('Agg')
from matplotlib import pyplot as plt
%matplotlib inline
import seaborn as sns
sns.set()
import numpy as np
from pearce.mocks.kittens import TrainingBox, MDHR
cat = TrainingBox(boxno=0, system = 'sherlock')
cat.load(1.0, HOD = 'corrZheng07', hod_kwargs={'sec_haloprop_key': 'halo_local_density_10'})
cat.halocat.halo_table.colnames
cat.model.param_dict<jupyter_output><empty_output><jupyter_text>cat.halocat.halo_table['halo_local_density_10'].mean()<jupyter_code>print cat.model.param_dict.keys()
default_params = cat.model.param_dict
default_params['mean_occupation_centrals_assembias_corr1'] = 0.0
default_params['mean_occupation_satellites_assembias_corr1'] = 0.0
#default_params['mean_occupation_centrals_assembias_split1'] = 0.5
#default_params['mean_occupation_satellites_assembias_split1'] = 0.5
default_params['sigma_logM'] = 0.5
default_params['logMmin'] = 13.5
cat.model.model_dictionary['centrals_occupation'].sec_haloprop_key
r_bins = np.logspace(-1.1, 1.6, 19)
rbc = (r_bins[1:]+r_bins[:-1])/2.0
#default_y = np.zeros((18,))
#for i in xrange(N):
#    print i,
cat.populate(default_params)
default_y= cat.calc_xi(r_bins)
#default_y/=N
N = 7
cmap = sns.color_palette("GnBu_d", N)
pname = 'mean_occupation_satellites_assembias_corr1'
l, h = -1.0, 1.0
#l, h = 0.0, 1.0

d = default_params.copy()
for v, c in zip(np.linspace(l,h,N), cmap):
    d[pname] = v
    #y = np.zeros((18,))
    #for i in xrange(N):
       # print i,
    cat.populate(d)
    y= cat.calc_xi(r_bins)
    print v, (y/default_y)[14]
    #y/=N
    plt.plot(rbc, y/default_y, label = v, c = c)
    
plt.xscale('log')
#plt.loglog()
plt.legend(loc = 'best')
plt.show();
from halotools.empirical_models.abunmatch.noisy_percentile import noisy_percentile
from scipy.stats import rankdata
N =11
x=(rankdata(np.linspace(0,10,N), 'ordinal')*1.0)/N# - 0.5
print x
print noisy_percentile(x, -1)
x[::-1]
plt.hist(np.log(cat.halocat.halo_table['halo_nfw_conc'][np.isfinite(cat.halocat.halo_table['halo_nfw_conc'])] ))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15195167286245354, 'fraction_numerical': 0.029275092936802975, 'mean_word_length': 6.059016393442623, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '34693', 'license': 'MIT', 'n_tokens_mistral': 953, 'n_tokens_neox': 918, 'n_words': 151, 'path': 'notebooks/Test Assembias Training.ipynb', 'repo_name': 'mclaughlin6464/pearce', 'size': '2152'}