<jupyter_start><jupyter_text>The p-value only makes sense if the below are clearly defined:    null hypothesis    test statistic    meaning of "at least as extreme as"  So, the pipeline for doing a hypothesis test is to:    clearly state the null hypothesis and the test statistic.        Then you *simulate* production of the data as if the null hypothesis were true.        For each of these simulated data sets, compute the test statistic.        The p-value is then the fraction of your simulated data sets    for which the test statistic is at least as extreme as for the real data.<jupyter_code>permutation test (use from dc_stat_think)
plt.semilogy<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.03941605839416058, 'fraction_numerical': 0.0, 'mean_word_length': 3.8652482269503547, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '490618', 'license': 'MIT', 'n_tokens_mistral': 179, 'n_tokens_neox': 170, 'n_words': 97, 'path': 'notebooks/machine_learning_algorithms/3D-Statistical-Thinking.ipynb', 'repo_name': 'dilip-albert-datascientist/traditional-machine-learning', 'size': '685'}