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.

Files changed (240) hide show
  1. teradataml/LICENSE-3RD-PARTY.pdf +0 -0
  2. teradataml/LICENSE.pdf +0 -0
  3. teradataml/README.md +306 -0
  4. teradataml/__init__.py +10 -3
  5. teradataml/_version.py +1 -1
  6. teradataml/analytics/__init__.py +3 -2
  7. teradataml/analytics/analytic_function_executor.py +299 -16
  8. teradataml/analytics/analytic_query_generator.py +92 -0
  9. teradataml/analytics/byom/__init__.py +3 -2
  10. teradataml/analytics/json_parser/metadata.py +13 -3
  11. teradataml/analytics/json_parser/utils.py +13 -6
  12. teradataml/analytics/meta_class.py +40 -1
  13. teradataml/analytics/sqle/DecisionTreePredict.py +1 -1
  14. teradataml/analytics/sqle/__init__.py +11 -2
  15. teradataml/analytics/table_operator/__init__.py +4 -3
  16. teradataml/analytics/uaf/__init__.py +21 -2
  17. teradataml/analytics/utils.py +66 -1
  18. teradataml/analytics/valib.py +1 -1
  19. teradataml/automl/__init__.py +1502 -323
  20. teradataml/automl/custom_json_utils.py +139 -61
  21. teradataml/automl/data_preparation.py +247 -307
  22. teradataml/automl/data_transformation.py +32 -12
  23. teradataml/automl/feature_engineering.py +325 -86
  24. teradataml/automl/model_evaluation.py +44 -35
  25. teradataml/automl/model_training.py +122 -153
  26. teradataml/catalog/byom.py +8 -8
  27. teradataml/clients/pkce_client.py +1 -1
  28. teradataml/common/__init__.py +2 -1
  29. teradataml/common/constants.py +72 -0
  30. teradataml/common/deprecations.py +13 -7
  31. teradataml/common/garbagecollector.py +152 -120
  32. teradataml/common/messagecodes.py +11 -2
  33. teradataml/common/messages.py +4 -1
  34. teradataml/common/sqlbundle.py +26 -4
  35. teradataml/common/utils.py +225 -14
  36. teradataml/common/wrapper_utils.py +1 -1
  37. teradataml/context/context.py +82 -2
  38. teradataml/data/SQL_Fundamentals.pdf +0 -0
  39. teradataml/data/complaints_test_tokenized.csv +353 -0
  40. teradataml/data/complaints_tokens_model.csv +348 -0
  41. teradataml/data/covid_confirm_sd.csv +83 -0
  42. teradataml/data/dataframe_example.json +27 -1
  43. teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
  44. teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -0
  45. teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +2 -0
  46. teradataml/data/docs/sqle/docs_17_20/Pivoting.py +279 -0
  47. teradataml/data/docs/sqle/docs_17_20/Shap.py +203 -0
  48. teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +189 -0
  49. teradataml/data/docs/sqle/docs_17_20/TFIDF.py +142 -0
  50. teradataml/data/docs/sqle/docs_17_20/TextParser.py +3 -3
  51. teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
  52. teradataml/data/docs/tableoperator/docs_17_20/Image2Matrix.py +118 -0
  53. teradataml/data/docs/uaf/docs_17_20/ACF.py +1 -10
  54. teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +1 -1
  55. teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +35 -5
  56. teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +3 -1
  57. teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +293 -0
  58. teradataml/data/docs/uaf/docs_17_20/AutoArima.py +354 -0
  59. teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +3 -2
  60. teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +1 -1
  61. teradataml/data/docs/uaf/docs_17_20/Convolve.py +13 -10
  62. teradataml/data/docs/uaf/docs_17_20/Convolve2.py +4 -1
  63. teradataml/data/docs/uaf/docs_17_20/CopyArt.py +145 -0
  64. teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +5 -4
  65. teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +4 -4
  66. teradataml/data/docs/uaf/docs_17_20/DWT.py +235 -0
  67. teradataml/data/docs/uaf/docs_17_20/DWT2D.py +214 -0
  68. teradataml/data/docs/uaf/docs_17_20/DickeyFuller.py +18 -21
  69. teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +1 -1
  70. teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +1 -1
  71. teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +160 -0
  72. teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +1 -1
  73. teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +9 -31
  74. teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +4 -2
  75. teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +1 -8
  76. teradataml/data/docs/uaf/docs_17_20/IDWT.py +236 -0
  77. teradataml/data/docs/uaf/docs_17_20/IDWT2D.py +226 -0
  78. teradataml/data/docs/uaf/docs_17_20/IQR.py +134 -0
  79. teradataml/data/docs/uaf/docs_17_20/LineSpec.py +1 -1
  80. teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +2 -2
  81. teradataml/data/docs/uaf/docs_17_20/MAMean.py +3 -3
  82. teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +297 -0
  83. teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +15 -6
  84. teradataml/data/docs/uaf/docs_17_20/PACF.py +0 -1
  85. teradataml/data/docs/uaf/docs_17_20/Portman.py +2 -2
  86. teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +2 -2
  87. teradataml/data/docs/uaf/docs_17_20/Resample.py +9 -1
  88. teradataml/data/docs/uaf/docs_17_20/SAX.py +246 -0
  89. teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +17 -10
  90. teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +1 -1
  91. teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +3 -1
  92. teradataml/data/docs/uaf/docs_17_20/WindowDFFT.py +368 -0
  93. teradataml/data/dwt2d_dataTable.csv +65 -0
  94. teradataml/data/dwt_dataTable.csv +8 -0
  95. teradataml/data/dwt_filterTable.csv +3 -0
  96. teradataml/data/finance_data4.csv +13 -0
  97. teradataml/data/grocery_transaction.csv +19 -0
  98. teradataml/data/idwt2d_dataTable.csv +5 -0
  99. teradataml/data/idwt_dataTable.csv +8 -0
  100. teradataml/data/idwt_filterTable.csv +3 -0
  101. teradataml/data/interval_data.csv +5 -0
  102. teradataml/data/jsons/paired_functions.json +14 -0
  103. teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
  104. teradataml/data/jsons/sqle/17.20/TD_NaiveBayes.json +193 -0
  105. teradataml/data/jsons/sqle/17.20/TD_NaiveBayesPredict.json +212 -0
  106. teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +9 -9
  107. teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
  108. teradataml/data/jsons/sqle/17.20/TD_Shap.json +222 -0
  109. teradataml/data/jsons/sqle/17.20/TD_TFIDF.json +162 -0
  110. teradataml/data/jsons/sqle/17.20/TD_TextParser.json +1 -1
  111. teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
  112. teradataml/data/jsons/sqle/20.00/TD_KMeans.json +250 -0
  113. teradataml/data/jsons/sqle/20.00/TD_SMOTE.json +266 -0
  114. teradataml/data/jsons/sqle/20.00/TD_VectorDistance.json +278 -0
  115. teradataml/data/jsons/storedprocedure/17.20/TD_COPYART.json +71 -0
  116. teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
  117. teradataml/data/jsons/tableoperator/17.20/IMAGE2MATRIX.json +53 -0
  118. teradataml/data/jsons/uaf/17.20/TD_ACF.json +1 -18
  119. teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +3 -16
  120. teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +0 -3
  121. teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +5 -3
  122. teradataml/data/jsons/uaf/17.20/TD_ARIMAXESTIMATE.json +362 -0
  123. teradataml/data/jsons/uaf/17.20/TD_AUTOARIMA.json +469 -0
  124. teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +0 -3
  125. teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +0 -2
  126. teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +2 -1
  127. teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +2 -5
  128. teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +3 -6
  129. teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +1 -3
  130. teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +0 -5
  131. teradataml/data/jsons/uaf/17.20/TD_DFFT.json +1 -4
  132. teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +2 -7
  133. teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +1 -2
  134. teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +0 -2
  135. teradataml/data/jsons/uaf/17.20/TD_DICKEY_FULLER.json +10 -19
  136. teradataml/data/jsons/uaf/17.20/TD_DTW.json +3 -6
  137. teradataml/data/jsons/uaf/17.20/TD_DWT.json +173 -0
  138. teradataml/data/jsons/uaf/17.20/TD_DWT2D.json +160 -0
  139. teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +1 -1
  140. teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +16 -30
  141. teradataml/data/jsons/uaf/17.20/{TD_HOLT_WINTERS_FORECAST.json → TD_HOLT_WINTERS_FORECASTER.json} +1 -2
  142. teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +1 -15
  143. teradataml/data/jsons/uaf/17.20/TD_IDWT.json +162 -0
  144. teradataml/data/jsons/uaf/17.20/TD_IDWT2D.json +149 -0
  145. teradataml/data/jsons/uaf/17.20/TD_IQR.json +117 -0
  146. teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +1 -1
  147. teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +1 -1
  148. teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +1 -3
  149. teradataml/data/jsons/uaf/17.20/TD_MATRIX2IMAGE.json +209 -0
  150. teradataml/data/jsons/uaf/17.20/TD_PACF.json +2 -2
  151. teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +5 -5
  152. teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +48 -28
  153. teradataml/data/jsons/uaf/17.20/TD_SAX.json +210 -0
  154. teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +12 -6
  155. teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +0 -1
  156. teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +8 -8
  157. teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +1 -1
  158. teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +1 -1
  159. teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +410 -0
  160. teradataml/data/load_example_data.py +8 -2
  161. teradataml/data/medical_readings.csv +101 -0
  162. teradataml/data/naivebayestextclassifier_example.json +1 -1
  163. teradataml/data/naivebayestextclassifierpredict_example.json +11 -0
  164. teradataml/data/patient_profile.csv +101 -0
  165. teradataml/data/peppers.png +0 -0
  166. teradataml/data/real_values.csv +14 -0
  167. teradataml/data/sax_example.json +8 -0
  168. teradataml/data/scripts/deploy_script.py +1 -1
  169. teradataml/data/scripts/lightgbm/dataset.template +157 -0
  170. teradataml/data/scripts/lightgbm/lightgbm_class_functions.template +247 -0
  171. teradataml/data/scripts/lightgbm/lightgbm_function.template +216 -0
  172. teradataml/data/scripts/lightgbm/lightgbm_sklearn.template +159 -0
  173. teradataml/data/scripts/sklearn/sklearn_fit.py +194 -160
  174. teradataml/data/scripts/sklearn/sklearn_fit_predict.py +136 -115
  175. teradataml/data/scripts/sklearn/sklearn_function.template +34 -16
  176. teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +155 -137
  177. teradataml/data/scripts/sklearn/sklearn_neighbors.py +1 -1
  178. teradataml/data/scripts/sklearn/sklearn_score.py +12 -3
  179. teradataml/data/scripts/sklearn/sklearn_transform.py +162 -24
  180. teradataml/data/star_pivot.csv +8 -0
  181. teradataml/data/target_udt_data.csv +8 -0
  182. teradataml/data/templates/open_source_ml.json +3 -1
  183. teradataml/data/teradataml_example.json +20 -1
  184. teradataml/data/timestamp_data.csv +4 -0
  185. teradataml/data/titanic_dataset_unpivoted.csv +19 -0
  186. teradataml/data/uaf_example.json +55 -1
  187. teradataml/data/unpivot_example.json +15 -0
  188. teradataml/data/url_data.csv +9 -0
  189. teradataml/data/vectordistance_example.json +4 -0
  190. teradataml/data/windowdfft.csv +16 -0
  191. teradataml/dataframe/copy_to.py +1 -1
  192. teradataml/dataframe/data_transfer.py +5 -3
  193. teradataml/dataframe/dataframe.py +1002 -201
  194. teradataml/dataframe/fastload.py +3 -3
  195. teradataml/dataframe/functions.py +867 -0
  196. teradataml/dataframe/row.py +160 -0
  197. teradataml/dataframe/setop.py +2 -2
  198. teradataml/dataframe/sql.py +840 -33
  199. teradataml/dataframe/window.py +1 -1
  200. teradataml/dbutils/dbutils.py +878 -34
  201. teradataml/dbutils/filemgr.py +48 -1
  202. teradataml/geospatial/geodataframe.py +1 -1
  203. teradataml/geospatial/geodataframecolumn.py +1 -1
  204. teradataml/hyperparameter_tuner/optimizer.py +13 -13
  205. teradataml/lib/aed_0_1.dll +0 -0
  206. teradataml/opensource/__init__.py +1 -1
  207. teradataml/opensource/{sklearn/_class.py → _class.py} +102 -17
  208. teradataml/opensource/_lightgbm.py +950 -0
  209. teradataml/opensource/{sklearn/_wrapper_utils.py → _wrapper_utils.py} +1 -2
  210. teradataml/opensource/{sklearn/constants.py → constants.py} +13 -10
  211. teradataml/opensource/sklearn/__init__.py +0 -1
  212. teradataml/opensource/sklearn/_sklearn_wrapper.py +1019 -574
  213. teradataml/options/__init__.py +9 -23
  214. teradataml/options/configure.py +42 -4
  215. teradataml/options/display.py +2 -2
  216. teradataml/plot/axis.py +4 -4
  217. teradataml/scriptmgmt/UserEnv.py +13 -9
  218. teradataml/scriptmgmt/lls_utils.py +77 -23
  219. teradataml/store/__init__.py +13 -0
  220. teradataml/store/feature_store/__init__.py +0 -0
  221. teradataml/store/feature_store/constants.py +291 -0
  222. teradataml/store/feature_store/feature_store.py +2223 -0
  223. teradataml/store/feature_store/models.py +1505 -0
  224. teradataml/store/vector_store/__init__.py +1586 -0
  225. teradataml/table_operators/Script.py +2 -2
  226. teradataml/table_operators/TableOperator.py +106 -20
  227. teradataml/table_operators/query_generator.py +3 -0
  228. teradataml/table_operators/table_operator_query_generator.py +3 -1
  229. teradataml/table_operators/table_operator_util.py +102 -56
  230. teradataml/table_operators/templates/dataframe_register.template +69 -0
  231. teradataml/table_operators/templates/dataframe_udf.template +63 -0
  232. teradataml/telemetry_utils/__init__.py +0 -0
  233. teradataml/telemetry_utils/queryband.py +52 -0
  234. teradataml/utils/dtypes.py +4 -2
  235. teradataml/utils/validators.py +34 -2
  236. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/METADATA +311 -3
  237. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/RECORD +240 -157
  238. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/WHEEL +0 -0
  239. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/top_level.txt +0 -0
  240. {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/zip-safe +0 -0
@@ -0,0 +1,293 @@
1
+ def ArimaXEstimate(data1=None, data1_filter_expr=None, data2=None,
2
+ data2_filter_expr=None, nonseasonal_model_order=None,
3
+ seasonal_model_order=None, seasonal_period=None,
4
+ xreg=None, init=None, fixed=None, constant=False,
5
+ algorithm=None, max_iterations=100, coeff_stats=False,
6
+ fit_percentage=100, fit_metrics=False, residuals=False,
7
+ input_fmt_input_mode=None,
8
+ output_fmt_index_style="NUMERICAL_SEQUENCE",
9
+ **generic_arguments):
10
+ """
11
+ DESCRIPTION:
12
+ ArimaXEstimate() function extends the capability of ArimaEstimate() by
13
+ allowing to include external regressors or covariates to an ARIMA model.
14
+ The external regressors are specified in TDSeries payload specification
15
+ after targeting the univariate series.
16
+ The following procedure is an example of how to use:
17
+ 1. Run the ArimaXEstimate() function to estimate the coefficients
18
+ of ARIMAX model.
19
+ 2. Run the ArimaXForecast() function with the estimated coefficient
20
+ as first input, and the regular input time series table (TDSeries) that
21
+ contains the future value of exogenous variables as second input.
22
+
23
+ PARAMETERS:
24
+ data1:
25
+ Required Argument.
26
+ Specifies the input series.
27
+ Types: TDSeries
28
+
29
+ data1_filter_expr:
30
+ Optional Argument.
31
+ Specifies the filter expression for "data1".
32
+ Types: ColumnExpression
33
+
34
+ data2:
35
+ Optional Argument.
36
+ Specifies a logical univariate
37
+ series and an art table from previous
38
+ ArimaXEstimate() call. This allows the user to fit
39
+ the interested series in TDSeries by existing model
40
+ in TDAnalyticResult. In this case, the function's primary
41
+ result set will be based on the existing model's
42
+ coefficients.
43
+ Types: TDSeries, TDAnalyticResult
44
+
45
+ data2_filter_expr:
46
+ Optional Argument.
47
+ Specifies the filter expression for "data2".
48
+ Types: ColumnExpression
49
+
50
+ nonseasonal_model_order:
51
+ Required Argument.
52
+ Specifies the non-seasonal values for the model.
53
+ A list containing three integer values, which are each greater than or equal to 0:
54
+ • p-value: The order of the non-seasonal autoregression
55
+ (AR) component.
56
+ • d-value: The order of the non-seasonal differences
57
+ between consecutive components.
58
+ • q-value: The order of the non-seasonal moving
59
+ average (MA) component.
60
+ Types: int, list of int
61
+
62
+ seasonal_model_order:
63
+ Required Argument.
64
+ Specifies the seasonal values for the model.
65
+ A list containing three integer values, which are each greater than or equal to 0:
66
+ • P-value: The order of the seasonal auto-regression
67
+ (SAR) component.
68
+ • D-value: The order of the seasonal differences
69
+ between consecutive components.
70
+ • Q-value: The order of the seasonal moving average
71
+ (SMA) component.
72
+ Types: int, list of int
73
+
74
+ seasonal_period:
75
+ Optional Argument.
76
+ Specifies the number of periods per season.
77
+ Types: int
78
+
79
+ xreg:
80
+ Required Argument.
81
+ Specifies the number of covariates in external regressors.
82
+ Note:
83
+ * If value is 0, then it suggests to use ArimaEstimate().
84
+ The input number should match with the number
85
+ of (payload-1). Otherwise, an error occurs with
86
+ the message “Unexpected XREG input.”
87
+ * Maximum number for this argument is 10.
88
+ Types: int
89
+
90
+ init:
91
+ Optional Argument.
92
+ Specifies the position-sensitive list that specifies the initial
93
+ values to be associated with the non-seasonal AR
94
+ regression coefficients, followed by the non-seasonal
95
+ MA coefficients, the seasonal SAR regression
96
+ coefficients and the SMA coefficients. The formula is
97
+ as follows: 'p+q+P+Q+CONSTANT-length-init-list'
98
+ Types: float, list of float
99
+
100
+ fixed:
101
+ Optional Argument.
102
+ Specifies the position-sensitive list that contains the
103
+ fixed values to be associated with the non-seasonal
104
+ AR regression coefficients, followed by the nonseasonal
105
+ MA coefficients, the SAR coefficients and
106
+ the SMA coefficients.
107
+ If an intercept is needed, one more value is added at
108
+ the end to specify the intercept coefficient initial value.
109
+ The formula is as follows: 'p+q+P+Q+CONSTANT-length-fixed-list'
110
+ Types: float, list of float
111
+
112
+ constant:
113
+ Optional Argument.
114
+ Specifies the indicator for the ArimaXEstimate() function to
115
+ calculate an intercept. When set to True, it indicates intercept
116
+ should be calculated otherwise it indicates no
117
+ intercept should be calculated.
118
+ Default Value: False
119
+ Types: bool
120
+
121
+ algorithm:
122
+ Required Argument.
123
+ Specifies the method to estimate the coefficients.
124
+ Permitted Values: OLE, MLE, MLE_CSS, CSS
125
+ Types: str
126
+
127
+ max_iterations:
128
+ Optional Argument.
129
+ Specifies the limit on the maximum number of
130
+ iterations that can be employed to estimate the
131
+ ARIMA parameters. Only relevant for "algorithm" value 'MLE'
132
+ processing.
133
+ Default Value: 100
134
+ Types: int
135
+
136
+ coeff_stats:
137
+ Optional Argument.
138
+ Specifies the flag indicating whether to return coefficient
139
+ statistical columns STD_ERROR, TSTAT_VALUE and
140
+ TSTAT_PROB. When set to True, function returns the columns,
141
+ otherwise does not return the columns.
142
+ Default Value: False
143
+ Types: bool
144
+
145
+ fit_percentage:
146
+ Optional Argument.
147
+ Specifies the percentage of passed-in sample points
148
+ that are used for the model fitting and parameter estimation.
149
+ Default Value: 100
150
+ Types: int
151
+
152
+ fit_metrics:
153
+ Optional Argument.
154
+ Specifies the indicator to generate the secondary result
155
+ set that contains the model metadata statistics.
156
+ When set to True, the function generates the secondary result set
157
+ otherwise does not generate the secondary result set.
158
+ The generated result set is retrieved by issuing the
159
+ ExtractResults function on the analytical result
160
+ table containing the results.
161
+ Default Value: False
162
+ Types: bool
163
+
164
+ residuals:
165
+ Optional Argument.
166
+ Specifies the indicator to generate the tertiary result set
167
+ that contains the model residuals. When set to True, function
168
+ generates the tertiary result set otherwise, does
169
+ not generate the tertiary result set.
170
+ Default Value: False
171
+ Types: bool
172
+
173
+ input_fmt_input_mode:
174
+ Required Argument.
175
+ Specifies the input mode supported by the function.
176
+ Permitted Values: MANY2ONE, ONE2ONE, MATCH
177
+ Types: str
178
+
179
+ output_fmt_index_style:
180
+ Optional Argument.
181
+ Specifies the "index_style" of the output format.
182
+ Permitted Values: NUMERICAL_SEQUENCE, FLOW_THROUGH
183
+ Default Value: NUMERICAL_SEQUENCE
184
+ Types: str
185
+
186
+ **generic_arguments:
187
+ Specifies the generic keyword arguments of UAF functions.
188
+ Below are the generic keyword arguments:
189
+ persist:
190
+ Optional Argument.
191
+ Specifies whether to persist the results of the
192
+ function in a table or not. When set to True,
193
+ results are persisted in a table; otherwise,
194
+ results are garbage collected at the end of the
195
+ session.
196
+ Note that, when UAF function is executed, an
197
+ analytic result table (ART) is created.
198
+ Default Value: False
199
+ Types: bool
200
+
201
+ volatile:
202
+ Optional Argument.
203
+ Specifies whether to put the results of the
204
+ function in a volatile ART or not. When set to
205
+ True, results are stored in a volatile ART,
206
+ otherwise not.
207
+ Default Value: False
208
+ Types: bool
209
+
210
+ output_table_name:
211
+ Optional Argument.
212
+ Specifies the name of the table to store results.
213
+ If not specified, a unique table name is internally
214
+ generated.
215
+ Types: str
216
+
217
+ output_db_name:
218
+ Optional Argument.
219
+ Specifies the name of the database to create output
220
+ table into. If not specified, table is created into
221
+ database specified by the user at the time of context
222
+ creation or configuration parameter. Argument is ignored,
223
+ if "output_table_name" is not specified.
224
+ Types: str
225
+
226
+
227
+ RETURNS:
228
+ Instance of ArimaXEstimate.
229
+ Output teradataml DataFrames can be accessed using attribute
230
+ references, such as ArimaXEstimate_obj.<attribute_name>.
231
+ Output teradataml DataFrame attribute names are:
232
+ 1. result
233
+ 2. fitmetadata
234
+ 3. fitresiduals
235
+ 4. model
236
+ 5. valdata
237
+
238
+
239
+ RAISES:
240
+ TeradataMlException, TypeError, ValueError
241
+
242
+
243
+ EXAMPLES:
244
+ # Notes:
245
+ # 1. Get the connection to Vantage, before importing the
246
+ # function in user space.
247
+ # 2. User can import the function, if it is available on
248
+ # Vantage user is connected to.
249
+ # 3. To check the list of UAF analytic functions available
250
+ # on Vantage user connected to, use
251
+ # "display_analytic_functions()".
252
+
253
+ # Check the list of available UAF analytic functions.
254
+ display_analytic_functions(type="UAF")
255
+
256
+ # Import function ArimaXEstimate.
257
+ from teradataml import ArimaXEstimate
258
+
259
+ # Load the example data.
260
+ load_example_data("uaf", "blood2ageandweight")
261
+
262
+ # Create teradataml DataFrame objects.
263
+ data1 = DataFrame.from_table("blood2ageandweight")
264
+
265
+ # Create teradataml TDSeries objects.
266
+ data1_series_df = TDSeries(data=data1,
267
+ id="PatientID",
268
+ row_index="SeqNo",
269
+ row_index_style="SEQUENCE",
270
+ payload_field=["BloodFat", "Age"],
271
+ payload_content="MULTIVAR_REAL")
272
+
273
+
274
+ # Example 1: Execute ArimaXEstimate with single input.
275
+ uaf_out = ArimaXEstimate(data1=data1_series_df,
276
+ nonseasonal_model_order=[2,0,1],
277
+ xreg=True,
278
+ fit_metrics=True,
279
+ residuals=True,
280
+ constant=True
281
+ algorithm=MLE,
282
+ fit_percentage=80
283
+ )
284
+
285
+ # Print the result DataFrames.
286
+ print(uaf_out.result)
287
+ print(uaf_out.fitmetadata)
288
+ print(uaf_out.fitresiduals)
289
+ print(uaf_out.model)
290
+ print(uaf_out.valdata)
291
+
292
+ """
293
+
@@ -0,0 +1,354 @@
1
+ def AutoArima(data=None, data_filter_expr=None, max_pq_nonseasonal=[5,5],
2
+ max_pq_seasonal=[2,2], start_pq_nonseasonal=[0,0],
3
+ start_pq_seasonal=[0,0], d=-1, ds=-1, max_d=2, max_ds=1,
4
+ period=1, stationary=False, seasonal=True, constant=True,
5
+ algorithm="MLE", fit_percentage=100,
6
+ infor_criteria="AIC", stepwise=False, nmodels=94,
7
+ max_iterations=100, coeff_stats=False,
8
+ fit_metrics=False, residuals=False, arma_roots=False,
9
+ test_nonseasonal="ADF", test_seasonal="OCSB",
10
+ output_fmt_index_style="NUMERICAL_SEQUENCE",
11
+ **generic_arguments):
12
+ """
13
+ DESCRIPTION:
14
+ AutoArima() function searches the possible models within the order
15
+ constrains in the function parameters, and returns the best ARIMA
16
+ model based on the criterion provided by the "infor_criteria"
17
+ parameter. AutoArima() function creates a six-layered ART table.
18
+
19
+ PARAMETERS:
20
+ data:
21
+ Required Argument.
22
+ Specifies the time series whose value can be REAL.
23
+ Types: TDSeries
24
+
25
+ data_filter_expr:
26
+ Optional Argument.
27
+ Specifies the filter expression for "data".
28
+ Types: ColumnExpression
29
+
30
+ max_pq_nonseasonal:
31
+ Optional Argument.
32
+ Specifies the (p,q) order of the maximum autoregression (AR) and
33
+ moving average (MA) parameters.
34
+ Default Value: [5,5]
35
+ Types: list
36
+
37
+ max_pq_seasonal:
38
+ Optional Argument.
39
+ Specifies the (P,Q) order of the max seasonal AR and MA
40
+ parameters.
41
+ Default Value: [2,2]
42
+ Types: list
43
+
44
+ start_pq_nonseasonal:
45
+ Optional Argument.
46
+ Specifies the start value of (p,q). Only used when "stepwise"=1.
47
+ Default Value: [0,0]
48
+ Types: list
49
+
50
+ start_pq_seasonal:
51
+ Optional Argument.
52
+ Specifies the start value of seasonal (P,Q). Only used when
53
+ "stepwise"=1.
54
+ Default Value: [0,0]
55
+ Types: list
56
+
57
+ d:
58
+ Optional Argument.
59
+ Specifies the order of first-differencing.
60
+ Default Value: -1 (auto search d).
61
+ Types: int
62
+
63
+ ds:
64
+ Optional Argument.
65
+ Specifies the order of seasonal-differencing.
66
+ Default Value: -1 (auto search Ds).
67
+ Types: int
68
+
69
+ max_d:
70
+ Optional Argument.
71
+ Specifies the maximum number of non-seasonal differences.
72
+ Default Value: 2
73
+ Types: int
74
+
75
+ max_ds:
76
+ Optional Argument.
77
+ Specifies the maximum number of seasonal differences.
78
+ Default Value: 1
79
+ Types: int
80
+
81
+ period:
82
+ Optional Argument.
83
+ Specifies the number of periods per season. For non-seasonal
84
+ data, period is 1.
85
+ Default Value: 1
86
+ Types: int
87
+
88
+ stationary:
89
+ Optional Argument.
90
+ Specifies whether to restrict search to stationary models.
91
+ If True, the function restricts search to stationary models.
92
+ Default Value: False
93
+ Types: bool
94
+
95
+ seasonal:
96
+ Optional Argument.
97
+ Specifies whether to restrict search to non-seasonal models.
98
+ If False, then the function restricts search to non-seasonal
99
+ models.
100
+ Default Value: True
101
+ Types: bool
102
+
103
+ constant:
104
+ Optional Argument.
105
+ Specifies whether an indicator that AutoArima() function includes
106
+ an intercept. If True, means CONSTANT/intercept
107
+ should be included. If False, means
108
+ CONSTANT/intercept should not be included.
109
+ Default Value: True
110
+ Types: bool
111
+
112
+ algorithm:
113
+ Optional Argument.
114
+ Specifies the approach used by TD_AUTOARIMA to estimate the
115
+ coefficients.
116
+ Permitted Values:
117
+ * MLE: Use maximum likelihood approach.
118
+ * CSS_MLE: Use the conditional sum-of-squares to determine a
119
+ start value and then do maximum likelihood.
120
+ * CSS: Use the conditional sum-of squares approach.
121
+ Default Value: MLE
122
+ Types: str
123
+
124
+ fit_percentage:
125
+ Optional Argument.
126
+ Specifies the percentage of passed-in sample points used for the
127
+ model fitting (parameter estimation).
128
+ Default Value: 100
129
+ Types: int
130
+
131
+ infor_criteria:
132
+ Optional Argument.
133
+ Specifies the information criterion to be used in model selection.
134
+ Permitted Values: AIC, AICC, BIC
135
+ Default Value: AIC
136
+ Types: str
137
+
138
+ stepwise:
139
+ Optional Argument.
140
+ Specifies whether the function does stepwise selection or not.
141
+ If True, then the function does stepwise selection otherwise the
142
+ function selects all models.
143
+ Default Value: False
144
+ Types: bool
145
+
146
+ nmodels:
147
+ Optional Argument.
148
+ Specifies the maximum number of models considered in the stepwise
149
+ search.
150
+ Default Value: 94
151
+ Types: int
152
+
153
+ max_iterations:
154
+ Optional Argument.
155
+ Specifies the maximum number of iterations that can be employed
156
+ to non-linear optimization procedure.
157
+ Default Value: 100
158
+ Types: int
159
+
160
+ coeff_stats:
161
+ Optional Argument.
162
+ Specifies the indicator to return coefficient statistical columns
163
+ TSTAT_VALUE and TSTAT_PROB. If True, means return
164
+ the columns otherwise do not return the
165
+ columns.
166
+ Default Value: False
167
+ Types: bool
168
+
169
+ fit_metrics:
170
+ Optional Argument.
171
+ Specifies the indicator to generate the secondary result set that
172
+ contains the model metadata statistics. If True,
173
+ means generate the secondary result set otherwise
174
+ do not generate the secondary result set.
175
+ Default Value: False
176
+ Types: bool
177
+
178
+ residuals:
179
+ Optional Argument.
180
+ Specifies the indicator to generate the tertiary result set that
181
+ contains the model residuals. If True, means
182
+ generate the tertiary result set, otherwise
183
+ do not generate the tertiary result set.
184
+ Default Value: False
185
+ Types: bool
186
+
187
+ arma_roots:
188
+ Optional Argument.
189
+ Specifies the indicator to generate the senary result set that
190
+ contains the inverse AR and MA roots of result best
191
+ model that AutoArima() selected (the model in the
192
+ primary output layer). There should be no inverse
193
+ roots showing outside of the unit circle. If True,
194
+ means generate result set otherwise do not
195
+ generate a result set.
196
+ Default Value: False
197
+ Types: bool
198
+
199
+ test_nonseasonal:
200
+ Optional Argument.
201
+ Specifies the nonseasonal unit root test used to choose
202
+ differencing number "d".
203
+ AutoArima() function only uses ADF test for
204
+ nonseasonal unit root test.
205
+ Permitted Values: ADF
206
+ Default Value: ADF
207
+ Types: str
208
+
209
+ test_seasonal:
210
+ Optional Argument.
211
+ Specifies the seasonal unit root test used to choose differencing
212
+ number "d". AutoArima() function only uses OCSB test for
213
+ seasonal unit root test.
214
+ Permitted Values: OCSB
215
+ Default Value: OCSB
216
+ Types: str
217
+
218
+ output_fmt_index_style:
219
+ Optional Argument.
220
+ Specifies the index style of the output format.
221
+ Permitted Values: NUMERICAL_SEQUENCE, FLOW_THROUGH
222
+ Default Value: NUMERICAL_SEQUENCE
223
+ Types: str
224
+
225
+ **generic_arguments:
226
+ Specifies the generic keyword arguments of UAF functions.
227
+ Below are the generic keyword arguments:
228
+ persist:
229
+ Optional Argument.
230
+ Specifies whether to persist the results of the
231
+ function in a table or not. When set to True,
232
+ results are persisted in a table; otherwise,
233
+ results are garbage collected at the end of the
234
+ session.
235
+ Note that, when UAF function is executed, an
236
+ analytic result table (ART) is created.
237
+ Default Value: False
238
+ Types: bool
239
+
240
+ volatile:
241
+ Optional Argument.
242
+ Specifies whether to put the results of the
243
+ function in a volatile ART or not. When set to
244
+ True, results are stored in a volatile ART,
245
+ otherwise not.
246
+ Default Value: False
247
+ Types: bool
248
+
249
+ output_table_name:
250
+ Optional Argument.
251
+ Specifies the name of the table to store results.
252
+ If not specified, a unique table name is internally
253
+ generated.
254
+ Types: str
255
+
256
+ output_db_name:
257
+ Optional Argument.
258
+ Specifies the name of the database to create output
259
+ table into. If not specified, table is created into
260
+ database specified by the user at the time of context
261
+ creation or configuration parameter. Argument is ignored,
262
+ if "output_table_name" is not specified.
263
+ Types: str
264
+
265
+
266
+ RETURNS:
267
+ Instance of AutoArima.
268
+ Output teradataml DataFrames can be accessed using attribute
269
+ references, such as AutoArima_obj.<attribute_name>.
270
+ Output teradataml DataFrame attribute names are:
271
+ 1. result
272
+ 2. fitmetadata
273
+ 3. fitresiduals
274
+ 4. model
275
+ 5. icandorder
276
+ 6. armaroots
277
+
278
+
279
+ RAISES:
280
+ TeradataMlException, TypeError, ValueError
281
+
282
+
283
+ EXAMPLES:
284
+ # Notes:
285
+ # 1. Get the connection to Vantage, before importing the
286
+ # function in user space.
287
+ # 2. User can import the function, if it is available on
288
+ # Vantage user is connected to.
289
+ # 3. To check the list of UAF analytic functions available
290
+ # on Vantage user connected to, use
291
+ # "display_analytic_functions()".
292
+
293
+ # Check the list of available UAF analytic functions.
294
+ display_analytic_functions(type="UAF")
295
+
296
+ # Import function AutoArima.
297
+ from teradataml import AutoArima
298
+
299
+ # Load the example data.
300
+ load_example_data("uaf", ["blood2ageandweight", "covid_confirm_sd"])
301
+
302
+ # Create teradataml DataFrame object.
303
+ data = DataFrame.from_table("blood2ageandweight")
304
+
305
+ # Create teradataml TDSeries object.
306
+ data_series_df = TDSeries(data=data,
307
+ id="PatientID",
308
+ row_index="SeqNo",
309
+ row_index_style="SEQUENCE",
310
+ payload_field="BloodFat",
311
+ payload_content="REAL")
312
+
313
+ # Example 1: Execute AutoArima with start_pq_nonseasonal as [1,1], algorithm = "MLE" and
314
+ # fit_percentage=80 to find the best ARIMA model.
315
+ uaf_out = AutoArima(data=data_series_df,
316
+ start_pq_nonseasonal=[1, 1],
317
+ seasonal=False,
318
+ constant=True,
319
+ algorithm="MLE",
320
+ fit_percentage=80,
321
+ stepwise=True,
322
+ nmodels=7,
323
+ fit_metrics=True,
324
+ residuals=True)
325
+
326
+ # Print the result DataFrames.
327
+ print(uaf_out.result)
328
+
329
+ # Example 2: Execute AutoArima with max_pq_nonseasonal as [3,3], arma_roots = True,
330
+ # to find thhe best ARIMA model.
331
+ covid_confirm_sd = DataFrame("covid_confirm_sd")
332
+ data_series_df = TDSeries(data=covid_confirm_sd,
333
+ id="city",
334
+ row_index="row_axis",
335
+ row_index_style="SEQUENCE",
336
+ payload_field="cnumber",
337
+ payload_content="REAL")
338
+
339
+ uaf_out = AutoArima(data=data_series_df,
340
+ max_pq_nonseasonal=[3, 3],
341
+ stationary=False,
342
+ stepwise=False,
343
+ arma_roots=True,
344
+ residuals=True)
345
+
346
+ # Print the result DataFrames.
347
+ print(uaf_out.result)
348
+ print(uaf_out.fitresiduals)
349
+ print(uaf_out.model)
350
+ print(uaf_out.icandorder)
351
+ print(uaf_out.armaroots)
352
+
353
+ """
354
+
@@ -1,5 +1,5 @@
1
1
  def BreuschGodfrey(data=None, data_filter_expr=None, residual_max_lags=None,
2
- explanatory_count=None, significance_level=None,
2
+ explanatory_count=None, significance_level=0.05,
3
3
  **generic_arguments):
4
4
  """
5
5
  DESCRIPTION:
@@ -46,6 +46,7 @@ def BreuschGodfrey(data=None, data_filter_expr=None, residual_max_lags=None,
46
46
  significance_level:
47
47
  Optional Argument.
48
48
  Specifies the desired significance level for the test.
49
+ Default Value: 0.05
49
50
  Types: float
50
51
 
51
52
  **generic_arguments:
@@ -163,7 +164,7 @@ def BreuschGodfrey(data=None, data_filter_expr=None, residual_max_lags=None,
163
164
  id="cityid",
164
165
  row_index="ROW_I",
165
166
  row_index_style= "SEQUENCE",
166
- payload_field=["ACTUAL_VALUE","CALC_VALUE"],
167
+ payload_field=["RESIDUAL","ACTUAL_VALUE","CALC_VALUE"],
167
168
  payload_content="MULTIVAR_REAL")
168
169
 
169
170
  uaf_out = BreuschGodfrey(data=data_series_bg,
@@ -149,7 +149,7 @@ def BreuschPaganGodfrey(data=None, data_filter_expr=None, variables_count=None,
149
149
  id="cityid",
150
150
  row_index="ROW_I",
151
151
  row_index_style= "SEQUENCE",
152
- payload_field=["ACTUAL_VALUE","CALC_VALUE"],
152
+ payload_field=["RESIDUAL","ACTUAL_VALUE","CALC_VALUE"],
153
153
  payload_content="MULTIVAR_REAL")
154
154
  uaf_out = BreuschPaganGodfrey(data=data_series_bg,
155
155
  variables_count=2,