<jupyter_start><jupyter_text>PALET Sprint Demo: 1. Income Bracket by Group2. Age Range by Group3. Eligible but Not Enrolled4. Enhanced Class Function Logging<jupyter_code><jupyter_output><empty_output><jupyter_text>Start by importing Enrollment, Eligibility, and PaletMetadata from PALET.<jupyter_code>from palet.Enrollment import Enrollment
from palet.Eligibility import Eligibility
from palet.PaletMetadata import PaletMetadata<jupyter_output><empty_output><jupyter_text>New by Groups - byIncomeBracket(), byAgeRange(), and byEnrollmentType Let's start by creating a an enrollment object.<jupyter_code>api = Enrollment([6280]).byMonth()
type(api)<jupyter_output><empty_output><jupyter_text>I want to view enrollment broken down by the predetermined age groups (age_grp_flag) with in the TAF data.<jupyter_code>df = api.byAgeRange().fetch()
display(df)<jupyter_output><empty_output><jupyter_text>This default option provides a helpful breakdown of different age groups, but what if I want to view age bands that aren't already within the TAF data?In this case, we will enter a python dictionary as an arguement, and specify user defined age bands. Simply enter a string as a label, then a list of integers specifying a minimum and maximum range.<jupyter_code>df = api.byAgeRange({'Teenager': [13,19],'Adult': [20,64],'Senior': [65,125]}).fetch()

display(df)
print(api.sql())<jupyter_output><empty_output><jupyter_text>In this example we use 3 different age bands, but this isn't required. The user has the flexibilty to enter as few or as many age bands as they desire. Continuing with these user defined age bands, let's also break our enrollment query out by income bracket.<jupyter_code>df = api.byIncomeBracket().fetch()
display(df)<jupyter_output><empty_output><jupyter_text>View Eligible Beneficiaries Who Aren't Enrolled Let's shift out focus to eligibility. The first step here is to call our original enrollment object as an eligibility object.<jupyter_code>api = Eligibility(api)
type(api)<jupyter_output><empty_output><jupyter_text>Now that we have confirmed our enrollment object is converted to an eligibility object, let's view counts for those who are eligible but not enrolled.<jupyter_code>display(api.notEnrolled().fetch())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08271007479102507, 'fraction_numerical': 0.009678838539375276, 'mean_word_length': 7.209386281588448, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '331784', 'license': 'CC0-1.0', 'n_tokens_mistral': 723, 'n_tokens_neox': 679, 'n_words': 241, 'path': 'examples/PALET - Feb 24 2022.ipynb', 'repo_name': 'tmsis/palet', 'size': '2273'}