<jupyter_start><jupyter_text>Debugging the Training Set<jupyter_code>%matplotlib notebook
# import
import pdb
import os
from linetools.spectra import io as lsio
from linetools import utils as ltu

from pyigm.surveys.dlasurvey import DLASurvey<jupyter_output><empty_output><jupyter_text>index 196 in file [training_20456_5000.hdf5]  Load<jupyter_code>spec_20456 = lsio.readspec(os.getenv('DROPBOX_DIR')+'/MachineLearning/DLAs/training_20456_5000.hdf5')
spec_20456.select = 196
# Strange qso..  Probably BAL nonsense
#  And probably should not have inlucded it in the training set..
spec_20456.plot()
spec_20456.header['PLATE'], spec_20456.header['FIBER']
spec_20456.header['zem']<jupyter_output><empty_output><jupyter_text>Check zabs vs. zem<jupyter_code>dlas = ltu.loadjson(os.getenv('DROPBOX_DIR')+'/MachineLearning/DLAs/training_20456_5000.json')
for ispec in range(spec_20456.nspec):
    spec_20456.select = ispec
    zem = spec_20456.header['zem']
    for ii in range(dlas[str(ispec)]['nDLA']):
        if dlas[str(ispec)][str(ii)]['zabs'] > zem:
            pdb.set_trace()
spec_20456.select = 228
spec_20456.plot()<jupyter_output><empty_output><jupyter_text>Bad zem??<jupyter_code>sdss = DLASurvey.load_SDSS_DR5(sample='all')
badsl = (sdss.sightlines['PLATE'] == 538) & (sdss.sightlines['FIB'] == 168)
sdss.sightlines[badsl]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13161764705882353, 'fraction_numerical': 0.07352941176470588, 'mean_word_length': 6.912790697674419, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 18, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '435060', 'license': 'MIT', 'n_tokens_mistral': 610, 'n_tokens_neox': 535, 'n_words': 85, 'path': 'docs/nb/Training_Set_Debug.ipynb', 'repo_name': 'JianiDing/dla_cnn', 'size': '1360'}