teradataml 20.0.0.0__py3-none-any.whl → 20.0.0.2__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.

Files changed (263) hide show
  1. teradataml/LICENSE-3RD-PARTY.pdf +0 -0
  2. teradataml/LICENSE.pdf +0 -0
  3. teradataml/README.md +183 -0
  4. teradataml/__init__.py +6 -3
  5. teradataml/_version.py +2 -2
  6. teradataml/analytics/__init__.py +3 -2
  7. teradataml/analytics/analytic_function_executor.py +275 -40
  8. teradataml/analytics/analytic_query_generator.py +92 -0
  9. teradataml/analytics/byom/__init__.py +3 -2
  10. teradataml/analytics/json_parser/metadata.py +1 -0
  11. teradataml/analytics/json_parser/utils.py +17 -21
  12. teradataml/analytics/meta_class.py +40 -1
  13. teradataml/analytics/sqle/DecisionTreePredict.py +1 -1
  14. teradataml/analytics/sqle/__init__.py +10 -2
  15. teradataml/analytics/table_operator/__init__.py +3 -2
  16. teradataml/analytics/uaf/__init__.py +21 -2
  17. teradataml/analytics/utils.py +62 -1
  18. teradataml/analytics/valib.py +1 -1
  19. teradataml/automl/__init__.py +1553 -319
  20. teradataml/automl/custom_json_utils.py +139 -61
  21. teradataml/automl/data_preparation.py +276 -319
  22. teradataml/automl/data_transformation.py +163 -81
  23. teradataml/automl/feature_engineering.py +402 -239
  24. teradataml/automl/feature_exploration.py +9 -2
  25. teradataml/automl/model_evaluation.py +48 -51
  26. teradataml/automl/model_training.py +291 -189
  27. teradataml/catalog/byom.py +8 -8
  28. teradataml/catalog/model_cataloging_utils.py +1 -1
  29. teradataml/clients/auth_client.py +133 -0
  30. teradataml/clients/pkce_client.py +1 -1
  31. teradataml/common/aed_utils.py +3 -2
  32. teradataml/common/constants.py +48 -6
  33. teradataml/common/deprecations.py +13 -7
  34. teradataml/common/garbagecollector.py +156 -120
  35. teradataml/common/messagecodes.py +6 -1
  36. teradataml/common/messages.py +3 -1
  37. teradataml/common/sqlbundle.py +1 -1
  38. teradataml/common/utils.py +103 -11
  39. teradataml/common/wrapper_utils.py +1 -1
  40. teradataml/context/context.py +121 -31
  41. teradataml/data/advertising.csv +201 -0
  42. teradataml/data/bank_marketing.csv +11163 -0
  43. teradataml/data/bike_sharing.csv +732 -0
  44. teradataml/data/boston2cols.csv +721 -0
  45. teradataml/data/breast_cancer.csv +570 -0
  46. teradataml/data/complaints_test_tokenized.csv +353 -0
  47. teradataml/data/complaints_tokens_model.csv +348 -0
  48. teradataml/data/covid_confirm_sd.csv +83 -0
  49. teradataml/data/customer_segmentation_test.csv +2628 -0
  50. teradataml/data/customer_segmentation_train.csv +8069 -0
  51. teradataml/data/dataframe_example.json +10 -0
  52. teradataml/data/docs/sqle/docs_17_10/OneHotEncodingFit.py +3 -1
  53. teradataml/data/docs/sqle/docs_17_10/OneHotEncodingTransform.py +6 -0
  54. teradataml/data/docs/sqle/docs_17_10/OutlierFilterTransform.py +5 -1
  55. teradataml/data/docs/sqle/docs_17_20/ANOVA.py +61 -1
  56. teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
  57. teradataml/data/docs/sqle/docs_17_20/ColumnTransformer.py +2 -0
  58. teradataml/data/docs/sqle/docs_17_20/FTest.py +105 -26
  59. teradataml/data/docs/sqle/docs_17_20/GLM.py +162 -1
  60. teradataml/data/docs/sqle/docs_17_20/GetFutileColumns.py +5 -3
  61. teradataml/data/docs/sqle/docs_17_20/KMeans.py +48 -1
  62. teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -0
  63. teradataml/data/docs/sqle/docs_17_20/NonLinearCombineFit.py +3 -2
  64. teradataml/data/docs/sqle/docs_17_20/OneHotEncodingFit.py +5 -0
  65. teradataml/data/docs/sqle/docs_17_20/OneHotEncodingTransform.py +6 -0
  66. teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +2 -0
  67. teradataml/data/docs/sqle/docs_17_20/Pivoting.py +279 -0
  68. teradataml/data/docs/sqle/docs_17_20/ROC.py +3 -2
  69. teradataml/data/docs/sqle/docs_17_20/SVMPredict.py +13 -2
  70. teradataml/data/docs/sqle/docs_17_20/ScaleFit.py +119 -1
  71. teradataml/data/docs/sqle/docs_17_20/ScaleTransform.py +93 -1
  72. teradataml/data/docs/sqle/docs_17_20/Shap.py +197 -0
  73. teradataml/data/docs/sqle/docs_17_20/TDGLMPredict.py +163 -1
  74. teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +189 -0
  75. teradataml/data/docs/sqle/docs_17_20/TFIDF.py +142 -0
  76. teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
  77. teradataml/data/docs/sqle/docs_17_20/XGBoost.py +12 -4
  78. teradataml/data/docs/sqle/docs_17_20/XGBoostPredict.py +7 -1
  79. teradataml/data/docs/sqle/docs_17_20/ZTest.py +72 -7
  80. teradataml/data/docs/uaf/docs_17_20/ACF.py +1 -10
  81. teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +1 -1
  82. teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +35 -5
  83. teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +3 -1
  84. teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +293 -0
  85. teradataml/data/docs/uaf/docs_17_20/AutoArima.py +354 -0
  86. teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +3 -2
  87. teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +1 -1
  88. teradataml/data/docs/uaf/docs_17_20/Convolve.py +13 -10
  89. teradataml/data/docs/uaf/docs_17_20/Convolve2.py +4 -1
  90. teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +5 -4
  91. teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +4 -4
  92. teradataml/data/docs/uaf/docs_17_20/DWT.py +235 -0
  93. teradataml/data/docs/uaf/docs_17_20/DWT2D.py +214 -0
  94. teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +1 -1
  95. teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +1 -1
  96. teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +160 -0
  97. teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +1 -1
  98. teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +9 -31
  99. teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +4 -2
  100. teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +1 -8
  101. teradataml/data/docs/uaf/docs_17_20/IDWT.py +236 -0
  102. teradataml/data/docs/uaf/docs_17_20/IDWT2D.py +226 -0
  103. teradataml/data/docs/uaf/docs_17_20/IQR.py +134 -0
  104. teradataml/data/docs/uaf/docs_17_20/LineSpec.py +1 -1
  105. teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +2 -2
  106. teradataml/data/docs/uaf/docs_17_20/MAMean.py +3 -3
  107. teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +297 -0
  108. teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +15 -6
  109. teradataml/data/docs/uaf/docs_17_20/PACF.py +0 -1
  110. teradataml/data/docs/uaf/docs_17_20/Portman.py +2 -2
  111. teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +2 -2
  112. teradataml/data/docs/uaf/docs_17_20/Resample.py +9 -1
  113. teradataml/data/docs/uaf/docs_17_20/SAX.py +246 -0
  114. teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +17 -10
  115. teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +1 -1
  116. teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +3 -1
  117. teradataml/data/docs/uaf/docs_17_20/WindowDFFT.py +368 -0
  118. teradataml/data/dwt2d_dataTable.csv +65 -0
  119. teradataml/data/dwt_dataTable.csv +8 -0
  120. teradataml/data/dwt_filterTable.csv +3 -0
  121. teradataml/data/finance_data4.csv +13 -0
  122. teradataml/data/glm_example.json +28 -1
  123. teradataml/data/grocery_transaction.csv +19 -0
  124. teradataml/data/housing_train_segment.csv +201 -0
  125. teradataml/data/idwt2d_dataTable.csv +5 -0
  126. teradataml/data/idwt_dataTable.csv +8 -0
  127. teradataml/data/idwt_filterTable.csv +3 -0
  128. teradataml/data/insect2Cols.csv +61 -0
  129. teradataml/data/interval_data.csv +5 -0
  130. teradataml/data/jsons/paired_functions.json +14 -0
  131. teradataml/data/jsons/sqle/17.20/TD_ANOVA.json +99 -27
  132. teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
  133. teradataml/data/jsons/sqle/17.20/TD_FTest.json +166 -83
  134. teradataml/data/jsons/sqle/17.20/TD_GLM.json +90 -14
  135. teradataml/data/jsons/sqle/17.20/TD_GLMPREDICT.json +48 -5
  136. teradataml/data/jsons/sqle/17.20/TD_GetFutileColumns.json +5 -3
  137. teradataml/data/jsons/sqle/17.20/TD_KMeans.json +31 -11
  138. teradataml/data/jsons/sqle/17.20/TD_NaiveBayes.json +193 -0
  139. teradataml/data/jsons/sqle/17.20/TD_NaiveBayesPredict.json +212 -0
  140. teradataml/data/jsons/sqle/17.20/TD_NonLinearCombineFit.json +3 -2
  141. teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +9 -9
  142. teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
  143. teradataml/data/jsons/sqle/17.20/TD_ROC.json +2 -1
  144. teradataml/data/jsons/sqle/17.20/TD_SVM.json +16 -16
  145. teradataml/data/jsons/sqle/17.20/TD_SVMPredict.json +19 -1
  146. teradataml/data/jsons/sqle/17.20/TD_ScaleFit.json +168 -15
  147. teradataml/data/jsons/sqle/17.20/TD_ScaleTransform.json +50 -1
  148. teradataml/data/jsons/sqle/17.20/TD_Shap.json +222 -0
  149. teradataml/data/jsons/sqle/17.20/TD_TFIDF.json +162 -0
  150. teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
  151. teradataml/data/jsons/sqle/17.20/TD_XGBoost.json +25 -7
  152. teradataml/data/jsons/sqle/17.20/TD_XGBoostPredict.json +17 -4
  153. teradataml/data/jsons/sqle/17.20/TD_ZTest.json +157 -80
  154. teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
  155. teradataml/data/jsons/uaf/17.20/TD_ACF.json +1 -18
  156. teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +3 -16
  157. teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +0 -3
  158. teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +5 -3
  159. teradataml/data/jsons/uaf/17.20/TD_ARIMAXESTIMATE.json +362 -0
  160. teradataml/data/jsons/uaf/17.20/TD_AUTOARIMA.json +469 -0
  161. teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +0 -3
  162. teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +0 -2
  163. teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +2 -1
  164. teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +2 -5
  165. teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +3 -6
  166. teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +1 -3
  167. teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +0 -5
  168. teradataml/data/jsons/uaf/17.20/TD_DFFT.json +1 -4
  169. teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +2 -7
  170. teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +1 -2
  171. teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +0 -2
  172. teradataml/data/jsons/uaf/17.20/TD_DTW.json +3 -6
  173. teradataml/data/jsons/uaf/17.20/TD_DWT.json +173 -0
  174. teradataml/data/jsons/uaf/17.20/TD_DWT2D.json +160 -0
  175. teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +1 -1
  176. teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +16 -30
  177. teradataml/data/jsons/uaf/17.20/{TD_HOLT_WINTERS_FORECAST.json → TD_HOLT_WINTERS_FORECASTER.json} +1 -2
  178. teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +1 -15
  179. teradataml/data/jsons/uaf/17.20/TD_IDWT.json +162 -0
  180. teradataml/data/jsons/uaf/17.20/TD_IDWT2D.json +149 -0
  181. teradataml/data/jsons/uaf/17.20/TD_IQR.json +117 -0
  182. teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +1 -1
  183. teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +1 -1
  184. teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +1 -3
  185. teradataml/data/jsons/uaf/17.20/TD_MATRIX2IMAGE.json +209 -0
  186. teradataml/data/jsons/uaf/17.20/TD_PACF.json +2 -2
  187. teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +5 -5
  188. teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +48 -28
  189. teradataml/data/jsons/uaf/17.20/TD_SAX.json +208 -0
  190. teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +12 -6
  191. teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +0 -1
  192. teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +8 -8
  193. teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +1 -1
  194. teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +1 -1
  195. teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +400 -0
  196. teradataml/data/kmeans_example.json +5 -0
  197. teradataml/data/kmeans_table.csv +10 -0
  198. teradataml/data/load_example_data.py +8 -2
  199. teradataml/data/naivebayestextclassifier_example.json +1 -1
  200. teradataml/data/naivebayestextclassifierpredict_example.json +11 -0
  201. teradataml/data/onehot_encoder_train.csv +4 -0
  202. teradataml/data/openml_example.json +29 -0
  203. teradataml/data/peppers.png +0 -0
  204. teradataml/data/real_values.csv +14 -0
  205. teradataml/data/sax_example.json +8 -0
  206. teradataml/data/scale_attributes.csv +3 -0
  207. teradataml/data/scale_example.json +52 -1
  208. teradataml/data/scale_input_part_sparse.csv +31 -0
  209. teradataml/data/scale_input_partitioned.csv +16 -0
  210. teradataml/data/scale_input_sparse.csv +11 -0
  211. teradataml/data/scale_parameters.csv +3 -0
  212. teradataml/data/scripts/deploy_script.py +21 -2
  213. teradataml/data/scripts/sklearn/sklearn_fit.py +40 -37
  214. teradataml/data/scripts/sklearn/sklearn_fit_predict.py +22 -30
  215. teradataml/data/scripts/sklearn/sklearn_function.template +42 -24
  216. teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +23 -33
  217. teradataml/data/scripts/sklearn/sklearn_neighbors.py +19 -28
  218. teradataml/data/scripts/sklearn/sklearn_score.py +32 -32
  219. teradataml/data/scripts/sklearn/sklearn_transform.py +85 -42
  220. teradataml/data/star_pivot.csv +8 -0
  221. teradataml/data/templates/open_source_ml.json +2 -1
  222. teradataml/data/teradataml_example.json +97 -1
  223. teradataml/data/timestamp_data.csv +4 -0
  224. teradataml/data/titanic_dataset_unpivoted.csv +19 -0
  225. teradataml/data/uaf_example.json +55 -1
  226. teradataml/data/unpivot_example.json +15 -0
  227. teradataml/data/url_data.csv +9 -0
  228. teradataml/data/windowdfft.csv +16 -0
  229. teradataml/data/ztest_example.json +16 -0
  230. teradataml/dataframe/copy_to.py +9 -4
  231. teradataml/dataframe/data_transfer.py +125 -64
  232. teradataml/dataframe/dataframe.py +575 -57
  233. teradataml/dataframe/dataframe_utils.py +47 -9
  234. teradataml/dataframe/fastload.py +273 -90
  235. teradataml/dataframe/functions.py +339 -0
  236. teradataml/dataframe/row.py +160 -0
  237. teradataml/dataframe/setop.py +2 -2
  238. teradataml/dataframe/sql.py +740 -18
  239. teradataml/dataframe/window.py +1 -1
  240. teradataml/dbutils/dbutils.py +324 -18
  241. teradataml/geospatial/geodataframe.py +1 -1
  242. teradataml/geospatial/geodataframecolumn.py +1 -1
  243. teradataml/hyperparameter_tuner/optimizer.py +13 -13
  244. teradataml/lib/aed_0_1.dll +0 -0
  245. teradataml/opensource/sklearn/_sklearn_wrapper.py +254 -122
  246. teradataml/options/__init__.py +16 -5
  247. teradataml/options/configure.py +39 -6
  248. teradataml/options/display.py +2 -2
  249. teradataml/plot/axis.py +4 -4
  250. teradataml/scriptmgmt/UserEnv.py +26 -19
  251. teradataml/scriptmgmt/lls_utils.py +120 -16
  252. teradataml/table_operators/Script.py +4 -5
  253. teradataml/table_operators/TableOperator.py +160 -26
  254. teradataml/table_operators/table_operator_util.py +88 -41
  255. teradataml/table_operators/templates/dataframe_udf.template +63 -0
  256. teradataml/telemetry_utils/__init__.py +0 -0
  257. teradataml/telemetry_utils/queryband.py +52 -0
  258. teradataml/utils/validators.py +41 -3
  259. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/METADATA +191 -6
  260. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/RECORD +263 -185
  261. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/WHEEL +0 -0
  262. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/top_level.txt +0 -0
  263. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/zip-safe +0 -0
@@ -0,0 +1,246 @@
1
+ def SAX(data=None, data_filter_expr=None, window_type='GLOBAL',
2
+ output_type='STRING', mean=None, std_dev=None,
3
+ window_size=None, output_frequency=1,
4
+ points_per_symbol=1, symbols_per_window=1,
5
+ alphabet_size=4, bitmap_level=2, code_stats=0,
6
+ breakpoints=None,
7
+ output_fmt_index_style="NUMERICAL_SEQUENCE",
8
+ **generic_arguments):
9
+ """
10
+ DESCRIPTION:
11
+ SAX() function uses Piecewise Aggregate Approximation (PAA) and
12
+ transform a timeseries into sequence of symbols.
13
+ The symbols can be characters, string, and bitmap.
14
+
15
+
16
+ PARAMETERS:
17
+ data:
18
+ Required Argument.
19
+ Specifies the time series whose value can be REAL or MULTIVAR_REAL.
20
+ Types: TDSeries
21
+
22
+ data_filter_expr:
23
+ Optional Argument.
24
+ Specifies the filter expression for "data".
25
+ Types: ColumnExpression
26
+
27
+ window_type:
28
+ Optional Argument.
29
+ Specifies the window type used in the SAX transformation.
30
+ Default Value: GLOBAL
31
+ Permitted Values: GLOBAL, SLIDING
32
+ Types: str
33
+
34
+ output_type:
35
+ Optional Argument.
36
+ Specifies the output format of the result.
37
+ Default Value: STRING
38
+ Permitted Values: STRING, BITMAP, O_CHARS
39
+ Types: str
40
+
41
+ mean:
42
+ Optional Argument.
43
+ Specifies the global mean values that used to
44
+ calculate the SAX code for every partition.
45
+ Note:
46
+ * If "mean" not specified, the function calculates the mean values
47
+ for every partition.
48
+ * If "mean" specifies a single value but there are multiple payloads,
49
+ the specified value will apply to all payloads.
50
+ * If "mean" specifies multiple values, each value will be
51
+ applied to its corresponding payload.
52
+ Types: float, list of float
53
+
54
+ std_dev:
55
+ Optional Argument.
56
+ Specifies the global standard deviation values that used to
57
+ calculate the SAX code for every partition.
58
+ Note:
59
+ * If "std_dev" not specified, the function calculates the standard
60
+ deviation values for every partition.
61
+ * If "std_dev" specifies a single value but there are multiple payloads,
62
+ the specified value will apply to all payloads.
63
+ * If "std_dev" specifies multiple values, each value will be
64
+ applied to its corresponding payload.
65
+ Types: float, list of float
66
+
67
+ window_size:
68
+ Optional Argument, Required if "window_type" is SLIDING.
69
+ Specifies the size of the window used in the SAX
70
+ transformation. Maximum value is 64000.
71
+ Types: int
72
+
73
+ output_frequency:
74
+ Optional Argument.
75
+ Specifies the number of data points that the window slides
76
+ between successive outputs.
77
+ Note:
78
+ * "output_frequency" is valid only for SLIDING "window_type".
79
+ Default Value: 1
80
+ Types: int
81
+
82
+ points_per_symbol:
83
+ Optional Argument.
84
+ Specifies the number of data points to be converted to one SAX
85
+ symbol.
86
+ Note:
87
+ * "points_per_symbol" is valid for GLOBAL "window_type".
88
+ Default Value: 1
89
+ Types: int
90
+
91
+ symbols_per_window:
92
+ Optional Argument.
93
+ Specifies the number of SAX symbols to be generated for each
94
+ window.
95
+ Note:
96
+ * "symbols_per_window" is valid for SLIDING "window_type".
97
+ Default Value: 1
98
+ Types: int
99
+
100
+ alphabet_size:
101
+ Optional Argument.
102
+ Specifies the number of symbols in the SAX alphabet.
103
+ The alphabet consists of letters from 'a' to 't'.
104
+ The size of the alphabet must be less than or equal to 20
105
+ and greater than or equal to 2.
106
+ Default Value: 4
107
+ Types: int
108
+
109
+ bitmap_level:
110
+ Optional Argument.
111
+ Specifies the level of the bitmap. The bitmap level
112
+ determines the number of consecutive symbols to be
113
+ converted to one symbol on a bitmap.
114
+ "bitmap_level" must be greater than or equal to 1 and less than or equal to 4.
115
+ Default Value: 2
116
+ Types: int
117
+
118
+ code_stats:
119
+ Optional Argument.
120
+ Specifies whether to print the mean and standard deviation
121
+ Default Value: 0
122
+ Types: int
123
+
124
+ breakpoints:
125
+ Optional Argument.
126
+ Specifies the breakpoints to form the SAX code based on "data".
127
+ Types: float, list of float
128
+
129
+ output_fmt_index_style:
130
+ Optional Argument.
131
+ Specifies the index style of the output format.
132
+ Permitted Values: NUMERICAL_SEQUENCE
133
+ Default Value: NUMERICAL_SEQUENCE
134
+ Types: str
135
+
136
+ **generic_arguments:
137
+ Specifies the generic keyword arguments of UAF functions.
138
+ Below are the generic keyword arguments:
139
+ persist:
140
+ Optional Argument.
141
+ Specifies whether to persist the results of the
142
+ function in a table or not. When set to True,
143
+ results are persisted in a table; otherwise,
144
+ results are garbage collected at the end of the
145
+ session.
146
+ Note that, when UAF function is executed, an
147
+ analytic result table (ART) is created.
148
+ Default Value: False
149
+ Types: bool
150
+
151
+ volatile:
152
+ Optional Argument.
153
+ Specifies whether to put the results of the
154
+ function in a volatile ART or not. When set to
155
+ True, results are stored in a volatile ART,
156
+ otherwise not.
157
+ Default Value: False
158
+ Types: bool
159
+
160
+ output_table_name:
161
+ Optional Argument.
162
+ Specifies the name of the table to store results.
163
+ If not specified, a unique table name is internally
164
+ generated.
165
+ Types: str
166
+
167
+ output_db_name:
168
+ Optional Argument.
169
+ Specifies the name of the database to create output
170
+ table into. If not specified, table is created into
171
+ database specified by the user at the time of context
172
+ creation or configuration parameter. Argument is ignored,
173
+ if "output_table_name" is not specified.
174
+ Types: str
175
+
176
+
177
+ RETURNS:
178
+ Instance of SAX.
179
+ Output teradataml DataFrames can be accessed using attribute
180
+ references, such as SAX_obj.<attribute_name>.
181
+ Output teradataml DataFrame attribute name is:
182
+ 1. result
183
+
184
+
185
+ RAISES:
186
+ TeradataMlException, TypeError, ValueError
187
+
188
+
189
+ EXAMPLES:
190
+ # Notes:
191
+ # 1. Get the connection to Vantage, before importing the
192
+ # function in user space.
193
+ # 2. User can import the function, if it is available on
194
+ # Vantage user is connected to.
195
+ # 3. To check the list of UAF analytic functions available
196
+ # on Vantage user connected to, use
197
+ # "display_analytic_functions()".
198
+
199
+ # Check the list of available UAF analytic functions.
200
+ display_analytic_functions(type="UAF")
201
+
202
+ # Import function SAX.
203
+ from teradataml import SAX
204
+
205
+ # Load the example data.
206
+ load_example_data("sax", ["finance_data4"])
207
+
208
+ # Create teradataml DataFrame object.
209
+ data = DataFrame.from_table("finance_data4")
210
+
211
+ # Create teradataml TDSeries object.
212
+ data_series_df = TDSeries(data=data,
213
+ id="id",
214
+ row_index="period",
215
+ row_index_style="SEQUENCE",
216
+ payload_field=["expenditure", "income", "investment"],
217
+ payload_content="MULTIVAR_REAL")
218
+
219
+ # Example 1: Execute SAX() function on the TDSeries to transform the
220
+ # time series into sequence of symbols using GLOBAL window.
221
+ uaf_out = SAX(data=data_series_df,
222
+ window_type='GLOBAL',
223
+ output_type='STRING',
224
+ mean=[2045.16666, 2387.41666,759.083333],
225
+ std_dev=[256.612489,317.496587,113.352594],
226
+ output_frequency=1,
227
+ points_per_symbol=2,
228
+ alphabet_size=10,
229
+ code_stats=True)
230
+
231
+ # Print the result DataFrame.
232
+ print(uaf_out.result)
233
+
234
+ # Example 2: Execute SAX() function on the TDSeries to transform the
235
+ # time series into sequence of symbols using SLIDING window.
236
+ uaf_out1 = SAX(data=data_series_df,
237
+ window_type='SLIDING',
238
+ window_size=4,
239
+ symbols_per_window=5,
240
+ code_stats=True)
241
+
242
+ # Print the result DataFrame.
243
+ print(uaf_out1.result)
244
+
245
+ """
246
+
@@ -4,24 +4,31 @@ def SeasonalNormalize(data=None, data_filter_expr=None, season_cycle=None,
4
4
  **generic_arguments):
5
5
  """
6
6
  DESCRIPTION:
7
- The function SeasonalNormalize() takes a non-stationary series and
8
- normalizes the series by removing the unit roots. The function can
9
- be used with any cyclic data that can be subdivided into a collection
10
- of logical periods, in which each period can be further subdivided
11
- into a collection of logical intervals.
7
+ SeasonalNormalize() takes a non-stationary series and normalizes the
8
+ series by first dividing the series into cycles and intervals, then averaging
9
+ and normalizing with respect to each interval over all cycles.
10
+ This form of normalization is effective relative to eliminating
11
+ non-stationary properties such as unit roots and periodicities.
12
12
 
13
13
  The following procedure is an example of how to use SeasonalNormalize():
14
14
  1. Detect the unit roots using DickeyFuller().
15
- 2. Use DIFF() or SeasonalNormalize() to eliminate unit roots.
16
- 3. Use Unnormalize() to undo the effects of SeasonalNormalize(),
17
- and compare it to the original series.
15
+ 2. Use SeasonalNormalize() to create a series with potentially the unit roots eliminated.
16
+ 3. Use DickeyFuller() to verify that unit roots were eliminated from the newly-formed normalized series.
17
+ 4. Use ArimaEstimate() and ArimaValidate() to create an ARIMA model from the normalized series.
18
+ 5. Use ArimaForecast() to forecast the normalized series.
19
+ 6. Use Unnormalize() passing in the forecasted series and the original unnormalized series to
20
+ produce a forecasted series with the effects of SeasonalNormalize() removed.
18
21
 
19
22
 
20
23
  PARAMETERS:
21
24
  data:
22
25
  Required Argument.
23
- Specifies a logical-runtime series, with real number
24
- elements.
26
+ Single input source that contains univariate series instances.
27
+ The associated "payload_content" is 'REAL'.
28
+ The payload is the series element magnitude.
29
+ TDSeries must include the usage of the "interval" parameter
30
+ that is the interval to used by the function to divide the
31
+ series cycles into intervals.
25
32
  Types: TDSeries
26
33
 
27
34
  data_filter_expr:
@@ -16,7 +16,7 @@ def SignifPeriodicities(data=None, data_filter_expr=None,
16
16
  SignifPeriodicities():
17
17
  1. Use ArimaEstimate() to identify spectral candidates.
18
18
  2. Use ArimaValidate() to validate spectral candidates.
19
- 3. Use Plot() to plot the results.
19
+ 3. Use DataFrame.plot() to plot the results.
20
20
  4. Compute the test statistic.
21
21
  5. Use SignifPeriodicities() on the periodicities of interest.
22
22
  More than one periodicities can be entered using the
@@ -161,7 +161,9 @@ def WhitesGeneral(data=None, data_filter_expr=None, variables_count=None,
161
161
  payload_field=["ACTUAL_VALUE","CALC_VALUE","RESIDUAL"],
162
162
  payload_content="MULTIVAR_REAL")
163
163
 
164
- uaf_out1 = WhitesGeneral(data=data_series_df, variables_count=3, significance_level=0.05)
164
+ uaf_out1 = WhitesGeneral(data=data_series_df,
165
+ variables_count=3,
166
+ significance_level=0.05)
165
167
 
166
168
  # Print the result DataFrame.
167
169
  print(uaf_out1.result)
@@ -0,0 +1,368 @@
1
+ def WindowDFFT(data=None, data_filter_expr=None, dfft_algorithm=None,
2
+ dfft_zero_padding_ok=True, dfft_freq_style="K_INTEGRAL",
3
+ dfft_hertz_sample_rate=None, dfft_human_readable=True,
4
+ window_size_num=None, window_size_perc=None,
5
+ window_overlap=0, window_is_symmetric=True,
6
+ window_scale=None, window_type=None,
7
+ window_exponential_center=None,
8
+ window_exponential_tau=None, window_gaussian_std=None,
9
+ window_general_cosine_coeff=None,
10
+ window_general_gaussian_shape=None,
11
+ window_general_gaussian_sigma=None,
12
+ window_general_hamming_alpha=None,
13
+ window_kaiser_beta=None, window_taylor_num_sidelobes=4,
14
+ window_taylor_sidelobe_suppression=30,
15
+ window_taylor_norm=True, window_tukey_alpha=None,
16
+ output_fmt_content=None, **generic_arguments):
17
+ """
18
+ DESCRIPTION:
19
+ WindowDFFT() function applies a user-selected window to data before
20
+ processing it with DFFT(). Windows are used to remove
21
+ noise or spectral leakage. The window type is determined
22
+ for the specific use case based on signal frequency,
23
+ amplitude, strength and so on.
24
+
25
+
26
+ PARAMETERS:
27
+ data:
28
+ Required Argument.
29
+ Specifies the time series or spatial series.
30
+ Types: TDSeries, TDAnalyticResult
31
+
32
+ data_filter_expr:
33
+ Optional Argument.
34
+ Specifies the filter expression for "data".
35
+ Types: ColumnExpression
36
+
37
+ dfft_algorithm:
38
+ Optional Argument.
39
+ Specifies the user-defined algorithm that bypasses the
40
+ internal DFFT planner, and influences the core DFFT
41
+ algorithm associated with the primary DFFT calculation.
42
+ Note:
43
+ * When "dfft_algorithm" is not passed, then the internal DFFT planner selects
44
+ the most efficient algorithm for the operation.
45
+ Permitted Values: COOLEY_TUKEY, SINGLETON
46
+ Types: str
47
+
48
+ dfft_zero_padding_ok:
49
+ Optional Argument.
50
+ Specifies whether to add zeros to the end of a given
51
+ series to achieve a more efficient computation for the
52
+ Fast Fourier Transform coefficients.
53
+ Default Value: True
54
+ Types: bool
55
+
56
+ dfft_freq_style:
57
+ Optional Argument.
58
+ Specifies the format or values associated with the x-axis of the
59
+ output.
60
+ Permitted Values:
61
+ * K_INTEGRAL: Integer representation.
62
+ * K_SAMPLE_RATE: Integer normalized to number entries, with ranges from -0.5 to +0.5.
63
+ * K_RADIANS: Radian ranges from -π to +π.
64
+ * K_HERTZ: Frequency in hertz. Must be used in conjunction with "dfft_hertz_sample_rate".
65
+ Default Value: K_INTEGRAL
66
+ Types: str
67
+
68
+ dfft_hertz_sample_rate:
69
+ Optional Argument.
70
+ Specifies the sample rate as a floating point constant, in
71
+ hertz. A value of 10000.0 indicates that the sample
72
+ points were obtained by sampling at a rate of 10,000
73
+ hertz.
74
+ Note:
75
+ * "dfft_hertz_sample_rate" is only valid with "dfft_freq_style".
76
+ Types: float
77
+
78
+ dfft_human_readable:
79
+ Optional Argument.
80
+ Specifies whether the produced output rows are in human-readable or raw form.
81
+ Human-readable output is symmetric around 0, such as -3, -2, -1, 0, 1, 2, 3 whereas
82
+ raw output is sequential, starting at zero, such as 0, 1, 2, 3.
83
+ Permitted Values:
84
+ * True: Human-readable output.
85
+ * False: Raw output.
86
+ Default Value: True
87
+ Types: bool
88
+
89
+ window_size_num:
90
+ Optional Argument.
91
+ Specifies the size of the window.
92
+ Note:
93
+ * "window_size_num" must be greater than zero.
94
+ * "window_size_num" and "window_size_perc" are mutually exclusive.
95
+ Types: int
96
+
97
+ window_size_perc:
98
+ Optional Argument.
99
+ Specifies the size of the window within a series as a percentage.
100
+ Note:
101
+ * "window_size_perc" must be greater than zero.
102
+ * "window_size_num" and "window_size_perc" are mutually exclusive.
103
+ Types: float
104
+
105
+ window_overlap:
106
+ Optional Argument.
107
+ Specifies the number of values by which the window slides down for
108
+ each DFFT calculation within a series.
109
+ Note:
110
+ * The value must be less than the window size.
111
+ * To use fraction form, use "window_size_perc".
112
+ Default Value: 0
113
+ Types: int
114
+
115
+ window_is_symmetric:
116
+ Optional Argument.
117
+ Specifies whether to use a symmetric or periodic window.
118
+ Permitted Values:
119
+ * False: Periodic
120
+ * True: Symmetric
121
+ Default Value: True
122
+ Types: bool
123
+
124
+ window_scale:
125
+ Optional Argument.
126
+ Specifies the spectral density type applied to the result values.
127
+ Permitted Values: DENSITY, SPECTRUM
128
+ Types: str
129
+
130
+ window_type:
131
+ Optional Argument.
132
+ Specifies the type of window to use.
133
+ Note:
134
+ * Some windows have additional options such as Taylor, in which case refer
135
+ to the Taylor parameter for specific Taylor window options.
136
+ Permitted Values:
137
+ * BARTHANN
138
+ * BARTLETT,
139
+ * BLACKMAN,
140
+ * BLACKMANHARRIS,
141
+ * BOHMAN,
142
+ * BOXCAR,
143
+ * COSINE,
144
+ * EXPONENTIAL,
145
+ * FLATTOP,
146
+ * GAUSSIAN,
147
+ * GENERAL_COSINE,
148
+ * GENERAL_GAUSSIAN,
149
+ * GENERAL_HAMMING,
150
+ * HAMMING, HANN,
151
+ * KAISER,
152
+ * NUTTALL,
153
+ * PARZEN,
154
+ * TAYLOR,
155
+ * TRIANG,
156
+ * TUKEY
157
+ Types: str
158
+
159
+ window_exponential_center:
160
+ Optional Argument.
161
+ Specifies the center of the window.
162
+ It is a parameter for "window_type" as EXPONENTIAL.
163
+ The default value is (windowSize - 1 ) / 2.
164
+ Types: float
165
+
166
+ window_exponential_tau:
167
+ Optional Argument.
168
+ Specifies the amount of window decay.
169
+ It is a parameter for window_type as EXPONENTIAL.
170
+ If the "window_exponential_center" is zero, then use ( windowSize - 1 ) / ln( x ) if x is the
171
+ fractional part of the window remaining at the end of
172
+ the window.
173
+ Types: float
174
+
175
+ window_gaussian_std:
176
+ Optional Argument. Required if "window_type" is GAUSSIAN.
177
+ Specifies the standard deviation of the Gaussian window.
178
+ Types: float
179
+
180
+ window_general_cosine_coeff:
181
+ Optional Argument. Required if "window_type" is GENERAL_GUASSIAN.
182
+ Specifies the list of weighing coefficients.
183
+ Types: float, list of float
184
+
185
+ window_general_gaussian_shape:
186
+ Optional Argument. Required if "window_type" is GENERAL_GUASSIAN.
187
+ specifies the gaussian shape.
188
+ Types: float
189
+
190
+ window_general_gaussian_sigma:
191
+ Optional Argument. Required if "window_type" is GENERAL_GUASSIAN.
192
+ Specifies the standard deviation value.
193
+ Types: float
194
+
195
+ window_general_hamming_alpha:
196
+ Optional Argument. Required if "window_type" is GENERAL_HAMMING.
197
+ Specifies the value of the window coefficient.
198
+ Types: float
199
+
200
+ window_kaiser_beta:
201
+ Optional Argument. Required if "window_type" is KAISER.
202
+ Specifies the shape between the main lobe width and side
203
+ lobe level.
204
+ Types: float
205
+
206
+ window_taylor_num_sidelobes:
207
+ Optional Argument.
208
+ Specifies the number of nearly constant level sidelobes
209
+ adjacent to the main lobe.
210
+ Default Value: 4
211
+ Types: int
212
+
213
+ window_taylor_sidelobe_suppression:
214
+ Optional Argument.
215
+ Specifies the suppression level of the side lobe in decibels
216
+ relative to the DC gain of the main lobe.
217
+ Default Value: 30
218
+ Types: float
219
+
220
+ window_taylor_norm:
221
+ Optional Argument.
222
+ Specifies the normalization factor for the Taylor window.
223
+ Permitted Values:
224
+ * False: For an even sized window, divides the window by the
225
+ value that would occur between the two middle values.
226
+ * True : For an odd sized window, divides the window by the
227
+ largest (middle) value.
228
+ Default Value: True
229
+ Types: bool
230
+
231
+ window_tukey_alpha:
232
+ Optional Argument. Required if "window_type" is TUKEY.
233
+ Specifies the shape of the window inside the cosine-tapered region.
234
+ A value of 0 is a rectangular window and value of 1 is the same as a Hann window.
235
+ Types: float
236
+
237
+ output_fmt_content:
238
+ Optional Argument.
239
+ Specifies how the Fourier coefficients should be output.
240
+ Permitted Values:
241
+ * COMPLEX
242
+ * AMPL_PHASE_RADIANS
243
+ * AMPL_PHASE_DEGREES
244
+ * AMPL_PHASE
245
+ * MULTIVAR_COMPLEX
246
+ * MULTIVAR_AMPL_PHASE_RADIANS
247
+ * MULTIVAR_AMPL_PHASE_DEGREES
248
+ * MULTIVAR_AMPL_PHASE
249
+ Types: str
250
+
251
+ **generic_arguments:
252
+ Specifies the generic keyword arguments of UAF functions.
253
+ Below are the generic keyword arguments:
254
+ persist:
255
+ Optional Argument.
256
+ Specifies whether to persist the results of the
257
+ function in a table or not. When set to True,
258
+ results are persisted in a table; otherwise,
259
+ results are garbage collected at the end of the
260
+ session.
261
+ Note that, when UAF function is executed, an
262
+ analytic result table (ART) is created.
263
+ Default Value: False
264
+ Types: bool
265
+
266
+ volatile:
267
+ Optional Argument.
268
+ Specifies whether to put the results of the
269
+ function in a volatile ART or not. When set to
270
+ True, results are stored in a volatile ART,
271
+ otherwise not.
272
+ Default Value: False
273
+ Types: bool
274
+
275
+ output_table_name:
276
+ Optional Argument.
277
+ Specifies the name of the table to store results.
278
+ If not specified, a unique table name is internally
279
+ generated.
280
+ Types: str
281
+
282
+ output_db_name:
283
+ Optional Argument.
284
+ Specifies the name of the database to create output
285
+ table into. If not specified, table is created into
286
+ database specified by the user at the time of context
287
+ creation or configuration parameter. Argument is ignored,
288
+ if "output_table_name" is not specified.
289
+ Types: str
290
+
291
+
292
+ RETURNS:
293
+ Instance of WindowDFFT.
294
+ Output teradataml DataFrames can be accessed using attribute
295
+ references, such as WindowDFFT_obj.<attribute_name>.
296
+ Output teradataml DataFrame attribute name is:
297
+ 1. result
298
+
299
+
300
+ RAISES:
301
+ TeradataMlException, TypeError, ValueError
302
+
303
+
304
+ EXAMPLES:
305
+ # Notes:
306
+ # 1. Get the connection to Vantage, before importing the
307
+ # function in user space.
308
+ # 2. User can import the function, if it is available on
309
+ # Vantage user is connected to.
310
+ # 3. To check the list of UAF analytic functions available
311
+ # on Vantage user connected to, use
312
+ # "display_analytic_functions()".
313
+
314
+ # Check the list of available UAF analytic functions.
315
+ display_analytic_functions(type="UAF")
316
+
317
+ # Import function WindowDFFT.
318
+ from teradataml import WindowDFFT
319
+
320
+ # Load the example data.
321
+ load_example_data("uaf", ["windowdfft"])
322
+
323
+ # Create teradataml DataFrame object.
324
+ data = DataFrame.from_table("windowdfft")
325
+
326
+ # Create teradataml TDSeries object.
327
+ data_series_df = TDSeries(data=data,
328
+ id="id",
329
+ row_index="row_i",
330
+ row_index_style="SEQUENCE",
331
+ payload_field=["v2"],
332
+ payload_content="REAL")
333
+
334
+ # Example 1: Execute WindowDFFT() function to apply a window to the data before processing it with DFFT()
335
+ # with window_type as BOHMAN and dfft_human_readable is True.
336
+ uaf_out = WindowDFFT(data=data_series_df,
337
+ window_size_num=15,
338
+ window_overlap=2,
339
+ window_type="BOHMAN",
340
+ window_is_symmetric=True,
341
+ window_scale="SPECTRUM",
342
+ dfft_algorithm="SINGLETON",
343
+ dfft_zero_padding_ok=True,
344
+ dfft_freq_style="K_INTEGRAL",
345
+ dfft_human_readable=True)
346
+
347
+ # Print the result DataFrame.
348
+ print(uaf_out.result)
349
+
350
+ # Example 2: Execute WindowDFFT() function to apply a window to the data before processing it with DFFT()
351
+ # with additional window parameters for window_type as GENERAL_COSINE and dfft_human_readable is False.
352
+ uaf_out1 = WindowDFFT(data=data_series_df,
353
+ window_size_num=15,
354
+ window_overlap=2,
355
+ window_type="GENERAL_COSINE",
356
+ window_general_cosine_coeff=[2.3,3.7],
357
+ window_is_symmetric=True,
358
+ window_scale="SPECTRUM",
359
+ dfft_algorithm="SINGLETON",
360
+ dfft_zero_padding_ok=True,
361
+ dfft_freq_style="K_INTEGRAL",
362
+ dfft_human_readable=False)
363
+
364
+ # Print the result DataFrame.
365
+ print(uaf_out1.result)
366
+
367
+ """
368
+