teradataml 20.0.0.1__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 (200) hide show
  1. teradataml/LICENSE.pdf +0 -0
  2. teradataml/README.md +112 -0
  3. teradataml/__init__.py +6 -3
  4. teradataml/_version.py +1 -1
  5. teradataml/analytics/__init__.py +3 -2
  6. teradataml/analytics/analytic_function_executor.py +224 -16
  7. teradataml/analytics/analytic_query_generator.py +92 -0
  8. teradataml/analytics/byom/__init__.py +3 -2
  9. teradataml/analytics/json_parser/metadata.py +1 -0
  10. teradataml/analytics/json_parser/utils.py +6 -4
  11. teradataml/analytics/meta_class.py +40 -1
  12. teradataml/analytics/sqle/DecisionTreePredict.py +1 -1
  13. teradataml/analytics/sqle/__init__.py +10 -2
  14. teradataml/analytics/table_operator/__init__.py +3 -2
  15. teradataml/analytics/uaf/__init__.py +21 -2
  16. teradataml/analytics/utils.py +62 -1
  17. teradataml/analytics/valib.py +1 -1
  18. teradataml/automl/__init__.py +1502 -323
  19. teradataml/automl/custom_json_utils.py +139 -61
  20. teradataml/automl/data_preparation.py +245 -306
  21. teradataml/automl/data_transformation.py +32 -12
  22. teradataml/automl/feature_engineering.py +313 -82
  23. teradataml/automl/model_evaluation.py +44 -35
  24. teradataml/automl/model_training.py +109 -146
  25. teradataml/catalog/byom.py +8 -8
  26. teradataml/clients/pkce_client.py +1 -1
  27. teradataml/common/constants.py +37 -0
  28. teradataml/common/deprecations.py +13 -7
  29. teradataml/common/garbagecollector.py +151 -120
  30. teradataml/common/messagecodes.py +4 -1
  31. teradataml/common/messages.py +2 -1
  32. teradataml/common/sqlbundle.py +1 -1
  33. teradataml/common/utils.py +97 -11
  34. teradataml/common/wrapper_utils.py +1 -1
  35. teradataml/context/context.py +72 -2
  36. teradataml/data/complaints_test_tokenized.csv +353 -0
  37. teradataml/data/complaints_tokens_model.csv +348 -0
  38. teradataml/data/covid_confirm_sd.csv +83 -0
  39. teradataml/data/dataframe_example.json +10 -0
  40. teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
  41. teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -0
  42. teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +2 -0
  43. teradataml/data/docs/sqle/docs_17_20/Pivoting.py +279 -0
  44. teradataml/data/docs/sqle/docs_17_20/Shap.py +197 -0
  45. teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +189 -0
  46. teradataml/data/docs/sqle/docs_17_20/TFIDF.py +142 -0
  47. teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
  48. teradataml/data/docs/uaf/docs_17_20/ACF.py +1 -10
  49. teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +1 -1
  50. teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +35 -5
  51. teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +3 -1
  52. teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +293 -0
  53. teradataml/data/docs/uaf/docs_17_20/AutoArima.py +354 -0
  54. teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +3 -2
  55. teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +1 -1
  56. teradataml/data/docs/uaf/docs_17_20/Convolve.py +13 -10
  57. teradataml/data/docs/uaf/docs_17_20/Convolve2.py +4 -1
  58. teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +5 -4
  59. teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +4 -4
  60. teradataml/data/docs/uaf/docs_17_20/DWT.py +235 -0
  61. teradataml/data/docs/uaf/docs_17_20/DWT2D.py +214 -0
  62. teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +1 -1
  63. teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +1 -1
  64. teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +160 -0
  65. teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +1 -1
  66. teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +9 -31
  67. teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +4 -2
  68. teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +1 -8
  69. teradataml/data/docs/uaf/docs_17_20/IDWT.py +236 -0
  70. teradataml/data/docs/uaf/docs_17_20/IDWT2D.py +226 -0
  71. teradataml/data/docs/uaf/docs_17_20/IQR.py +134 -0
  72. teradataml/data/docs/uaf/docs_17_20/LineSpec.py +1 -1
  73. teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +2 -2
  74. teradataml/data/docs/uaf/docs_17_20/MAMean.py +3 -3
  75. teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +297 -0
  76. teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +15 -6
  77. teradataml/data/docs/uaf/docs_17_20/PACF.py +0 -1
  78. teradataml/data/docs/uaf/docs_17_20/Portman.py +2 -2
  79. teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +2 -2
  80. teradataml/data/docs/uaf/docs_17_20/Resample.py +9 -1
  81. teradataml/data/docs/uaf/docs_17_20/SAX.py +246 -0
  82. teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +17 -10
  83. teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +1 -1
  84. teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +3 -1
  85. teradataml/data/docs/uaf/docs_17_20/WindowDFFT.py +368 -0
  86. teradataml/data/dwt2d_dataTable.csv +65 -0
  87. teradataml/data/dwt_dataTable.csv +8 -0
  88. teradataml/data/dwt_filterTable.csv +3 -0
  89. teradataml/data/finance_data4.csv +13 -0
  90. teradataml/data/grocery_transaction.csv +19 -0
  91. teradataml/data/idwt2d_dataTable.csv +5 -0
  92. teradataml/data/idwt_dataTable.csv +8 -0
  93. teradataml/data/idwt_filterTable.csv +3 -0
  94. teradataml/data/interval_data.csv +5 -0
  95. teradataml/data/jsons/paired_functions.json +14 -0
  96. teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
  97. teradataml/data/jsons/sqle/17.20/TD_NaiveBayes.json +193 -0
  98. teradataml/data/jsons/sqle/17.20/TD_NaiveBayesPredict.json +212 -0
  99. teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +9 -9
  100. teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
  101. teradataml/data/jsons/sqle/17.20/TD_Shap.json +222 -0
  102. teradataml/data/jsons/sqle/17.20/TD_TFIDF.json +162 -0
  103. teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
  104. teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
  105. teradataml/data/jsons/uaf/17.20/TD_ACF.json +1 -18
  106. teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +3 -16
  107. teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +0 -3
  108. teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +5 -3
  109. teradataml/data/jsons/uaf/17.20/TD_ARIMAXESTIMATE.json +362 -0
  110. teradataml/data/jsons/uaf/17.20/TD_AUTOARIMA.json +469 -0
  111. teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +0 -3
  112. teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +0 -2
  113. teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +2 -1
  114. teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +2 -5
  115. teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +3 -6
  116. teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +1 -3
  117. teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +0 -5
  118. teradataml/data/jsons/uaf/17.20/TD_DFFT.json +1 -4
  119. teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +2 -7
  120. teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +1 -2
  121. teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +0 -2
  122. teradataml/data/jsons/uaf/17.20/TD_DTW.json +3 -6
  123. teradataml/data/jsons/uaf/17.20/TD_DWT.json +173 -0
  124. teradataml/data/jsons/uaf/17.20/TD_DWT2D.json +160 -0
  125. teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +1 -1
  126. teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +16 -30
  127. teradataml/data/jsons/uaf/17.20/{TD_HOLT_WINTERS_FORECAST.json → TD_HOLT_WINTERS_FORECASTER.json} +1 -2
  128. teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +1 -15
  129. teradataml/data/jsons/uaf/17.20/TD_IDWT.json +162 -0
  130. teradataml/data/jsons/uaf/17.20/TD_IDWT2D.json +149 -0
  131. teradataml/data/jsons/uaf/17.20/TD_IQR.json +117 -0
  132. teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +1 -1
  133. teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +1 -1
  134. teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +1 -3
  135. teradataml/data/jsons/uaf/17.20/TD_MATRIX2IMAGE.json +209 -0
  136. teradataml/data/jsons/uaf/17.20/TD_PACF.json +2 -2
  137. teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +5 -5
  138. teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +48 -28
  139. teradataml/data/jsons/uaf/17.20/TD_SAX.json +208 -0
  140. teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +12 -6
  141. teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +0 -1
  142. teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +8 -8
  143. teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +1 -1
  144. teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +1 -1
  145. teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +400 -0
  146. teradataml/data/load_example_data.py +8 -2
  147. teradataml/data/naivebayestextclassifier_example.json +1 -1
  148. teradataml/data/naivebayestextclassifierpredict_example.json +11 -0
  149. teradataml/data/peppers.png +0 -0
  150. teradataml/data/real_values.csv +14 -0
  151. teradataml/data/sax_example.json +8 -0
  152. teradataml/data/scripts/deploy_script.py +1 -1
  153. teradataml/data/scripts/sklearn/sklearn_fit.py +17 -10
  154. teradataml/data/scripts/sklearn/sklearn_fit_predict.py +2 -2
  155. teradataml/data/scripts/sklearn/sklearn_function.template +30 -7
  156. teradataml/data/scripts/sklearn/sklearn_neighbors.py +1 -1
  157. teradataml/data/scripts/sklearn/sklearn_score.py +12 -3
  158. teradataml/data/scripts/sklearn/sklearn_transform.py +55 -4
  159. teradataml/data/star_pivot.csv +8 -0
  160. teradataml/data/templates/open_source_ml.json +2 -1
  161. teradataml/data/teradataml_example.json +20 -1
  162. teradataml/data/timestamp_data.csv +4 -0
  163. teradataml/data/titanic_dataset_unpivoted.csv +19 -0
  164. teradataml/data/uaf_example.json +55 -1
  165. teradataml/data/unpivot_example.json +15 -0
  166. teradataml/data/url_data.csv +9 -0
  167. teradataml/data/windowdfft.csv +16 -0
  168. teradataml/dataframe/copy_to.py +1 -1
  169. teradataml/dataframe/data_transfer.py +5 -3
  170. teradataml/dataframe/dataframe.py +474 -41
  171. teradataml/dataframe/fastload.py +3 -3
  172. teradataml/dataframe/functions.py +339 -0
  173. teradataml/dataframe/row.py +160 -0
  174. teradataml/dataframe/setop.py +2 -2
  175. teradataml/dataframe/sql.py +658 -20
  176. teradataml/dataframe/window.py +1 -1
  177. teradataml/dbutils/dbutils.py +322 -16
  178. teradataml/geospatial/geodataframe.py +1 -1
  179. teradataml/geospatial/geodataframecolumn.py +1 -1
  180. teradataml/hyperparameter_tuner/optimizer.py +13 -13
  181. teradataml/lib/aed_0_1.dll +0 -0
  182. teradataml/opensource/sklearn/_sklearn_wrapper.py +154 -69
  183. teradataml/options/__init__.py +3 -1
  184. teradataml/options/configure.py +14 -2
  185. teradataml/options/display.py +2 -2
  186. teradataml/plot/axis.py +4 -4
  187. teradataml/scriptmgmt/UserEnv.py +10 -6
  188. teradataml/scriptmgmt/lls_utils.py +3 -2
  189. teradataml/table_operators/Script.py +2 -2
  190. teradataml/table_operators/TableOperator.py +106 -20
  191. teradataml/table_operators/table_operator_util.py +88 -41
  192. teradataml/table_operators/templates/dataframe_udf.template +63 -0
  193. teradataml/telemetry_utils/__init__.py +0 -0
  194. teradataml/telemetry_utils/queryband.py +52 -0
  195. teradataml/utils/validators.py +1 -1
  196. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.2.dist-info}/METADATA +115 -2
  197. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.2.dist-info}/RECORD +200 -140
  198. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.2.dist-info}/WHEEL +0 -0
  199. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.2.dist-info}/top_level.txt +0 -0
  200. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.2.dist-info}/zip-safe +0 -0
@@ -0,0 +1,226 @@
1
+ def IDWT2D(data1=None, data1_filter_expr=None, data2=None,
2
+ data2_filter_expr=None, wavelet=None, mode="symmetric",
3
+ input_fmt_input_mode=None,
4
+ output_fmt_index_style="NUMERICAL_SEQUENCE",
5
+ **generic_arguments):
6
+ """
7
+ DESCRIPTION:
8
+ IDWT2D() function performs inverse discrete wavelet transform
9
+ (IDWT) for two-dimensional data. The algorithm is applied
10
+ first horizontally by row axis, then vertically by column
11
+ axis.
12
+
13
+ PARAMETERS:
14
+ data1:
15
+ Required Argument.
16
+ Specifies the input matrix. Multiple
17
+ payloads are supported, and each payload column is
18
+ transformed independently. Only MULTIVAR_REAL payload
19
+ content type is supported.
20
+ Types: TDMatrix
21
+
22
+ data1_filter_expr:
23
+ Optional Argument.
24
+ Specifies the filter expression for "data1".
25
+ Types: ColumnExpression
26
+
27
+ data2:
28
+ Optional Argument.
29
+ Specifies the input series. The series specifies the filter.
30
+ It should have two payload columns corresponding to low and high
31
+ pass filters. Only MULTIVAR_REAL payload content type is 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', 'bior2.2',
48
+ 'bior2.4', 'bior2.6', 'bior2.8', 'bior3.1',
49
+ 'bior3.3', 'bior3.5', 'bior3.7', 'bior3.9',
50
+ 'bior4.4', 'bior5.5', 'bior6.8'
51
+ * Reverse Biorthogonal: 'rbio1.1', 'rbio1.3', 'rbio1.5'
52
+ 'rbio2.2', 'rbio2.4', 'rbio2.6',
53
+ 'rbio2.8', 'rbio3.1', 'rbio3.3',
54
+ 'rbio3.5', 'rbio3.7','rbio3.9',
55
+ 'rbio4.4', 'rbio5.5', 'rbio6.8'
56
+ Note:
57
+ * If 'wavelet' is specified, do not include a second
58
+ input series for the function. Otherwise, include
59
+ a second input series to provide the filter.
60
+ * Data type is case-sensitive.
61
+ Types: str
62
+
63
+ mode:
64
+ Optional Argument.
65
+ Specifies the signal extension mode.
66
+ Data type is case-insensitive.
67
+ Permitted Values:
68
+ * symmetric, sym, symh
69
+ * reflect, symw
70
+ * smooth, spd, sp1
71
+ * constant, sp0
72
+ * zero, zpd
73
+ * periodic, ppd
74
+ * periodization, per
75
+ * antisymmetric, asym, asymh
76
+ * antireflect, asymw
77
+ Default Value: symmetric
78
+ Types: str
79
+
80
+ input_fmt_input_mode:
81
+ Optional Argument.
82
+ Specifies the input mode supported by the function.
83
+ When there are two input series, then the "input_fmt_input_mode" .
84
+ specification is mandatory.
85
+ Permitted Values:
86
+ * ONE2ONE: Both the primary and secondary series specifications
87
+ contain a series name which identifies the two series
88
+ in the function.
89
+ * MANY2ONE: The MANY specification is the primary series
90
+ declaration. The secondary series specification
91
+ contains a series name that identifies the single
92
+ secondary series.
93
+ * MATCH: Both series are defined by their respective series
94
+ specification instance name declarations.
95
+ Types: str
96
+
97
+ output_fmt_index_style:
98
+ Optional Argument.
99
+ Specifies the index style of the output format.
100
+ Permitted Values: NUMERICAL_SEQUENCE
101
+ Default Value: NUMERICAL_SEQUENCE
102
+ Types: str
103
+
104
+ **generic_arguments:
105
+ Specifies the generic keyword arguments of UAF functions.
106
+ Below are the generic keyword arguments:
107
+ persist:
108
+ Optional Argument.
109
+ Specifies whether to persist the results of the
110
+ function in a table or not. When set to True,
111
+ results are persisted in a table; otherwise,
112
+ results are garbage collected at the end of the
113
+ session.
114
+ Note that, when UAF function is executed, an
115
+ analytic result table (ART) is created.
116
+ Default Value: False
117
+ Types: bool
118
+
119
+ volatile:
120
+ Optional Argument.
121
+ Specifies whether to put the results of the
122
+ function in a volatile ART or not. When set to
123
+ True, results are stored in a volatile ART,
124
+ otherwise not.
125
+ Default Value: False
126
+ Types: bool
127
+
128
+ output_table_name:
129
+ Optional Argument.
130
+ Specifies the name of the table to store results.
131
+ If not specified, a unique table name is internally
132
+ generated.
133
+ Types: str
134
+
135
+ output_db_name:
136
+ Optional Argument.
137
+ Specifies the name of the database to create output
138
+ table into. If not specified, table is created into
139
+ database specified by the user at the time of context
140
+ creation or configuration parameter. Argument is ignored,
141
+ if "output_table_name" is not specified.
142
+ Types: str
143
+
144
+
145
+ RETURNS:
146
+ Instance of IDWT2D.
147
+ Output teradataml DataFrames can be accessed using attribute
148
+ references, such as IDWT2D_obj.<attribute_name>.
149
+ Output teradataml DataFrame attribute name is:
150
+ 1. result
151
+
152
+
153
+ RAISES:
154
+ TeradataMlException, TypeError, ValueError
155
+
156
+
157
+ EXAMPLES:
158
+ # Notes:
159
+ # 1. Get the connection to Vantage, before importing the
160
+ # function in user space.
161
+ # 2. User can import the function, if it is available on
162
+ # Vantage user is connected to.
163
+ # 3. To check the list of UAF analytic functions available
164
+ # on Vantage user connected to, use
165
+ # "display_analytic_functions()".
166
+
167
+ # Check the list of available UAF analytic functions.
168
+ display_analytic_functions(type="UAF")
169
+
170
+ # Import function IDWT2D.
171
+ from teradataml import IDWT2D
172
+
173
+ # Load the example data.
174
+ load_example_data("uaf", ["idwt2d_dataTable", "idwt_filterTable"])
175
+
176
+ # Create teradataml DataFrame objects.
177
+ data1 = DataFrame.from_table("idwt2d_dataTable")
178
+ data2 = DataFrame.from_table("idwt_filterTable")
179
+
180
+ # Create teradataml TDMatrix object.
181
+ data1_matrix_df = TDMatrix(data=data1,
182
+ id="id",
183
+ row_index="y",
184
+ row_index_style="SEQUENCE",
185
+ column_index="x",
186
+ column_index_style="SEQUENCE",
187
+ payload_field="v",
188
+ payload_content="REAL")
189
+
190
+ # Execute DWT2D
191
+ uaf_out = DWT2D(data1=data1_matrix_df,
192
+ wavelet='haar')
193
+
194
+ # Example 1: Perform inverse discrete wavelet transform using TDAnalyticResult
195
+ # from DWT2D() as input and wavelet as 'haar'
196
+
197
+ # Create teradataml TDAnalyticResult object.
198
+ art_df = TDAnalyticResult(data=uaf_out.result)
199
+
200
+ uaf_out = IDWT2D(data1=art_df,
201
+ wavelet='haar')
202
+
203
+ # Print the result DataFrame.
204
+ print(uaf_out.result)
205
+
206
+ # Example 1: Perform inverse discrete wavelet transform using TDAnalyticResult from DWT2D()
207
+ # and TDSeries as input.
208
+
209
+ # Create teradataml TDSeries object.
210
+ data2_series_df = TDSeries(data=data2,
211
+ id="id",
212
+ row_index="seq",
213
+ row_index_style="SEQUENCE",
214
+ payload_field=["lo", "hi"],
215
+ payload_content="MULTIVAR_REAL")
216
+
217
+ uaf_out = IDWT2D(data1=art_df,
218
+ data2=data2_series_df,
219
+ data2_filter_expr=data2.id==1,
220
+ input_fmt_input_mode='MANY2ONE')
221
+
222
+ # Print the result DataFrame.
223
+ print(uaf_out.result)
224
+
225
+ """
226
+
@@ -0,0 +1,134 @@
1
+ def IQR(data=None, data_filter_expr=None, stat_metrics=False,
2
+ output_fmt_index_style="NUMERICAL_SEQUENCE",
3
+ **generic_arguments):
4
+ """
5
+ DESCRIPTION:
6
+ Anomaly detection identifies data points, events and observations that
7
+ deviate from the normal behavior of the data set.
8
+ Anomalous data can indicate critical incidents, such as a change in
9
+ consumer behavior or observations that are suspicious.
10
+ Anomalies in data are also called standard deviations, outliers, noise,
11
+ novelties, and exceptions.
12
+
13
+ IQR() uses interquartile range for anomaly detection. Any data point
14
+ that falls outside of 1.5 times of an interquartile range below
15
+ the first quartile and above the third quartile is considered an outlier.
16
+ The IQR() function creates a two-layered ART table.
17
+
18
+
19
+ PARAMETERS:
20
+ data:
21
+ Required Argument.
22
+ Specifies the time series whose value can be REAL or MULTIVAR_REAL.
23
+ Types: TDSeries
24
+
25
+ data_filter_expr:
26
+ Optional Argument.
27
+ Specifies the filter expression for "data".
28
+ Types: ColumnExpression
29
+
30
+ stat_metrics:
31
+ Optional Argument.
32
+ Specifies the indicator for the secondary layer
33
+ to indicate the number of outliers.
34
+ Default Value: False
35
+ Types: bool
36
+
37
+ output_fmt_index_style:
38
+ Optional Argument.
39
+ Specifies the INDEX_STYLE of the output format.
40
+ Permitted Values: NUMERICAL_SEQUENCE
41
+ Default Value: NUMERICAL_SEQUENCE
42
+ Types: str
43
+
44
+ **generic_arguments:
45
+ Specifies the generic keyword arguments of UAF functions.
46
+ Below are the generic keyword arguments:
47
+ persist:
48
+ Optional Argument.
49
+ Specifies whether to persist the results of the
50
+ function in a table or not. When set to True,
51
+ results are persisted in a table; otherwise,
52
+ results are garbage collected at the end of the
53
+ session.
54
+ Note that, when UAF function is executed, an
55
+ analytic result table (ART) is created.
56
+ Default Value: False
57
+ Types: bool
58
+
59
+ volatile:
60
+ Optional Argument.
61
+ Specifies whether to put the results of the
62
+ function in a volatile ART or not. When set to
63
+ True, results are stored in a volatile ART,
64
+ otherwise not.
65
+ Default Value: False
66
+ Types: bool
67
+
68
+ output_table_name:
69
+ Optional Argument.
70
+ Specifies the name of the table to store results.
71
+ If not specified, a unique table name is internally
72
+ generated.
73
+ Types: str
74
+
75
+ output_db_name:
76
+ Optional Argument.
77
+ Specifies the name of the database to create output
78
+ table into. If not specified, table is created into
79
+ database specified by the user at the time of context
80
+ creation or configuration parameter. Argument is ignored,
81
+ if "output_table_name" is not specified.
82
+ Types: str
83
+
84
+
85
+ RETURNS:
86
+ Instance of IQR.
87
+ Output teradataml DataFrames can be accessed using attribute
88
+ references, such as IQR_obj.<attribute_name>.
89
+ Output teradataml DataFrame attribute names are:
90
+ 1. result
91
+ 2. statsdata
92
+ 3. fitmetadata
93
+
94
+
95
+ RAISES:
96
+ TeradataMlException, TypeError, ValueError
97
+
98
+
99
+ EXAMPLES:
100
+ # Notes:
101
+ # 1. Get the connection to Vantage, before importing the
102
+ # function in user space.
103
+ # 2. User can import the function, if it is available on
104
+ # Vantage user is connected to.
105
+ # 3. To check the list of UAF analytic functions available
106
+ # on Vantage user connected to, use
107
+ # "display_analytic_functions()".
108
+
109
+ # Check the list of available UAF analytic functions.
110
+ display_analytic_functions(type="UAF")
111
+
112
+ # Load the example data.
113
+ load_example_data("uaf", ["real_values"])
114
+
115
+ # Create teradataml DataFrame object.
116
+ data = DataFrame.from_table("real_values")
117
+
118
+ # Create teradataml TDSeries object.
119
+ data_series_df = TDSeries(data=data,
120
+ id="id",
121
+ row_index="TD_TIMECODE",
122
+ payload_field="val",
123
+ payload_content="REAL")
124
+
125
+ # Example 1: Detect which and how many values are considered outliers.
126
+ uaf_out = IQR(data=data_series_df,
127
+ stat_metrics=True)
128
+
129
+ # Print the result DataFrames.
130
+ print(uaf_out.result)
131
+ print(uaf_out.statsdata)
132
+
133
+ """
134
+
@@ -10,7 +10,7 @@ def LineSpec(data=None, data_filter_expr=None, freq_style="K_INTEGRAL",
10
10
  2. Use ArimaValidate() to validate spectral candidates.
11
11
  3. Use LineSpec() with "freq_style" parameter set to K_PERIODICITY
12
12
  to perform spectral analysis.
13
- 4. Use Plot() to plot the results.
13
+ 4. Use DataFrame.plot() to plot the results.
14
14
  5. Compute the test statistic.
15
15
  6. Use SignifPeriodicities() on the periodicities of interest.
16
16
  More than one periodicity can be entered using the "periodicities"
@@ -24,8 +24,8 @@ def LinearRegr(data=None, data_filter_expr=None, variables_count=2,
24
24
  data:
25
25
  Required Argument.
26
26
  Specifies an input time series with the following payload characteristics:
27
- * CONTENT value is MULTIVAR_REAL.
28
- * FIELDS has two required fields (response variable and
27
+ * "payload_content" value is MULTIVAR_REAL.
28
+ * "payload_fields" has two required fields (response variable and
29
29
  explanatory variable, in that order) and one optional
30
30
  field (weights).
31
31
  Types: TDSeries
@@ -52,8 +52,8 @@ def MAMean(data=None, data_filter_expr=None, forecast_periods=None,
52
52
  fit_metrics:
53
53
  Optional Argument.
54
54
  Specifies a flag to generate the secondary result set that contains the model metadata
55
- statistics. when set to True, function generate the secondary result set,otherwise
56
- not.The generated result set can be retrieved using the attribute fitmetadata of
55
+ statistics. When set to True, function generate the secondary result set, otherwise
56
+ not. The generated result set can be retrieved using the attribute fitmetadata of
57
57
  the function output.
58
58
  Default Value: False
59
59
  Types: bool
@@ -61,7 +61,7 @@ def MAMean(data=None, data_filter_expr=None, forecast_periods=None,
61
61
  residuals:
62
62
  Optional Argument.
63
63
  Specifies a flag to generate the tertiary result set that contains the model residuals.
64
- when set to True, means generate the tertiary result set, otherwise not.
64
+ When set to True, means generate the tertiary result set, otherwise not.
65
65
  The generated result set can be retrieved using the attribute fitresiduals of
66
66
  the function output.
67
67
  Default Value: False