Skip to content

Commit

Permalink
deploy: 4bab2d4
Browse files Browse the repository at this point in the history
  • Loading branch information
amrit110 committed Nov 21, 2023
1 parent 9cbb72f commit b2fa0d6
Show file tree
Hide file tree
Showing 35 changed files with 7,346 additions and 2,861 deletions.
4 changes: 2 additions & 2 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<meta name="generator" content="Docusaurus v3.0.0">
<title data-rh="true">Page Not Found | CyclOps</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://vectorinstitute.github.io/cyclops/404.html"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="Page Not Found | CyclOps"><link data-rh="true" rel="icon" href="/cyclops/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://vectorinstitute.github.io/cyclops/404.html"><link data-rh="true" rel="alternate" href="https://vectorinstitute.github.io/cyclops/404.html" hreflang="en"><link data-rh="true" rel="alternate" href="https://vectorinstitute.github.io/cyclops/404.html" hreflang="x-default"><link rel="alternate" type="application/rss+xml" href="/cyclops/blog/rss.xml" title="CyclOps RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/cyclops/blog/atom.xml" title="CyclOps Atom Feed"><link rel="stylesheet" href="/cyclops/assets/css/styles.bd9f4b2a.css">
<script src="/cyclops/assets/js/runtime~main.49642ce9.js" defer="defer"></script>
<script src="/cyclops/assets/js/main.8bc6fff8.js" defer="defer"></script>
<script src="/cyclops/assets/js/runtime~main.f74ffbd7.js" defer="defer"></script>
<script src="/cyclops/assets/js/main.de3a9079.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/cyclops/"><div class="navbar__logo"><img src="/cyclops/img/cyclops_logo-dark.png" alt="CyclOps Logo" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/cyclops/img/cyclops_logo-dark.png" alt="CyclOps Logo" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div><b class="navbar__title text--truncate"></b></a><a href="https://vectorinstitute.github.io/cyclops/api" target="_self" rel="noopener noreferrer" class="navbar__item navbar__link">API</a><a href="https://vectorinstitute.github.io/cyclops/api/tutorials" target="_self" rel="noopener noreferrer" class="navbar__item navbar__link">Tutorial</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/VectorInstitute/cyclops" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><div class="navbarSearchContainer_Bca1"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><main class="container margin-vert--xl"><div class="row"><div class="col col--6 col--offset-3"><h1 class="hero__title">Page Not Found</h1><p>We could not find what you were looking for.</p><p>Please contact the owner of the site that linked you to the original URL and let them know their link is broken.</p></div></div></main></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://vectorinstitute.github.io/cyclops/api" target="_self" rel="noopener noreferrer" class="footer__link-item">API</a></li><li class="footer__item"><a href="https://vectorinstitute.github.io/cyclops/api/tutorials" target="_self" rel="noopener noreferrer" class="footer__link-item">Tutorial</a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/cyclops/blog">Blog</a></li><li class="footer__item"><a href="https://github.com/VectorInstitute/cyclops" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2023 CyclOps, built by AI Engineering @ Vector Institute</div></div></div></footer></div>
Expand Down
Binary file modified api/_images/tutorials_nihcxr_monitor_api_10_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/_images/tutorials_nihcxr_monitor_api_12_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/_images/tutorials_nihcxr_monitor_api_6_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/_images/tutorials_nihcxr_monitor_api_8_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions api/_modules/cyclops/report/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,12 @@ <h1>Source code for cyclops.report.report</h1><div class="highlight"><pre>
<span class="n">_raise_if_not_dict_with_str_keys</span><span class="p">,</span>
<span class="n">create_metric_cards</span><span class="p">,</span>
<span class="n">empty</span><span class="p">,</span>
<span class="n">get_histories</span><span class="p">,</span>
<span class="n">get_names</span><span class="p">,</span>
<span class="n">get_passed</span><span class="p">,</span>
<span class="n">get_plots</span><span class="p">,</span>
<span class="n">get_slices</span><span class="p">,</span>
<span class="n">get_thresholds</span><span class="p">,</span>
<span class="n">get_timestamps</span><span class="p">,</span>
<span class="n">get_trends</span><span class="p">,</span>
<span class="n">regex_replace</span><span class="p">,</span>
<span class="n">regex_search</span><span class="p">,</span>
Expand Down Expand Up @@ -1316,8 +1317,10 @@ <h1>Source code for cyclops.report.report</h1><div class="highlight"><pre>
<span class="c1"># write to file</span>
<span class="k">if</span> <span class="n">synthetic_timestamp</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">today</span> <span class="o">=</span> <span class="n">synthetic_timestamp</span>
<span class="n">today_now</span> <span class="o">=</span> <span class="n">synthetic_timestamp</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">today</span> <span class="o">=</span> <span class="n">dt_date</span><span class="o">.</span><span class="n">today</span><span class="p">()</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">&quot;%Y-%m-</span><span class="si">%d</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">today_now</span> <span class="o">=</span> <span class="n">dt_datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">&quot;%Y-%m-</span><span class="si">%d</span><span class="s2"> %H:%M:%S&quot;</span><span class="p">)</span>

<span class="n">current_report_metrics</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="n">PerformanceMetric</span><span class="p">]]</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">sweep_metrics</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_model_card</span><span class="p">,</span> <span class="n">current_report_metrics</span><span class="p">)</span>
Expand Down Expand Up @@ -1348,6 +1351,7 @@ <h1>Source code for cyclops.report.report</h1><div class="highlight"><pre>
<span class="c1"># compare tests</span>
<span class="n">metrics</span><span class="p">,</span> <span class="n">tooltips</span><span class="p">,</span> <span class="n">slices</span><span class="p">,</span> <span class="n">values</span><span class="p">,</span> <span class="n">metric_cards</span> <span class="o">=</span> <span class="n">create_metric_cards</span><span class="p">(</span>
<span class="n">current_report_metrics_set</span><span class="p">,</span>
<span class="n">today_now</span><span class="p">,</span>
<span class="n">latest_report_metric_cards_set</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_log_metric_card_collection</span><span class="p">(</span>
Expand All @@ -1365,11 +1369,12 @@ <h1>Source code for cyclops.report.report</h1><div class="highlight"><pre>
<span class="s2">&quot;sweep_tests&quot;</span><span class="p">:</span> <span class="n">sweep_tests</span><span class="p">,</span>
<span class="s2">&quot;sweep_graphics&quot;</span><span class="p">:</span> <span class="n">sweep_graphics</span><span class="p">,</span>
<span class="s2">&quot;get_slices&quot;</span><span class="p">:</span> <span class="n">get_slices</span><span class="p">,</span>
<span class="s2">&quot;get_plots&quot;</span><span class="p">:</span> <span class="n">get_plots</span><span class="p">,</span>
<span class="s2">&quot;get_thresholds&quot;</span><span class="p">:</span> <span class="n">get_thresholds</span><span class="p">,</span>
<span class="s2">&quot;get_trends&quot;</span><span class="p">:</span> <span class="n">get_trends</span><span class="p">,</span>
<span class="s2">&quot;get_passed&quot;</span><span class="p">:</span> <span class="n">get_passed</span><span class="p">,</span>
<span class="s2">&quot;get_names&quot;</span><span class="p">:</span> <span class="n">get_names</span><span class="p">,</span>
<span class="s2">&quot;get_histories&quot;</span><span class="p">:</span> <span class="n">get_histories</span><span class="p">,</span>
<span class="s2">&quot;get_timestamps&quot;</span><span class="p">:</span> <span class="n">get_timestamps</span><span class="p">,</span>
<span class="p">}</span>
<span class="n">template</span><span class="o">.</span><span class="n">globals</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">func_dict</span><span class="p">)</span>

Expand Down
103 changes: 90 additions & 13 deletions api/_sources/tutorials/kaggle/heart_failure_prediction.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@
"source": [
"## Task Creation\n",
"\n",
"We use Cyclops tasks to define our model's task (in this case, MortalityPrediction), train the model, make predictions, and evaluate performance. Cyclops task classes encapsulate the entire ML pipeline into a single, cohesive structure, making the process smooth and easy to manage."
"We use Cyclops tasks to define our model's task (in this case, heart failure prediction), train the model, make predictions, and evaluate performance. Cyclops task classes encapsulate the entire ML pipeline into a single, cohesive structure, making the process smooth and easy to manage."
]
},
{
Expand All @@ -581,7 +581,7 @@
},
"outputs": [],
"source": [
"mortality_task = BinaryTabularClassificationTask(\n",
"heart_failure_prediction_task = BinaryTabularClassificationTask(\n",
" {model_name: model},\n",
" task_features=features_list,\n",
" task_target=\"outcome\",\n",
Expand All @@ -596,7 +596,7 @@
},
"outputs": [],
"source": [
"mortality_task.list_models()"
"heart_failure_prediction_task.list_models()"
]
},
{
Expand Down Expand Up @@ -626,7 +626,7 @@
" \"method\": \"grid\",\n",
"}\n",
"\n",
"mortality_task.train(\n",
"heart_failure_prediction_task.train(\n",
" dataset[\"train\"],\n",
" model_name=model_name,\n",
" transforms=preprocessor,\n",
Expand All @@ -640,7 +640,7 @@
"metadata": {},
"outputs": [],
"source": [
"model_params = mortality_task.list_models_params()[model_name]\n",
"model_params = heart_failure_prediction_task.list_models_params()[model_name]\n",
"print(model_params)"
]
},
Expand Down Expand Up @@ -679,7 +679,7 @@
},
"outputs": [],
"source": [
"y_pred = mortality_task.predict(\n",
"y_pred = heart_failure_prediction_task.predict(\n",
" dataset[\"test\"],\n",
" model_name=model_name,\n",
" transforms=preprocessor,\n",
Expand Down Expand Up @@ -836,9 +836,9 @@
},
"outputs": [],
"source": [
"results, dataset_with_preds = mortality_task.evaluate(\n",
" dataset[\"test\"],\n",
" metric_collection,\n",
"results, dataset_with_preds = heart_failure_prediction_task.evaluate(\n",
" dataset=dataset[\"test\"],\n",
" metrics=metric_collection,\n",
" model_names=model_name,\n",
" transforms=preprocessor,\n",
" prediction_column_prefix=\"preds\",\n",
Expand All @@ -849,6 +849,25 @@
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"results_female, _ = heart_failure_prediction_task.evaluate(\n",
" dataset=dataset[\"test\"],\n",
" metrics=MetricCollection(\n",
" {\"BinaryAccuracy\": create_metric(metric_name=\"accuracy\", task=\"binary\")},\n",
" ),\n",
" model_names=model_name,\n",
" transforms=preprocessor,\n",
" prediction_column_prefix=\"preds\",\n",
" slice_spec=SliceSpec([{\"Sex\": {\"value\": \"F\"}}], include_overall=False),\n",
" batch_size=32,\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -872,6 +891,30 @@
" model_name=model_name,\n",
")\n",
"\n",
"results_female_flat = flatten_results_dict(\n",
" results=results_female,\n",
" model_name=model_name,\n",
")\n",
"\n",
"for name, metric in results_female_flat.items():\n",
" split, name = name.split(\"/\") # noqa: PLW2901\n",
" descriptions = {\n",
" \"BinaryPrecision\": \"The proportion of predicted positive instances that are correctly predicted.\",\n",
" \"BinaryRecall\": \"The proportion of actual positive instances that are correctly predicted. Also known as recall or true positive rate.\",\n",
" \"BinaryAccuracy\": \"The proportion of all instances that are correctly predicted.\",\n",
" \"BinaryAUROC\": \"The area under the receiver operating characteristic curve (AUROC) is a measure of the performance of a binary classification model.\",\n",
" \"BinaryF1Score\": \"The harmonic mean of precision and recall.\",\n",
" }\n",
" report.log_quantitative_analysis(\n",
" \"performance\",\n",
" name=name,\n",
" value=metric,\n",
" description=descriptions[name],\n",
" metric_slice=split,\n",
" pass_fail_thresholds=0.7,\n",
" pass_fail_threshold_fns=lambda x, threshold: bool(x >= threshold),\n",
" )\n",
"\n",
"for name, metric in results_flat.items():\n",
" split, name = name.split(\"/\") # noqa: PLW2901\n",
" descriptions = {\n",
Expand Down Expand Up @@ -1174,9 +1217,20 @@
},
"outputs": [],
"source": [
"report_path = report.export(output_filename=\"heart_failure_report_periodic.html\")\n",
"synthetic_timestamps = [\n",
" \"2021-09-01\",\n",
" \"2021-10-01\",\n",
" \"2021-11-01\",\n",
" \"2021-12-01\",\n",
" \"2022-01-01\",\n",
"]\n",
"report._model_card.overview = None\n",
"report_path = report.export(\n",
" output_filename=\"heart_failure_report_periodic.html\",\n",
" synthetic_timestamp=synthetic_timestamps[0],\n",
")\n",
"shutil.copy(f\"{report_path}\", \".\")\n",
"for _ in range(5):\n",
"for i in range(4):\n",
" report._model_card.overview = None\n",
" report._model_card.quantitative_analysis = None\n",
" results_flat = flatten_results_dict(\n",
Expand All @@ -1185,6 +1239,25 @@
" model_name=model_name,\n",
" )\n",
"\n",
" for name, metric in results_female_flat.items():\n",
" split, name = name.split(\"/\") # noqa: PLW2901\n",
" descriptions = {\n",
" \"BinaryPrecision\": \"The proportion of predicted positive instances that are correctly predicted.\",\n",
" \"BinaryRecall\": \"The proportion of actual positive instances that are correctly predicted. Also known as recall or true positive rate.\",\n",
" \"BinaryAccuracy\": \"The proportion of all instances that are correctly predicted.\",\n",
" \"BinaryAUROC\": \"The area under the receiver operating characteristic curve (AUROC) is a measure of the performance of a binary classification model.\",\n",
" \"BinaryF1Score\": \"The harmonic mean of precision and recall.\",\n",
" }\n",
" report.log_quantitative_analysis(\n",
" \"performance\",\n",
" name=name,\n",
" value=np.clip(metric + np.random.normal(0, 0.1), 0, 1),\n",
" description=descriptions[name],\n",
" metric_slice=split,\n",
" pass_fail_thresholds=0.7,\n",
" pass_fail_threshold_fns=lambda x, threshold: bool(x >= threshold),\n",
" )\n",
"\n",
" for name, metric in results_flat.items():\n",
" split, name = name.split(\"/\") # noqa: PLW2901\n",
" descriptions = {\n",
Expand All @@ -1203,8 +1276,12 @@
" pass_fail_thresholds=0.7,\n",
" pass_fail_threshold_fns=lambda x, threshold: bool(x >= threshold),\n",
" )\n",
" report_path = report.export(output_filename=\"heart_failure_report_periodic.html\")\n",
" shutil.copy(f\"{report_path}\", \".\")"
" report_path = report.export(\n",
" output_filename=\"heart_failure_report_periodic.html\",\n",
" synthetic_timestamp=synthetic_timestamps[i + 1],\n",
" )\n",
" shutil.copy(f\"{report_path}\", \".\")\n",
"shutil.rmtree(\"./cyclops_reports\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion api/searchindex.js

Large diffs are not rendered by default.

Loading

0 comments on commit b2fa0d6

Please sign in to comment.