teradataml 20.0.0.1__py3-none-any.whl → 20.0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of teradataml might be problematic. Click here for more details.
- teradataml/LICENSE-3RD-PARTY.pdf +0 -0
- teradataml/LICENSE.pdf +0 -0
- teradataml/README.md +306 -0
- teradataml/__init__.py +10 -3
- teradataml/_version.py +1 -1
- teradataml/analytics/__init__.py +3 -2
- teradataml/analytics/analytic_function_executor.py +299 -16
- teradataml/analytics/analytic_query_generator.py +92 -0
- teradataml/analytics/byom/__init__.py +3 -2
- teradataml/analytics/json_parser/metadata.py +13 -3
- teradataml/analytics/json_parser/utils.py +13 -6
- teradataml/analytics/meta_class.py +40 -1
- teradataml/analytics/sqle/DecisionTreePredict.py +1 -1
- teradataml/analytics/sqle/__init__.py +11 -2
- teradataml/analytics/table_operator/__init__.py +4 -3
- teradataml/analytics/uaf/__init__.py +21 -2
- teradataml/analytics/utils.py +66 -1
- teradataml/analytics/valib.py +1 -1
- teradataml/automl/__init__.py +1502 -323
- teradataml/automl/custom_json_utils.py +139 -61
- teradataml/automl/data_preparation.py +247 -307
- teradataml/automl/data_transformation.py +32 -12
- teradataml/automl/feature_engineering.py +325 -86
- teradataml/automl/model_evaluation.py +44 -35
- teradataml/automl/model_training.py +122 -153
- teradataml/catalog/byom.py +8 -8
- teradataml/clients/pkce_client.py +1 -1
- teradataml/common/__init__.py +2 -1
- teradataml/common/constants.py +72 -0
- teradataml/common/deprecations.py +13 -7
- teradataml/common/garbagecollector.py +152 -120
- teradataml/common/messagecodes.py +11 -2
- teradataml/common/messages.py +4 -1
- teradataml/common/sqlbundle.py +26 -4
- teradataml/common/utils.py +225 -14
- teradataml/common/wrapper_utils.py +1 -1
- teradataml/context/context.py +82 -2
- teradataml/data/SQL_Fundamentals.pdf +0 -0
- teradataml/data/complaints_test_tokenized.csv +353 -0
- teradataml/data/complaints_tokens_model.csv +348 -0
- teradataml/data/covid_confirm_sd.csv +83 -0
- teradataml/data/dataframe_example.json +27 -1
- teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -0
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +2 -0
- teradataml/data/docs/sqle/docs_17_20/Pivoting.py +279 -0
- teradataml/data/docs/sqle/docs_17_20/Shap.py +203 -0
- teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +189 -0
- teradataml/data/docs/sqle/docs_17_20/TFIDF.py +142 -0
- teradataml/data/docs/sqle/docs_17_20/TextParser.py +3 -3
- teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
- teradataml/data/docs/tableoperator/docs_17_20/Image2Matrix.py +118 -0
- teradataml/data/docs/uaf/docs_17_20/ACF.py +1 -10
- teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +35 -5
- teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +3 -1
- teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +293 -0
- teradataml/data/docs/uaf/docs_17_20/AutoArima.py +354 -0
- teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +3 -2
- teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/Convolve.py +13 -10
- teradataml/data/docs/uaf/docs_17_20/Convolve2.py +4 -1
- teradataml/data/docs/uaf/docs_17_20/CopyArt.py +145 -0
- teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +5 -4
- teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +4 -4
- teradataml/data/docs/uaf/docs_17_20/DWT.py +235 -0
- teradataml/data/docs/uaf/docs_17_20/DWT2D.py +214 -0
- teradataml/data/docs/uaf/docs_17_20/DickeyFuller.py +18 -21
- teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +160 -0
- teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +9 -31
- teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +4 -2
- teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +1 -8
- teradataml/data/docs/uaf/docs_17_20/IDWT.py +236 -0
- teradataml/data/docs/uaf/docs_17_20/IDWT2D.py +226 -0
- teradataml/data/docs/uaf/docs_17_20/IQR.py +134 -0
- teradataml/data/docs/uaf/docs_17_20/LineSpec.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/MAMean.py +3 -3
- teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +297 -0
- teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +15 -6
- teradataml/data/docs/uaf/docs_17_20/PACF.py +0 -1
- teradataml/data/docs/uaf/docs_17_20/Portman.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/Resample.py +9 -1
- teradataml/data/docs/uaf/docs_17_20/SAX.py +246 -0
- teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +17 -10
- teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +3 -1
- teradataml/data/docs/uaf/docs_17_20/WindowDFFT.py +368 -0
- teradataml/data/dwt2d_dataTable.csv +65 -0
- teradataml/data/dwt_dataTable.csv +8 -0
- teradataml/data/dwt_filterTable.csv +3 -0
- teradataml/data/finance_data4.csv +13 -0
- teradataml/data/grocery_transaction.csv +19 -0
- teradataml/data/idwt2d_dataTable.csv +5 -0
- teradataml/data/idwt_dataTable.csv +8 -0
- teradataml/data/idwt_filterTable.csv +3 -0
- teradataml/data/interval_data.csv +5 -0
- teradataml/data/jsons/paired_functions.json +14 -0
- teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayes.json +193 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayesPredict.json +212 -0
- teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +9 -9
- teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
- teradataml/data/jsons/sqle/17.20/TD_Shap.json +222 -0
- teradataml/data/jsons/sqle/17.20/TD_TFIDF.json +162 -0
- teradataml/data/jsons/sqle/17.20/TD_TextParser.json +1 -1
- teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
- teradataml/data/jsons/sqle/20.00/TD_KMeans.json +250 -0
- teradataml/data/jsons/sqle/20.00/TD_SMOTE.json +266 -0
- teradataml/data/jsons/sqle/20.00/TD_VectorDistance.json +278 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_COPYART.json +71 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
- teradataml/data/jsons/tableoperator/17.20/IMAGE2MATRIX.json +53 -0
- teradataml/data/jsons/uaf/17.20/TD_ACF.json +1 -18
- teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +3 -16
- teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +0 -3
- teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +5 -3
- teradataml/data/jsons/uaf/17.20/TD_ARIMAXESTIMATE.json +362 -0
- teradataml/data/jsons/uaf/17.20/TD_AUTOARIMA.json +469 -0
- teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +0 -3
- teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +0 -2
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +2 -1
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +2 -5
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +3 -6
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +1 -3
- teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +0 -5
- teradataml/data/jsons/uaf/17.20/TD_DFFT.json +1 -4
- teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +2 -7
- teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +1 -2
- teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +0 -2
- teradataml/data/jsons/uaf/17.20/TD_DICKEY_FULLER.json +10 -19
- teradataml/data/jsons/uaf/17.20/TD_DTW.json +3 -6
- teradataml/data/jsons/uaf/17.20/TD_DWT.json +173 -0
- teradataml/data/jsons/uaf/17.20/TD_DWT2D.json +160 -0
- teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +16 -30
- teradataml/data/jsons/uaf/17.20/{TD_HOLT_WINTERS_FORECAST.json → TD_HOLT_WINTERS_FORECASTER.json} +1 -2
- teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +1 -15
- teradataml/data/jsons/uaf/17.20/TD_IDWT.json +162 -0
- teradataml/data/jsons/uaf/17.20/TD_IDWT2D.json +149 -0
- teradataml/data/jsons/uaf/17.20/TD_IQR.json +117 -0
- teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +1 -3
- teradataml/data/jsons/uaf/17.20/TD_MATRIX2IMAGE.json +209 -0
- teradataml/data/jsons/uaf/17.20/TD_PACF.json +2 -2
- teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +5 -5
- teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +48 -28
- teradataml/data/jsons/uaf/17.20/TD_SAX.json +210 -0
- teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +12 -6
- teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +0 -1
- teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +8 -8
- teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +410 -0
- teradataml/data/load_example_data.py +8 -2
- teradataml/data/medical_readings.csv +101 -0
- teradataml/data/naivebayestextclassifier_example.json +1 -1
- teradataml/data/naivebayestextclassifierpredict_example.json +11 -0
- teradataml/data/patient_profile.csv +101 -0
- teradataml/data/peppers.png +0 -0
- teradataml/data/real_values.csv +14 -0
- teradataml/data/sax_example.json +8 -0
- teradataml/data/scripts/deploy_script.py +1 -1
- teradataml/data/scripts/lightgbm/dataset.template +157 -0
- teradataml/data/scripts/lightgbm/lightgbm_class_functions.template +247 -0
- teradataml/data/scripts/lightgbm/lightgbm_function.template +216 -0
- teradataml/data/scripts/lightgbm/lightgbm_sklearn.template +159 -0
- teradataml/data/scripts/sklearn/sklearn_fit.py +194 -160
- teradataml/data/scripts/sklearn/sklearn_fit_predict.py +136 -115
- teradataml/data/scripts/sklearn/sklearn_function.template +34 -16
- teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +155 -137
- teradataml/data/scripts/sklearn/sklearn_neighbors.py +1 -1
- teradataml/data/scripts/sklearn/sklearn_score.py +12 -3
- teradataml/data/scripts/sklearn/sklearn_transform.py +162 -24
- teradataml/data/star_pivot.csv +8 -0
- teradataml/data/target_udt_data.csv +8 -0
- teradataml/data/templates/open_source_ml.json +3 -1
- teradataml/data/teradataml_example.json +20 -1
- teradataml/data/timestamp_data.csv +4 -0
- teradataml/data/titanic_dataset_unpivoted.csv +19 -0
- teradataml/data/uaf_example.json +55 -1
- teradataml/data/unpivot_example.json +15 -0
- teradataml/data/url_data.csv +9 -0
- teradataml/data/vectordistance_example.json +4 -0
- teradataml/data/windowdfft.csv +16 -0
- teradataml/dataframe/copy_to.py +1 -1
- teradataml/dataframe/data_transfer.py +5 -3
- teradataml/dataframe/dataframe.py +1002 -201
- teradataml/dataframe/fastload.py +3 -3
- teradataml/dataframe/functions.py +867 -0
- teradataml/dataframe/row.py +160 -0
- teradataml/dataframe/setop.py +2 -2
- teradataml/dataframe/sql.py +840 -33
- teradataml/dataframe/window.py +1 -1
- teradataml/dbutils/dbutils.py +878 -34
- teradataml/dbutils/filemgr.py +48 -1
- teradataml/geospatial/geodataframe.py +1 -1
- teradataml/geospatial/geodataframecolumn.py +1 -1
- teradataml/hyperparameter_tuner/optimizer.py +13 -13
- teradataml/lib/aed_0_1.dll +0 -0
- teradataml/opensource/__init__.py +1 -1
- teradataml/opensource/{sklearn/_class.py → _class.py} +102 -17
- teradataml/opensource/_lightgbm.py +950 -0
- teradataml/opensource/{sklearn/_wrapper_utils.py → _wrapper_utils.py} +1 -2
- teradataml/opensource/{sklearn/constants.py → constants.py} +13 -10
- teradataml/opensource/sklearn/__init__.py +0 -1
- teradataml/opensource/sklearn/_sklearn_wrapper.py +1019 -574
- teradataml/options/__init__.py +9 -23
- teradataml/options/configure.py +42 -4
- teradataml/options/display.py +2 -2
- teradataml/plot/axis.py +4 -4
- teradataml/scriptmgmt/UserEnv.py +13 -9
- teradataml/scriptmgmt/lls_utils.py +77 -23
- teradataml/store/__init__.py +13 -0
- teradataml/store/feature_store/__init__.py +0 -0
- teradataml/store/feature_store/constants.py +291 -0
- teradataml/store/feature_store/feature_store.py +2223 -0
- teradataml/store/feature_store/models.py +1505 -0
- teradataml/store/vector_store/__init__.py +1586 -0
- teradataml/table_operators/Script.py +2 -2
- teradataml/table_operators/TableOperator.py +106 -20
- teradataml/table_operators/query_generator.py +3 -0
- teradataml/table_operators/table_operator_query_generator.py +3 -1
- teradataml/table_operators/table_operator_util.py +102 -56
- teradataml/table_operators/templates/dataframe_register.template +69 -0
- teradataml/table_operators/templates/dataframe_udf.template +63 -0
- teradataml/telemetry_utils/__init__.py +0 -0
- teradataml/telemetry_utils/queryband.py +52 -0
- teradataml/utils/dtypes.py +4 -2
- teradataml/utils/validators.py +34 -2
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/METADATA +311 -3
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/RECORD +240 -157
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/WHEEL +0 -0
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/top_level.txt +0 -0
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/zip-safe +0 -0
|
@@ -41,7 +41,7 @@ def Convolve(data1=None, data1_filter_expr=None, data2=None,
|
|
|
41
41
|
data2:
|
|
42
42
|
Required Argument.
|
|
43
43
|
Specifies the actual filter kernel.
|
|
44
|
-
|
|
44
|
+
The time series have the following TDSeries characteristics.
|
|
45
45
|
1. "payload_content" must have one of these values:
|
|
46
46
|
* REAL
|
|
47
47
|
* COMPLEX
|
|
@@ -64,18 +64,21 @@ def Convolve(data1=None, data1_filter_expr=None, data2=None,
|
|
|
64
64
|
|
|
65
65
|
algorithm:
|
|
66
66
|
Optional Argument.
|
|
67
|
-
Specifies the options to use for convolving.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
Specifies the options to use for convolving.
|
|
68
|
+
By default, the function selects the best option based
|
|
69
|
+
on the number of entries present in the two inputs,
|
|
70
|
+
and their types ( REAL, COMPLEX, and so on.)
|
|
71
|
+
CONV_SUMMATION only supports:
|
|
72
|
+
* REAL, REAL
|
|
73
|
+
* REAL, MULTIVAR_REAL
|
|
74
|
+
* MULTIVAR_REAL, REAL
|
|
75
|
+
* MULTIVAR_REAL, MULTIVAR_REAL
|
|
74
76
|
Note:
|
|
75
77
|
* This parameter is usually used for testing.
|
|
76
78
|
If this parameter is not included, the internal
|
|
77
|
-
planning logic selects the best option based
|
|
78
|
-
|
|
79
|
+
planning logic selects the best option based on
|
|
80
|
+
the number of entries present in the two inputs,
|
|
81
|
+
and their types ( REAL, COMPLEX, and so on.)
|
|
79
82
|
Permitted Values: CONV_SUMMATION, CONV_DFFT
|
|
80
83
|
Types: str
|
|
81
84
|
|
|
@@ -154,7 +154,6 @@ def Convolve2(data1=None, data1_filter_expr=None, data2=None,
|
|
|
154
154
|
data3 = DataFrame.from_table("Convolve2RealsLeft")
|
|
155
155
|
data4 = DataFrame.from_table("Convolve2RealsLeft")
|
|
156
156
|
|
|
157
|
-
|
|
158
157
|
# Example 1: Apply the Convolve2() function when payload fields of two matrices
|
|
159
158
|
# are the different to convolve two matrices into a new source
|
|
160
159
|
# image matrix.
|
|
@@ -168,6 +167,7 @@ def Convolve2(data1=None, data1_filter_expr=None, data2=None,
|
|
|
168
167
|
column_index='column_i',
|
|
169
168
|
payload_field=["B"],
|
|
170
169
|
payload_content="REAL")
|
|
170
|
+
|
|
171
171
|
data2_matrix_df = TDMatrix(data=data2,
|
|
172
172
|
id='id',
|
|
173
173
|
row_index_style="sequence",
|
|
@@ -176,6 +176,7 @@ def Convolve2(data1=None, data1_filter_expr=None, data2=None,
|
|
|
176
176
|
column_index='column_i',
|
|
177
177
|
payload_field=["A"],
|
|
178
178
|
payload_content="REAL")
|
|
179
|
+
|
|
179
180
|
# Convolve the "data1_matrix_df" and "data2_matrix_df" matrices using the Convolve2() function.
|
|
180
181
|
uaf_out1 = Convolve2(data1=data1_matrix_df,
|
|
181
182
|
data2=data2_matrix_df,
|
|
@@ -196,6 +197,7 @@ def Convolve2(data1=None, data1_filter_expr=None, data2=None,
|
|
|
196
197
|
column_index='col_seq',
|
|
197
198
|
payload_field=["A"],
|
|
198
199
|
payload_content="REAL")
|
|
200
|
+
|
|
199
201
|
data4_matrix_df = TDMatrix(data=data4,
|
|
200
202
|
id='id',
|
|
201
203
|
row_index_style="sequence",
|
|
@@ -204,6 +206,7 @@ def Convolve2(data1=None, data1_filter_expr=None, data2=None,
|
|
|
204
206
|
column_index='col_seq',
|
|
205
207
|
payload_field=["A"],
|
|
206
208
|
payload_content="REAL")
|
|
209
|
+
|
|
207
210
|
# Convolve the "data3_matrix_df" and "data4_matrix_df" matrices using the Convolve2() function.
|
|
208
211
|
uaf_out2 = Convolve2(data1=data3_matrix_df,
|
|
209
212
|
data2=data4_matrix_df,
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
def CopyArt(data=None, database_name = None,
|
|
2
|
+
table_name = None, map_name = None,
|
|
3
|
+
**generic_arguments):
|
|
4
|
+
"""
|
|
5
|
+
DESCRIPTION:
|
|
6
|
+
CopyArt() function creates a copy of an existing analytics result table (ART).
|
|
7
|
+
|
|
8
|
+
PARAMETERS:
|
|
9
|
+
data:
|
|
10
|
+
Required Argument.
|
|
11
|
+
Specifies the ART data to be copied.
|
|
12
|
+
Types: DataFrame
|
|
13
|
+
|
|
14
|
+
database_name:
|
|
15
|
+
Required Argument.
|
|
16
|
+
Specifies the name of the destination database for copied ART.
|
|
17
|
+
Types: str
|
|
18
|
+
|
|
19
|
+
table_name:
|
|
20
|
+
Required Argument.
|
|
21
|
+
Specifies the name of the destination table for copied ART.
|
|
22
|
+
Types: str
|
|
23
|
+
|
|
24
|
+
map_name:
|
|
25
|
+
Optional Argument.
|
|
26
|
+
Specifies the name of the map for the destination ART.
|
|
27
|
+
By default, it refers to the map of the 'data'.
|
|
28
|
+
Types: str
|
|
29
|
+
|
|
30
|
+
**generic_arguments:
|
|
31
|
+
Specifies the generic keyword arguments of UAF functions.
|
|
32
|
+
Below are the generic keyword arguments:
|
|
33
|
+
persist:
|
|
34
|
+
Optional Argument.
|
|
35
|
+
Specifies whether to persist the results of the
|
|
36
|
+
function in a table or not. When set to True,
|
|
37
|
+
results are persisted in a table; otherwise,
|
|
38
|
+
results are garbage collected at the end of the
|
|
39
|
+
session.
|
|
40
|
+
Note that, when UAF function is executed, an
|
|
41
|
+
analytic result table (ART) is created.
|
|
42
|
+
Default Value: False
|
|
43
|
+
Types: bool
|
|
44
|
+
|
|
45
|
+
volatile:
|
|
46
|
+
Optional Argument.
|
|
47
|
+
Specifies whether to put the results of the
|
|
48
|
+
function in a volatile ART or not. When set to
|
|
49
|
+
True, results are stored in a volatile ART,
|
|
50
|
+
otherwise not.
|
|
51
|
+
Default Value: False
|
|
52
|
+
Types: bool
|
|
53
|
+
|
|
54
|
+
output_table_name:
|
|
55
|
+
Optional Argument.
|
|
56
|
+
Specifies the name of the table to store results.
|
|
57
|
+
If not specified, a unique table name is internally
|
|
58
|
+
generated.
|
|
59
|
+
Types: str
|
|
60
|
+
|
|
61
|
+
output_db_name:
|
|
62
|
+
Optional Argument.
|
|
63
|
+
Specifies the name of the database to create output
|
|
64
|
+
table into. If not specified, table is created into
|
|
65
|
+
database specified by the user at the time of context
|
|
66
|
+
creation or configuration parameter. Argument is ignored,
|
|
67
|
+
if "output_table_name" is not specified.
|
|
68
|
+
Types: str
|
|
69
|
+
|
|
70
|
+
RETURNS:
|
|
71
|
+
Instance of CopyArt.
|
|
72
|
+
Output teradataml DataFrames can be accessed using attribute
|
|
73
|
+
references, such as obj.<attribute_name>.
|
|
74
|
+
Output teradataml DataFrame attribute name is:
|
|
75
|
+
1. result
|
|
76
|
+
|
|
77
|
+
RAISES:
|
|
78
|
+
TeradataMlException, TypeError, ValueError
|
|
79
|
+
|
|
80
|
+
EXAMPLES:
|
|
81
|
+
# Notes:
|
|
82
|
+
# 1. Get the connection to Vantage, before importing the
|
|
83
|
+
# function in user space.
|
|
84
|
+
# 2. User can import the function, if it is available on
|
|
85
|
+
# Vantage user is connected to.
|
|
86
|
+
# 3. To check the list of UAF analytic functions available
|
|
87
|
+
# on Vantage user connected to, use
|
|
88
|
+
# "display_analytic_functions()".
|
|
89
|
+
|
|
90
|
+
# Check the list of available UAF analytic functions.
|
|
91
|
+
display_analytic_functions(type="UAF")
|
|
92
|
+
|
|
93
|
+
# Import function CopyArt.
|
|
94
|
+
from teradataml import CopyArt, AutoArima
|
|
95
|
+
|
|
96
|
+
# Load the example data.
|
|
97
|
+
load_example_data("uaf", ["blood2ageandweight"])
|
|
98
|
+
|
|
99
|
+
# Create teradataml DataFrame object.
|
|
100
|
+
data = DataFrame.from_table("blood2ageandweight")
|
|
101
|
+
|
|
102
|
+
# Create teradataml TDSeries object.
|
|
103
|
+
data_series_df = TDSeries(data=data,
|
|
104
|
+
id="PatientID",
|
|
105
|
+
row_index="SeqNo",
|
|
106
|
+
row_index_style="SEQUENCE",
|
|
107
|
+
payload_field="BloodFat",
|
|
108
|
+
payload_content="REAL")
|
|
109
|
+
|
|
110
|
+
# Execute AutoArima function to create ART.
|
|
111
|
+
uaf_out = AutoArima(data=data_series_df,
|
|
112
|
+
start_pq_nonseasonal=[1, 1],
|
|
113
|
+
seasonal=False,
|
|
114
|
+
constant=True,
|
|
115
|
+
algorithm="MLE",
|
|
116
|
+
fit_percentage=80,
|
|
117
|
+
stepwise=True,
|
|
118
|
+
nmodels=7,
|
|
119
|
+
fit_metrics=True,
|
|
120
|
+
residuals=True)
|
|
121
|
+
|
|
122
|
+
# Example 1: Execute CopyArt function to copy ART to a destination table name
|
|
123
|
+
# with persist option.
|
|
124
|
+
res = CopyArt(data=uaf_out.result,
|
|
125
|
+
database_name="alice",
|
|
126
|
+
table_name="copied_table",
|
|
127
|
+
persist=True)
|
|
128
|
+
print(res.result)
|
|
129
|
+
|
|
130
|
+
# Example 2: Execute CopyArt function to copy ART to a destination table name.
|
|
131
|
+
res = CopyArt(data=uaf_out.result,
|
|
132
|
+
database_name="alice",
|
|
133
|
+
table_name="copied_table2")
|
|
134
|
+
|
|
135
|
+
# Print the result DataFrame.
|
|
136
|
+
print(res.result)
|
|
137
|
+
|
|
138
|
+
# Example 3: Copy ART to a destination table name using uaf object.
|
|
139
|
+
res = uaf_out.copy(database_name="alice",
|
|
140
|
+
table_name="copied_table3")
|
|
141
|
+
|
|
142
|
+
# Print the result DataFrame.
|
|
143
|
+
print(res.result)
|
|
144
|
+
|
|
145
|
+
"""
|
|
@@ -21,7 +21,7 @@ def CumulPeriodogram(data=None, data_filter_expr=None,
|
|
|
21
21
|
2. Use ArimaValidate() to validate spectral candidates.
|
|
22
22
|
4. Execute CumulPeriodogram() using the residuals.
|
|
23
23
|
5. See the null hypothesis result from CumulPeriodogram().
|
|
24
|
-
6. Use
|
|
24
|
+
6. Use DataFrame.plot() to plot the results.
|
|
25
25
|
|
|
26
26
|
PARAMETERS:
|
|
27
27
|
data:
|
|
@@ -143,7 +143,6 @@ def CumulPeriodogram(data=None, data_filter_expr=None,
|
|
|
143
143
|
fit_metrics=True,
|
|
144
144
|
residuals=True)
|
|
145
145
|
|
|
146
|
-
|
|
147
146
|
# Example 1: Perform statistical test using CumulPeriodogram()
|
|
148
147
|
# with input as TDSeries object created over the 'fitresiduals'
|
|
149
148
|
# attribute of arima_validate generated by running ArimaValidate() and
|
|
@@ -158,7 +157,8 @@ def CumulPeriodogram(data=None, data_filter_expr=None,
|
|
|
158
157
|
payload_field="RESIDUAL",
|
|
159
158
|
payload_content="REAL")
|
|
160
159
|
|
|
161
|
-
uaf_out = CumulPeriodogram(data=data_series_df,
|
|
160
|
+
uaf_out = CumulPeriodogram(data=data_series_df,
|
|
161
|
+
significance_level=0.05)
|
|
162
162
|
|
|
163
163
|
# Print the result DataFrames.
|
|
164
164
|
print(uaf_out.result)
|
|
@@ -174,7 +174,8 @@ def CumulPeriodogram(data=None, data_filter_expr=None,
|
|
|
174
174
|
# generated by ArimaValidate() function with layer as 'ARTFITRESIDUALS'.
|
|
175
175
|
art_df = TDAnalyticResult(data=arima_validate.result, layer="ARTFITRESIDUALS")
|
|
176
176
|
|
|
177
|
-
uaf_out = CumulPeriodogram(data=art_df,
|
|
177
|
+
uaf_out = CumulPeriodogram(data=art_df,
|
|
178
|
+
significance_level=0.05)
|
|
178
179
|
|
|
179
180
|
# Print the result DataFrames.
|
|
180
181
|
print(uaf_out.result)
|
|
@@ -174,10 +174,10 @@ def DFFT2Conv(data=None, data_filter_expr=None, conv=None,
|
|
|
174
174
|
# input matrix with real numbers only for the matrix id 33.
|
|
175
175
|
filter_expr = td_matrix.id==33
|
|
176
176
|
dfft2_out = DFFT2(data=td_matrix,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
data_filter_expr=filter_expr,
|
|
178
|
+
freq_style="K_INTEGRAL",
|
|
179
|
+
human_readable=False,
|
|
180
|
+
output_fmt_content="COMPLEX")
|
|
181
181
|
|
|
182
182
|
# Example 1: Convert the complex(REAL,IMAGINARY) output of DFFT2() to
|
|
183
183
|
# polar(AMPLITUDE,PHASE) in RADIAN format using TDMatrix
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
def DWT(data1=None, data1_filter_expr=None, data2=None,
|
|
2
|
+
data2_filter_expr=None, wavelet=None, mode="symmetric",
|
|
3
|
+
level=1, part=None, input_fmt_input_mode=None,
|
|
4
|
+
output_fmt_index_style="NUMERICAL_SEQUENCE",
|
|
5
|
+
**generic_arguments):
|
|
6
|
+
"""
|
|
7
|
+
DESCRIPTION:
|
|
8
|
+
DWT() is a function that performs discrete wavelet
|
|
9
|
+
transform (DWT).
|
|
10
|
+
|
|
11
|
+
PARAMETERS:
|
|
12
|
+
data1:
|
|
13
|
+
Required Argument.
|
|
14
|
+
Specifies the series to be used as an input.
|
|
15
|
+
Multiple payloads are supported, and each payload column is
|
|
16
|
+
transformed independently. Only REAL or MULTIVAR_REAL
|
|
17
|
+
payload content types are supported.
|
|
18
|
+
Types: TDSeries
|
|
19
|
+
|
|
20
|
+
data1_filter_expr:
|
|
21
|
+
Optional Argument.
|
|
22
|
+
Specifies the filter expression for "data1".
|
|
23
|
+
Types: ColumnExpression
|
|
24
|
+
|
|
25
|
+
data2:
|
|
26
|
+
Optional Argument.
|
|
27
|
+
Specifies the series to be used as an input. The
|
|
28
|
+
series specifies the filter. It should have two payload
|
|
29
|
+
columns corresponding to low and high pass
|
|
30
|
+
filters. Only MULTIVAR_REAL payload content type is
|
|
31
|
+
supported.
|
|
32
|
+
Types: TDSeries
|
|
33
|
+
|
|
34
|
+
data2_filter_expr:
|
|
35
|
+
Optional Argument.
|
|
36
|
+
Specifies the filter expression for "data2".
|
|
37
|
+
Types: ColumnExpression
|
|
38
|
+
|
|
39
|
+
wavelet:
|
|
40
|
+
Optional Argument.
|
|
41
|
+
Specifies the name of the wavelet.
|
|
42
|
+
Option families and names are:
|
|
43
|
+
* Daubechies: 'db1' or 'haar', 'db2', 'db3', .... ,'db38'
|
|
44
|
+
* Coiflets: 'coif1', 'coif2', ... , 'coif17'
|
|
45
|
+
* Symlets: 'sym2', 'sym3', ... ,' sym20'
|
|
46
|
+
* Discrete Meyer: 'dmey'
|
|
47
|
+
* Biorthogonal: 'bior1.1', 'bior1.3', 'bior1.5',
|
|
48
|
+
'bior2.2', 'bior2.4', 'bior2.6',
|
|
49
|
+
'bior2.8', 'bior3.1', 'bior3.3',
|
|
50
|
+
'bior3.5', 'bior3.7', 'bior3.9',
|
|
51
|
+
'bior4.4', 'bior5.5', 'bior6.8'
|
|
52
|
+
* Reverse Biorthogonal: 'rbio1.1', 'rbio1.3',
|
|
53
|
+
'rbio1.5' 'rbio2.2',
|
|
54
|
+
'rbio2.4', 'rbio2.6',
|
|
55
|
+
'rbio2.8', 'rbio3.1',
|
|
56
|
+
'rbio3.3', 'rbio3.5',
|
|
57
|
+
'rbio3.7','rbio3.9',
|
|
58
|
+
'rbio4.4', 'rbio5.5',
|
|
59
|
+
'rbio6.8'
|
|
60
|
+
Note:
|
|
61
|
+
* If 'wavelet' is specified, do not include a second
|
|
62
|
+
input series for the function. Otherwise, include
|
|
63
|
+
a second input series to provide the filter.
|
|
64
|
+
* Data type is case-sensitive.
|
|
65
|
+
Types: str
|
|
66
|
+
|
|
67
|
+
mode:
|
|
68
|
+
Optional Argument.
|
|
69
|
+
Specifies the signal extension mode. Data type is
|
|
70
|
+
case-insensitive.
|
|
71
|
+
Permitted Values:
|
|
72
|
+
* symmetric, sym, symh
|
|
73
|
+
* reflect, symw
|
|
74
|
+
* smooth, spd, sp1
|
|
75
|
+
* constant, sp0
|
|
76
|
+
* zero, zpd
|
|
77
|
+
* periodic, ppd
|
|
78
|
+
* periodization, per
|
|
79
|
+
* antisymmetric, asym, asymh
|
|
80
|
+
* antireflect, asymw
|
|
81
|
+
Default Value: symmetric
|
|
82
|
+
Types: str
|
|
83
|
+
|
|
84
|
+
level:
|
|
85
|
+
Optional Argument.
|
|
86
|
+
Specifies the level of decomposition.
|
|
87
|
+
Valid values are [1,15].
|
|
88
|
+
Default Value: 1
|
|
89
|
+
Types: int
|
|
90
|
+
|
|
91
|
+
part:
|
|
92
|
+
Optional Argument.
|
|
93
|
+
Specifies the indicator that the input is partial decomposition
|
|
94
|
+
result.
|
|
95
|
+
Note:
|
|
96
|
+
Data type is case-insensitive.
|
|
97
|
+
Permitted Values:
|
|
98
|
+
* a - the approximation
|
|
99
|
+
* d - the detail of decomposition of result.
|
|
100
|
+
Types: str
|
|
101
|
+
|
|
102
|
+
input_fmt_input_mode:
|
|
103
|
+
Optional Argument.
|
|
104
|
+
Specifies the input mode supported by the function.
|
|
105
|
+
When there are two input series, then the input_fmt_input_mode
|
|
106
|
+
specification is mandatory.
|
|
107
|
+
Permitted Values:
|
|
108
|
+
The input_fmt_input_mode parameter has the following options:
|
|
109
|
+
* ONE2ONE: Both the primary and secondary series
|
|
110
|
+
specifications contain a series name which
|
|
111
|
+
identifies the two series in the function.
|
|
112
|
+
* MANY2ONE: The MANY specification is the primary series
|
|
113
|
+
declaration. The secondary series specification
|
|
114
|
+
contains a series name that identifies the single
|
|
115
|
+
secondary series.
|
|
116
|
+
* MATCH: Both series are defined by their respective series
|
|
117
|
+
specification instance name declarations.
|
|
118
|
+
Types: str
|
|
119
|
+
|
|
120
|
+
output_fmt_index_style:
|
|
121
|
+
Optional Argument.
|
|
122
|
+
Specifies the index style of the output format.
|
|
123
|
+
Permitted Values: NUMERICAL_SEQUENCE
|
|
124
|
+
Default Value: NUMERICAL_SEQUENCE
|
|
125
|
+
Types: str
|
|
126
|
+
|
|
127
|
+
**generic_arguments:
|
|
128
|
+
Specifies the generic keyword arguments of UAF functions.
|
|
129
|
+
Below are the generic keyword arguments:
|
|
130
|
+
persist:
|
|
131
|
+
Optional Argument.
|
|
132
|
+
Specifies whether to persist the results of the
|
|
133
|
+
function in a table or not. When set to True,
|
|
134
|
+
results are persisted in a table; otherwise,
|
|
135
|
+
results are garbage collected at the end of the
|
|
136
|
+
session.
|
|
137
|
+
Note that, when UAF function is executed, an
|
|
138
|
+
analytic result table (ART) is created.
|
|
139
|
+
Default Value: False
|
|
140
|
+
Types: bool
|
|
141
|
+
|
|
142
|
+
volatile:
|
|
143
|
+
Optional Argument.
|
|
144
|
+
Specifies whether to put the results of the
|
|
145
|
+
function in a volatile ART or not. When set to
|
|
146
|
+
True, results are stored in a volatile ART,
|
|
147
|
+
otherwise not.
|
|
148
|
+
Default Value: False
|
|
149
|
+
Types: bool
|
|
150
|
+
|
|
151
|
+
output_table_name:
|
|
152
|
+
Optional Argument.
|
|
153
|
+
Specifies the name of the table to store results.
|
|
154
|
+
If not specified, a unique table name is internally
|
|
155
|
+
generated.
|
|
156
|
+
Types: str
|
|
157
|
+
|
|
158
|
+
output_db_name:
|
|
159
|
+
Optional Argument.
|
|
160
|
+
Specifies the name of the database to create output
|
|
161
|
+
table into. If not specified, table is created into
|
|
162
|
+
database specified by the user at the time of context
|
|
163
|
+
creation or configuration parameter. Argument is ignored,
|
|
164
|
+
if "output_table_name" is not specified.
|
|
165
|
+
Types: str
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
RETURNS:
|
|
169
|
+
Instance of DWT.
|
|
170
|
+
Output teradataml DataFrames can be accessed using attribute
|
|
171
|
+
references, such as DWT_obj.<attribute_name>.
|
|
172
|
+
Output teradataml DataFrame attribute name is:
|
|
173
|
+
1. result
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
RAISES:
|
|
177
|
+
TeradataMlException, TypeError, ValueError
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
EXAMPLES:
|
|
181
|
+
# Notes:
|
|
182
|
+
# 1. Get the connection to Vantage, before importing the
|
|
183
|
+
# function in user space.
|
|
184
|
+
# 2. User can import the function, if it is available on
|
|
185
|
+
# Vantage user is connected to.
|
|
186
|
+
# 3. To check the list of UAF analytic functions available
|
|
187
|
+
# on Vantage user connected to, use
|
|
188
|
+
# "display_analytic_functions()".
|
|
189
|
+
|
|
190
|
+
# Check the list of available UAF analytic functions.
|
|
191
|
+
display_analytic_functions(type="UAF")
|
|
192
|
+
|
|
193
|
+
# Import function DWT.
|
|
194
|
+
from teradataml import DWT
|
|
195
|
+
|
|
196
|
+
# Load the example data.
|
|
197
|
+
load_example_data("uaf", ["dwt_dataTable", "dwt_filterTable"])
|
|
198
|
+
|
|
199
|
+
# Create teradataml DataFrame objects.
|
|
200
|
+
data1 = DataFrame.from_table("dwt_dataTable")
|
|
201
|
+
data2 = DataFrame.from_table("dwt_filterTable")
|
|
202
|
+
|
|
203
|
+
# Create teradataml TDSeries objects.
|
|
204
|
+
data1_series_df = TDSeries(data=data1,
|
|
205
|
+
id="id",
|
|
206
|
+
row_index="rowi",
|
|
207
|
+
row_index_style="SEQUENCE",
|
|
208
|
+
payload_field="v",
|
|
209
|
+
payload_content="REAL")
|
|
210
|
+
|
|
211
|
+
data2_series_df = TDSeries(data=data2,
|
|
212
|
+
id="id",
|
|
213
|
+
row_index="seq",
|
|
214
|
+
row_index_style="SEQUENCE",
|
|
215
|
+
payload_field=["lo", "hi"],
|
|
216
|
+
payload_content="MULTIVAR_REAL")
|
|
217
|
+
|
|
218
|
+
# Example 1: Perform discrete wavelet transform using two series as input.
|
|
219
|
+
uaf_out = DWT(data1=data1_series_df,
|
|
220
|
+
data2=data2_series_df,
|
|
221
|
+
data2_filter_expr=data2_series_df.id==1,
|
|
222
|
+
input_fmt_input_mode='MANY2ONE')
|
|
223
|
+
|
|
224
|
+
# Print the result DataFrame.
|
|
225
|
+
print(uaf_out.result)
|
|
226
|
+
|
|
227
|
+
# Example 2: Perform discrete wavelet transform using single series as input and the wavelet parameter.
|
|
228
|
+
uaf_out = DWT(data1=data1_series_df,
|
|
229
|
+
wavelet='haar')
|
|
230
|
+
|
|
231
|
+
# Print the result DataFrame.
|
|
232
|
+
print(uaf_out.result)
|
|
233
|
+
|
|
234
|
+
"""
|
|
235
|
+
|