Skip to content

Commit

Permalink
Merge pull request #1 from quanted/gemini-models
Browse files Browse the repository at this point in the history
Gemini models
  • Loading branch information
deronsmith authored Jan 2, 2024
2 parents cda6794 + 18a96f3 commit 99ecf11
Show file tree
Hide file tree
Showing 15 changed files with 92,711 additions and 61,854 deletions.
44,258 changes: 21,091 additions & 23,167 deletions notebooks/.ipynb_checkpoints/epa_nmf-py_workflow_01-checkpoint.ipynb

Large diffs are not rendered by default.

38,263 changes: 18,445 additions & 19,818 deletions notebooks/.ipynb_checkpoints/epa_nmf-py_workflow_01-data-test-checkpoint.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5afced49-c9ff-4a44-9558-e327d07d46bc",
"id": "d8514eed-0747-49b0-b387-ce3379213a2e",
"metadata": {
"id": "5afced49-c9ff-4a44-9558-e327d07d46bc",
"outputId": "499ec5ca-8d55-4537-a069-a7b004821e1c"
Expand All @@ -498,6 +498,35 @@
"model_analysis.plot_factor_contributions(feature_idx=1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3e479211-fc1d-46d8-a84a-13e339143c1c",
"metadata": {
"id": "5afced49-c9ff-4a44-9558-e327d07d46bc",
"outputId": "499ec5ca-8d55-4537-a069-a7b004821e1c"
},
"outputs": [],
"source": [
"# New Graphic: Factor Profile Composition Radar Graph\n",
"model_analysis.plot_factor_composition()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "be971709-def7-4528-85f2-b5a1dd7e8506",
"metadata": {
"id": "5afced49-c9ff-4a44-9558-e327d07d46bc",
"outputId": "499ec5ca-8d55-4537-a069-a7b004821e1c"
},
"outputs": [],
"source": [
"# New Graphic: Factor Contribution Surface Plot\n",
"factor_idx = 1\n",
"model_analysis.plot_factor_surface(factor_idx=factor_idx)"
]
},
{
"cell_type": "markdown",
"id": "3ccba89f-ec29-4791-b221-ecfbd4f15009",
Expand Down
95 changes: 95 additions & 0 deletions notebooks/.ipynb_checkpoints/gemini-analysis-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "2ce7bb70-e4ee-4e27-a8c9-9ce1ab0b5fc0",
"metadata": {},
"outputs": [],
"source": [
"# Notebook imports\n",
"import os\n",
"import sys\n",
"import json\n",
"\n",
"module_path = os.path.abspath(os.path.join('..'))\n",
"if module_path not in sys.path:\n",
" sys.path.append(module_path)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "bccedc41-222f-46b6-9461-e64a35cbeb7e",
"metadata": {},
"outputs": [],
"source": [
"LS_NMF = \"D:\\\\\\\\projects\\\\nmf_py\\\\funsearch\\\\algorithms\\\\ls-nmf\\\\summary.json\"\n",
"WS_NMF = \"D:\\\\\\\\projects\\\\nmf_py\\\\funsearch\\\\algorithms\\\\ws-nmf\\\\summary.json\""
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "44131ca7-2cb7-40d9-ba1c-0097708e202f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Best Model: 267, Q(robust): 54418.75, Base Q(robust): 54424.27\n"
]
}
],
"source": [
"best_Q = None\n",
"best_model = None\n",
"base_Q = None\n",
"with open(LS_NMF, 'r') as gemini_file:\n",
" model_summary = json.load(gemini_file)\n",
" for k, v in model_summary.items():\n",
" k_Q = v[\"Q(robust)\"][0]\n",
" if best_Q is None:\n",
" best_Q = k_Q\n",
" best_model = k\n",
" elif k_Q < best_Q:\n",
" best_Q = k_Q\n",
" best_model = k\n",
" if k == '0':\n",
" base_Q = k_Q\n",
"\n",
"print(f\"Best Model: {best_model}, Q(robust): {best_Q}, Base Q(robust): {base_Q}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fe5ac9bc-3767-4529-90ce-e2e5e6f4eb1a",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading

0 comments on commit 99ecf11

Please sign in to comment.