Commit
Β·
7bdd0db
1
Parent(s):
c045d56
chore: Migrate marimo to Jupyter notebook
Browse files- app.py +27 -6
- requirements.txt +2 -0
- tutorial_app.ipynb +0 -0
app.py
CHANGED
|
@@ -18,9 +18,7 @@ def _(mo):
|
|
| 18 |
|
| 19 |
@app.cell
|
| 20 |
def _():
|
| 21 |
-
import matplotlib.pyplot as plt
|
| 22 |
import pandas as pd
|
| 23 |
-
import seaborn as sns
|
| 24 |
|
| 25 |
from sklearn.ensemble import RandomForestClassifier
|
| 26 |
from sklearn.linear_model import LogisticRegression
|
|
@@ -42,7 +40,6 @@ def _():
|
|
| 42 |
plot_family_status,
|
| 43 |
plot_income_type,
|
| 44 |
)
|
| 45 |
-
from src.theme import custom_palette
|
| 46 |
from src.utils import get_dataset, get_features_target, get_train_test_sets
|
| 47 |
from src.preprocessing import preprocess_data_pipeline
|
| 48 |
return (
|
|
@@ -73,6 +70,18 @@ def _(mo):
|
|
| 73 |
return
|
| 74 |
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
@app.cell
|
| 77 |
def _(mo):
|
| 78 |
mo.md("""### 1.1 Dataset Information""")
|
|
@@ -440,7 +449,7 @@ def _(mo):
|
|
| 440 |
|
| 441 |
@app.cell
|
| 442 |
def _():
|
| 443 |
-
rf_scores = {"train_score": 1.0, "test_score": 0.
|
| 444 |
rf_scores
|
| 445 |
return
|
| 446 |
|
|
@@ -493,8 +502,8 @@ def _(mo):
|
|
| 493 |
@app.cell
|
| 494 |
def _():
|
| 495 |
rfo_scores = {
|
| 496 |
-
"train_score": 0.
|
| 497 |
-
"test_score": 0.
|
| 498 |
}
|
| 499 |
rfo_scores
|
| 500 |
return
|
|
@@ -625,5 +634,17 @@ def _():
|
|
| 625 |
return
|
| 626 |
|
| 627 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 628 |
if __name__ == "__main__":
|
| 629 |
app.run()
|
|
|
|
| 18 |
|
| 19 |
@app.cell
|
| 20 |
def _():
|
|
|
|
| 21 |
import pandas as pd
|
|
|
|
| 22 |
|
| 23 |
from sklearn.ensemble import RandomForestClassifier
|
| 24 |
from sklearn.linear_model import LogisticRegression
|
|
|
|
| 40 |
plot_family_status,
|
| 41 |
plot_income_type,
|
| 42 |
)
|
|
|
|
| 43 |
from src.utils import get_dataset, get_features_target, get_train_test_sets
|
| 44 |
from src.preprocessing import preprocess_data_pipeline
|
| 45 |
return (
|
|
|
|
| 70 |
return
|
| 71 |
|
| 72 |
|
| 73 |
+
@app.cell
|
| 74 |
+
def _(mo):
|
| 75 |
+
mo.callout(
|
| 76 |
+
kind="info",
|
| 77 |
+
value=mo.md(
|
| 78 |
+
"""π‘ **Want a step-by-step walkthrough instead?**
|
| 79 |
+
Check the Jupyter notebook version here: π [Jupyter notebook](https://huggingface.co/spaces/iBrokeTheCode/Home_Credit_Default_Risk_Prediction/blob/main/tutorial_app.ipynb)""",
|
| 80 |
+
),
|
| 81 |
+
)
|
| 82 |
+
return
|
| 83 |
+
|
| 84 |
+
|
| 85 |
@app.cell
|
| 86 |
def _(mo):
|
| 87 |
mo.md("""### 1.1 Dataset Information""")
|
|
|
|
| 449 |
|
| 450 |
@app.cell
|
| 451 |
def _():
|
| 452 |
+
rf_scores = {"train_score": 1.0, "test_score": 0.7066811557903828}
|
| 453 |
rf_scores
|
| 454 |
return
|
| 455 |
|
|
|
|
| 502 |
@app.cell
|
| 503 |
def _():
|
| 504 |
rfo_scores = {
|
| 505 |
+
"train_score": 0.8196620915431655,
|
| 506 |
+
"test_score": 0.7308385425476998,
|
| 507 |
}
|
| 508 |
rfo_scores
|
| 509 |
return
|
|
|
|
| 634 |
return
|
| 635 |
|
| 636 |
|
| 637 |
+
@app.cell
|
| 638 |
+
def _(mo):
|
| 639 |
+
mo.md(r"""## 4. Conclusion""")
|
| 640 |
+
return
|
| 641 |
+
|
| 642 |
+
|
| 643 |
+
@app.cell
|
| 644 |
+
def _(mo):
|
| 645 |
+
mo.md(r"""...""")
|
| 646 |
+
return
|
| 647 |
+
|
| 648 |
+
|
| 649 |
if __name__ == "__main__":
|
| 650 |
app.run()
|
requirements.txt
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
|
|
| 1 |
lightgbm==4.6.0
|
| 2 |
marimo==0.14.16
|
| 3 |
matplotlib==3.10.5
|
|
|
|
| 4 |
pandas==2.3.1
|
| 5 |
pyarrow==21.0.0
|
| 6 |
ruff==0.12.7
|
|
|
|
| 1 |
+
ipykernel==6.30.1
|
| 2 |
lightgbm==4.6.0
|
| 3 |
marimo==0.14.16
|
| 4 |
matplotlib==3.10.5
|
| 5 |
+
nbformat==5.10.4
|
| 6 |
pandas==2.3.1
|
| 7 |
pyarrow==21.0.0
|
| 8 |
ruff==0.12.7
|
tutorial_app.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|