Uv workflow improvements (#531)

* Uv workflow improvements

* Uv workflow improvements

* linter improvements

* pytproject.toml fixes

* pytproject.toml fixes

* pytproject.toml fixes

* pytproject.toml fixes

* pytproject.toml fixes

* pytproject.toml fixes

* windows fixes

* windows fixes

* windows fixes

* windows fixes

* windows fixes

* windows fixes

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix

* win32 fix
This commit is contained in:
Sebastian Raschka
2025-02-16 13:16:51 -06:00
committed by GitHub
parent 29353c74d8
commit a08d7aaa84
29 changed files with 382 additions and 321 deletions

View File

@@ -79,28 +79,6 @@
"<img src=\"https://sebastianraschka.com/images/LLMs-from-scratch-images/ch06_compressed/chapter-overview.webp\" width=500px>"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "946c3e56-b04b-4b0f-b35f-b485ce5b28df",
"metadata": {},
"outputs": [],
"source": [
"# Utility to prevent certain cells from being executed twice\n",
"\n",
"from IPython.core.magic import register_line_cell_magic\n",
"\n",
"executed_cells = set()\n",
"\n",
"@register_line_cell_magic\n",
"def run_once(line, cell):\n",
" if line not in executed_cells:\n",
" get_ipython().run_cell(cell)\n",
" executed_cells.add(line)\n",
" else:\n",
" print(f\"Cell '{line}' has already been executed.\")"
]
},
{
"cell_type": "markdown",
"id": "3a84cf35-b37f-4c15-8972-dfafc9fadc1c",
@@ -450,9 +428,6 @@
}
],
"source": [
"%%run_once balance_df\n",
"\n",
"\n",
"def create_balanced_dataset(df):\n",
" \n",
" # Count the instances of \"spam\"\n",
@@ -490,7 +465,6 @@
},
"outputs": [],
"source": [
"%%run_once label_mapping\n",
"balanced_df[\"Label\"] = balanced_df[\"Label\"].map({\"ham\": 0, \"spam\": 1}) "
]
},

View File

@@ -190,13 +190,13 @@
" \n",
" # Calculating accuracy and balanced accuracy\n",
" accuracy_train = accuracy_score(y_train, y_pred_train)\n",
" balanced_accuracy_train = balanced_accuracy_score(y_train, y_pred_train)\n",
" # balanced_accuracy_train = balanced_accuracy_score(y_train, y_pred_train)\n",
" \n",
" accuracy_val = accuracy_score(y_val, y_pred_val)\n",
" balanced_accuracy_val = balanced_accuracy_score(y_val, y_pred_val)\n",
" # balanced_accuracy_val = balanced_accuracy_score(y_val, y_pred_val)\n",
"\n",
" accuracy_test = accuracy_score(y_test, y_pred_test)\n",
" balanced_accuracy_test = balanced_accuracy_score(y_test, y_pred_test)\n",
" # balanced_accuracy_test = balanced_accuracy_score(y_test, y_pred_test)\n",
" \n",
" # Printing the results\n",
" print(f\"Training Accuracy: {accuracy_train*100:.2f}%\")\n",
@@ -269,7 +269,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.10.16"
}
},
"nbformat": 4,