diff --git a/.ipynb_checkpoints/app-checkpoint.py b/.ipynb_checkpoints/app-checkpoint.py deleted file mode 100644 index 4eb5055..0000000 --- a/.ipynb_checkpoints/app-checkpoint.py +++ /dev/null @@ -1,46 +0,0 @@ -import dash_bootstrap_components as dbc -import dash -from dash import dcc, html -from dash.dependencies import Input, Output -import plotly.express as px -import yaml - -import model -import src.app_layout_functions as alf - -with open('config.yaml') as f: - config = yaml.safe_load(f) - -# run model -model = model.Model(config) -df_prep, tbl = model.prep() -df_results = model.analysis(df_prep.copy(), tbl) - -# app components -external_stylesheets = [dbc.themes.BOOTSTRAP] -app_layout: dbc.Container = alf.run_layout_build(df_results) - -# initialize the app -app = dash.Dash( - __name__, - external_stylesheets=external_stylesheets -) - -# layout the app -app.layout = app_layout - -"""# Callback to update the graph based on dropdown selection -@app.callback( - Output('category-graph', 'figure'), - [Input('category-dropdown', 'value')] -) -def update_graph( - selected_category -): - filtered_df = df[df['Category'] == selected_category] - #fig = px.scatter(filtered_df, x='Value', y='Other Value', title=f"Category {selected_category}") - return fig -""" -# Run the app -if __name__ == '__main__': - app.run_server(debug=True) \ No newline at end of file diff --git a/.ipynb_checkpoints/config-checkpoint.yaml b/.ipynb_checkpoints/config-checkpoint.yaml deleted file mode 100644 index 59a6d62..0000000 --- a/.ipynb_checkpoints/config-checkpoint.yaml +++ /dev/null @@ -1,27 +0,0 @@ -Ingest: - filepath: inputs/ee_hierarchy.csv - group_variable: gen - group_target_val: Female - group_other_val : Male - outcome_variable: outcome - outcome_target_val: hired - outcome_other_val: not_hired - grpers: {job_title: analyst} - -StatsTesting2x2Cont: - testing: gender - process: hiring - alpha: 0.05 - phi_bin_edges: - - -1 - - -0.5 - - -0.10 - - 0.10 - - 0.5 - - 1 - phi_bin_labels: - - very low - - low - - around zero - - moderate - - high \ No newline at end of file diff --git a/.ipynb_checkpoints/env-checkpoint.yaml b/.ipynb_checkpoints/env-checkpoint.yaml deleted file mode 100644 index 133e4f0..0000000 --- a/.ipynb_checkpoints/env-checkpoint.yaml +++ /dev/null @@ -1,130 +0,0 @@ -name: equity_toolkit -channels: - - defaults -dependencies: - - bzip2=1.0.8=he774522_0 - - ca-certificates=2023.01.10=haa95532_0 - - certifi=2022.12.7=py311haa95532_0 - - libffi=3.4.2=hd77b12b_6 - - openssl=1.1.1t=h2bbff1b_0 - - pip=23.0.1=py311haa95532_0 - - python=3.11.0=h966fe2a_3 - - setuptools=65.6.3=py311haa95532_0 - - sqlite=3.41.1=h2bbff1b_0 - - tk=8.6.12=h2bbff1b_0 - - vc=14.2=h21ff451_1 - - vs2015_runtime=14.27.29016=h5e58377_2 - - wheel=0.38.4=py311haa95532_0 - - wincertstore=0.2=py311haa95532_0 - - xz=5.2.10=h8cc25b3_1 - - zlib=1.2.13=h8cc25b3_0 - - pip: - - aiofiles==22.1.0 - - aiosqlite==0.18.0 - - anyio==3.6.2 - - argon2-cffi==21.3.0 - - argon2-cffi-bindings==21.2.0 - - arrow==1.2.3 - - asttokens==2.2.1 - - attrs==22.2.0 - - babel==2.12.1 - - backcall==0.2.0 - - beautifulsoup4==4.12.2 - - bleach==6.0.0 - - cffi==1.15.1 - - charset-normalizer==3.1.0 - - click==8.1.3 - - colorama==0.4.6 - - comm==0.1.3 - - dash==2.9.2 - - dash-bootstrap-components==1.6.0 - - dash-core-components==2.0.0 - - dash-html-components==2.0.0 - - dash-table==5.0.0 - - debugpy==1.6.7 - - decorator==5.1.1 - - defusedxml==0.7.1 - - executing==1.2.0 - - fastjsonschema==2.16.3 - - flask==2.2.3 - - fqdn==1.5.1 - - idna==3.4 - - ipykernel==6.22.0 - - ipython==8.12.0 - - ipython-genutils==0.2.0 - - isoduration==20.11.0 - - itsdangerous==2.1.2 - - jedi==0.18.2 - - jinja2==3.1.2 - - json5==0.9.11 - - jsonpointer==2.3 - - jsonschema==4.17.3 - - jupyter-client==8.1.0 - - jupyter-core==5.3.0 - - jupyter-events==0.6.3 - - jupyter-server==2.5.0 - - jupyter-server-fileid==0.8.0 - - jupyter-server-terminals==0.4.4 - - jupyter-server-ydoc==0.8.0 - - jupyter-ydoc==0.2.3 - - jupyterlab==3.6.3 - - jupyterlab-pygments==0.2.2 - - jupyterlab-server==2.22.0 - - markupsafe==2.1.2 - - mistune==2.0.5 - - mypy==1.11.2 - - mypy-extensions==1.0.0 - - nbclassic==0.5.5 - - nbclient==0.7.3 - - nbconvert==7.3.0 - - nbformat==5.8.0 - - nest-asyncio==1.5.6 - - notebook==6.5.4 - - notebook-shim==0.2.2 - - numpy==1.24.2 - - packaging==23.0 - - pandas==2.0.0 - - pandocfilters==1.5.0 - - parso==0.8.3 - - pickleshare==0.7.5 - - platformdirs==3.2.0 - - plotly==5.14.1 - - prometheus-client==0.16.0 - - prompt-toolkit==3.0.38 - - psutil==5.9.4 - - pure-eval==0.2.2 - - pycparser==2.21 - - pygments==2.14.0 - - pyrsistent==0.19.3 - - python-dateutil==2.8.2 - - python-json-logger==2.0.7 - - pytz==2023.3 - - pywin32==306 - - pywinpty==2.0.10 - - pyyaml==6.0 - - pyzmq==25.0.2 - - requests==2.28.2 - - rfc3339-validator==0.1.4 - - rfc3986-validator==0.1.1 - - scipy==1.10.1 - - send2trash==1.8.0 - - six==1.16.0 - - sniffio==1.3.0 - - soupsieve==2.4 - - stack-data==0.6.2 - - tenacity==8.2.2 - - terminado==0.17.1 - - tinycss2==1.2.1 - - tornado==6.2 - - traitlets==5.9.0 - - typing-extensions==4.12.2 - - tzdata==2023.3 - - uri-template==1.2.0 - - urllib3==1.26.15 - - wcwidth==0.2.6 - - webcolors==1.13 - - webencodings==0.5.1 - - websocket-client==1.5.1 - - werkzeug==2.2.3 - - y-py==0.5.9 - - ypy-websocket==0.8.2 \ No newline at end of file diff --git a/.ipynb_checkpoints/model-checkpoint.py b/.ipynb_checkpoints/model-checkpoint.py deleted file mode 100644 index 3956f79..0000000 --- a/.ipynb_checkpoints/model-checkpoint.py +++ /dev/null @@ -1,83 +0,0 @@ -from typing import Any -from pandas import DataFrame -from typing import Dict -from typing import List -from typing import Tuple - -import os -import yaml - -import src.model_classes as mc - -package_dir = os.path.dirname(os.path.abspath(__file__)) -config_fp = os.path.join(package_dir, "config.yaml") - -with open(config_fp) as f: - config = yaml.safe_load(f) - -class Model: - - """ - - """ - - def __init__( - self, - config: Dict[str, Any] - ): - - """ - - """ - - self.config = config - - def prep( - self - ) -> Tuple[DataFrame, List[float]]: - - """ - - """ - - config = self.config - - # ingest - prep = mc.Ingest(config) - df_prep: DataFrame = prep.run() - - # transform - trans = mc.Transform(df=df_prep) - tbl: List[float] = trans.run_build_cont_table() - - return df_prep, tbl - - def analysis( - self, - df_prep: DataFrame, - tbl: List[float] - ) -> DataFrame: - - """ - - """ - - config = self.config - - stats = mc.StatsTesting2x2Cont( - config=config, - tbl=tbl, - df=df_prep - ) - df_result: DataFrame = stats.run_testing() - - return df_result - - -if __name__ == "__main__": - - model = Model() - - df_prep, tbl = model.prep() - - df_result = model.analysis(df_prep.copy(), tbl) \ No newline at end of file