From 7f1d12b37684136f0e664e4f35c4818930e19ca2 Mon Sep 17 00:00:00 2001 From: Jason Dsouza Date: Tue, 5 Aug 2025 05:51:35 +0000 Subject: [PATCH 1/2] Fixed window function error --- .../Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb | 11 +++++++++++ .../Anomaly_Detection_Python_TrustedAI.ipynb | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/UseCases/Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb b/UseCases/Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb index 38837a4c..fa1d002f 100644 --- a/UseCases/Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb +++ b/UseCases/Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb @@ -457,6 +457,17 @@ "

Next we calculate the derivative by using the lead function and taking the difference of the lead value and the mean value of the resistance. Applying a window function to smooth the resistance curve helps to eliminate noise and makes it easier to see the overall trend. The derivative of the resistance gives an indication of how quickly the resistance is changing, which can be a useful measure for detecting anomalies and predicting potential issues.

\n" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "e520bd85-78ba-4356-b7e2-45a431458bd8", + "metadata": {}, + "outputs": [], + "source": [ + "copy_to_sql(welding_dataset_smooth,table_name='welding_dataset_smooth', if_exists='replace')\n", + "welding_dataset_smooth = DataFrame('welding_dataset_smooth')" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/UseCases/Anomaly_Detection/Anomaly_Detection_Python_TrustedAI.ipynb b/UseCases/Anomaly_Detection/Anomaly_Detection_Python_TrustedAI.ipynb index 8bb25caf..715f84cb 100644 --- a/UseCases/Anomaly_Detection/Anomaly_Detection_Python_TrustedAI.ipynb +++ b/UseCases/Anomaly_Detection/Anomaly_Detection_Python_TrustedAI.ipynb @@ -482,6 +482,17 @@ "

Next we calculate the derivative by using the lead function and taking the difference of the lead value and the mean value of the resistance. Applying a window function to smooth the resistance curve helps to eliminate noise and makes it easier to see the overall trend. The derivative of the resistance gives an indication of how quickly the resistance is changing, which can be a useful measure for detecting anomalies and predicting potential issues.

\n" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "c494a795-c9bf-4d3b-8ecf-549ba4ad7b79", + "metadata": {}, + "outputs": [], + "source": [ + "copy_to_sql(welding_dataset_smooth,table_name='welding_dataset_smooth', if_exists='replace')\n", + "welding_dataset_smooth = DataFrame('welding_dataset_smooth')" + ] + }, { "cell_type": "code", "execution_count": null, From 403c51081b900253dbb43ee4566cd1d54f496efe Mon Sep 17 00:00:00 2001 From: dallasbowden Date: Fri, 3 Oct 2025 04:18:03 +0000 Subject: [PATCH 2/2] Updated the queryband value. Updated the copyright date. --- UseCases/Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/UseCases/Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb b/UseCases/Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb index fa1d002f..8f3f3996 100644 --- a/UseCases/Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb +++ b/UseCases/Anomaly_Detection/Anomaly_Detection_PY_SQL.ipynb @@ -68,8 +68,7 @@ "metadata": {}, "outputs": [], "source": [ - "%%capture\n", - "# # '%%capture' suppresses the display of installation steps of the following packages\n", + "# %%capture suppresses the display of installation steps of the following packages\n", "# !pip install tdsense\n", "# !pip install imblearn\n", "# !pip install xgboost==1.7.3\n", @@ -175,7 +174,7 @@ "outputs": [], "source": [ "%%capture\n", - "execute_sql('''SET query_band='DEMO=AnomalyDetection.ipynb;' UPDATE FOR SESSION; ''')" + "execute_sql('''SET query_band='DEMO=AnomalyDetection_PY_SQL.ipynb;' UPDATE FOR SESSION; ''')" ] }, { @@ -1945,7 +1944,7 @@ "
ClearScape Analytics™
\n", "
\n", "
\n", - " Copyright © Teradata Corporation - 2023, 2024. All Rights Reserved\n", + " Copyright © Teradata Corporation - 2023, 2024, 2025. All Rights Reserved\n", "
\n", "
\n", ""