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
@@ -1,6 +1,7 @@
1
- def ZTest(data=None, alpha=0.5, first_sample_column=None, second_sample_column=None,
1
+ def ZTest(data=None, alpha=0.05, first_sample_column=None, second_sample_column=None,
2
2
  alternate_hypothesis="two-tailed", first_sample_variance=None,
3
- second_sample_variance=None, mean_under_h0=None,
3
+ second_sample_variance=None, mean_under_h0=0, sample_name_column=None,
4
+ sample_value_column=None, first_sample_name=None, second_sample_name=None,
4
5
  **generic_arguments):
5
6
 
6
7
  """
@@ -20,17 +21,17 @@ def ZTest(data=None, alpha=0.5, first_sample_column=None, second_sample_column=N
20
21
  alpha:
21
22
  Optional Argument.
22
23
  Specifies the value of alpha in hypothesis test function.
23
- Default Value: 0.5
24
+ Default Value: 0.05
24
25
  Types: float
25
26
 
26
27
  first_sample_column:
27
- Required Argument.
28
- Specifies the first sample column in z test.
28
+ Optional Argument.
29
+ Specifies the first sample column in Z-Test.
29
30
  Types: str
30
31
 
31
32
  second_sample_column:
32
33
  Optional Argument.
33
- Specifies the second sample column in z test.
34
+ Specifies the second sample column in Z-Test.
34
35
  Types: str
35
36
 
36
37
  alternate_hypothesis:
@@ -48,7 +49,7 @@ def ZTest(data=None, alpha=0.5, first_sample_column=None, second_sample_column=N
48
49
  Types: str
49
50
 
50
51
  first_sample_variance:
51
- Required Argument.
52
+ Optional Argument.
52
53
  Specifies the first sample variance.
53
54
  Types: float
54
55
 
@@ -60,8 +61,42 @@ def ZTest(data=None, alpha=0.5, first_sample_column=None, second_sample_column=N
60
61
  mean_under_h0:
61
62
  Optional Argument.
62
63
  Specifies the mean under the null hypothesis.
64
+ Default Value: 0
63
65
  Types: float
64
66
 
67
+ sample_name_column:
68
+ Optional Argument.
69
+ Specifies the column in the "data" containing the names of the samples
70
+ included in the Z-Test.
71
+ Note:
72
+ * This argument is used when data contains sample names in a column
73
+ and sample values in another column.
74
+ Types: str
75
+
76
+ sample_value_column:
77
+ Optional Argument.
78
+ Specifies the column in the "data" containing the values for each sample member.
79
+ Note:
80
+ * This argument is used when data contains sample names in a column
81
+ and sample values in another column.
82
+ Types: str
83
+
84
+ first_sample_name:
85
+ Optional Argument.
86
+ Specifies the name of the first sample included in the Z-Test.
87
+ Note:
88
+ * This argument is used when data contains sample names in a column
89
+ and sample values in another column.
90
+ Types: str
91
+
92
+ second_sample_name:
93
+ Optional Argument.
94
+ Specifies the name of the second sample included in the Z-Test.
95
+ Note:
96
+ * This argument is used when data contains sample names in a column
97
+ and sample values in another column.
98
+ Types: str
99
+
65
100
  **generic_arguments:
66
101
  Specifies the generic keyword arguments SQLE functions accept.
67
102
  Below are the generic keyword arguments:
@@ -113,9 +148,11 @@ def ZTest(data=None, alpha=0.5, first_sample_column=None, second_sample_column=N
113
148
 
114
149
  # Load the example data.
115
150
  load_example_data("teradataml", ["titanic"])
151
+ load_example_data('ztest', 'boston2cols')
116
152
 
117
153
  # Create teradataml DataFrame object.
118
154
  titanic_data = DataFrame.from_table("titanic")
155
+ bostonCol = DataFrame.from_table("boston2cols")
119
156
 
120
157
  # Check the list of available analytic functions.
121
158
  display_analytic_functions()
@@ -152,4 +189,32 @@ def ZTest(data=None, alpha=0.5, first_sample_column=None, second_sample_column=N
152
189
  # Print the result DataFrame.
153
190
  print(obj.result)
154
191
 
192
+ # Example 3: Perform ZTest analysis on input data column that
193
+ # contains data for the first and second sample
194
+ # population and variance of the first and second sample
195
+ # population by specifying sample_name_column, sample_value_column,
196
+ # first_sample_name and second_sample_name.
197
+ obj = ZTest(data=bostonCol,
198
+ first_sample_name='NOX',
199
+ second_sample_name='RM',
200
+ sample_name_column='groupName',
201
+ sample_value_column='groupValue')
202
+
203
+ # Print the result DataFrame.
204
+ print(obj.result)
205
+
206
+ # ExPerform ZTest analysis on input data column that
207
+ # contains data for the first sample population and
208
+ # variance of the first sample population by specifying
209
+ # sample_name_column, sample_value_column.
210
+ obj = ZTest(data=boston,
211
+ first_sample_name='NOX',
212
+ sample_name_column='groupName',
213
+ sample_value_column='groupValue')
214
+
215
+ # Print the result DataFrame.
216
+ print(obj.result)
217
+
218
+
219
+
155
220
  """
@@ -1,6 +1,6 @@
1
1
  def ACF(data=None, data_filter_expr=None, max_lags=None,
2
2
  func_type=False, unbiased=False, demean=True,
3
- qstat=False, alpha=None, round_results=False,
3
+ qstat=False, alpha=None,
4
4
  **generic_arguments):
5
5
  """
6
6
  DESCRIPTION:
@@ -96,15 +96,6 @@ def ACF(data=None, data_filter_expr=None, max_lags=None,
96
96
  * The function does not return confidence intervals.
97
97
  Types: float
98
98
 
99
- round_results:
100
- Optional Argument.
101
- Specifies whether rounding should be done or not.
102
- When set to True, results in the output row are
103
- rounded before inserting the rows into dataframe,
104
- otherwise not.
105
- Default Value: False
106
- Types: bool
107
-
108
99
  **generic_arguments:
109
100
  Specifies the generic keyword arguments of UAF functions.
110
101
  Below are the generic keyword arguments:
@@ -312,7 +312,7 @@ def ArimaEstimate(data1=None, data1_filter_expr=None, data2=None,
312
312
  references, such as ArimaEstimate_obj.<attribute_name>.
313
313
  Output teradataml DataFrame attribute names are:
314
314
  1. result
315
- 2. fitmetadata - Available when "model_stats" is set to True, otherwise not.
315
+ 2. fitmetadata - Available when "fit_metrics" is set to True, otherwise not.
316
316
  3. fitresiduals - Available when "residuals" is set to True, otherwise not.
317
317
  4. model
318
318
  5. valdata
@@ -118,6 +118,9 @@ def ArimaForecast(data=None, data_filter_expr=None, forecast_periods=None,
118
118
  payload_field="magnitude",
119
119
  payload_content="REAL")
120
120
 
121
+ # Example 1: Forecast 2 periods based on the model fitted by ArimaEstimate.
122
+ # As the fit_percentage is greater than or equal to 100,
123
+ # output of ArimaEstimate is used for ArimaForecast.
121
124
  # Execute ArimaEstimate function.
122
125
  arima_estimate_op = ArimaEstimate(data1=data_series_df,
123
126
  nonseasonal_model_order=[2,0,0],
@@ -128,15 +131,42 @@ def ArimaForecast(data=None, data_filter_expr=None, forecast_periods=None,
128
131
  residuals=True,
129
132
  fit_percentage=100)
130
133
 
131
- # Example 1: Forecast 2 periods based on the model fitted by ArimaEstimate.
132
- # As the fit_percentage is greater than or equal to 100,
133
- # output of ArimaEstimate is used for ArimaForecast.
134
-
135
134
  # Create teradataml TDAnalyticResult object over the result attribute of 'arima_estimate_op'
136
135
  data_art_df = TDAnalyticResult(data=arima_estimate_op.result)
137
136
 
138
- uaf_out = ArimaForecast(data=data_art_df, forecast_periods=2)
137
+ uaf_out = ArimaForecast(data=data_art_df,
138
+ forecast_periods=2)
139
139
 
140
140
  # Print the result DataFrame.
141
141
  print(uaf_out.result)
142
+
143
+ # Example 2: Forecast 2 periods based on the model fitted by ArimaValidate.
144
+ # As the fit_percentage is less than 100,
145
+ # output of ArimaEstimate is used for ArimaValidate and
146
+ # output of ArimaValidate is used for ArimaForecast.
147
+ # Execute ArimaEstimate function.
148
+ arima_estimate_op = ArimaEstimate(data1=data_series_df,
149
+ nonseasonal_model_order=[2,0,0],
150
+ constant=False,
151
+ algorithm="MLE",
152
+ coeff_stats=True,
153
+ fit_metrics=True,
154
+ residuals=True,
155
+ fit_percentage=80)
156
+
157
+ # Create TDAnalyticResult object over the result attribute of 'arima_estimate_op'.
158
+ data_art_df = TDAnalyticResult(data=arima_estimate_op.result)
159
+
160
+ # Execute ArimaValidate function.
161
+ arima_validate_op = ArimaValidate(data=data_art_df,
162
+ fit_metrics=TRUE,
163
+ residuals=TRUE)
164
+
165
+ data_art_df1 = TDAnalyticResult(data=arima_validate_op.result)
166
+
167
+ uaf_out = ArimaForecast(data=data_art_df1,
168
+ forecast_periods=2)
169
+
170
+ # Print the result DataFrames.
171
+ print(uaf_out.result)
142
172
  """
@@ -149,7 +149,9 @@ def ArimaValidate(data=None, data_filter_expr=None, fit_metrics=False,
149
149
  # Create teradataml TDAnalyticResult object over the result attribute of 'arima_estimate_op'.
150
150
  data_art_df = TDAnalyticResult(data=arima_estimate_op.result)
151
151
 
152
- uaf_out = ArimaValidate(data=data_art_df, fit_metrics=True, residuals=True)
152
+ uaf_out = ArimaValidate(data=data_art_df,
153
+ fit_metrics=True,
154
+ residuals=True)
153
155
 
154
156
  # Print the result DataFrames.
155
157
  print(uaf_out.result)
@@ -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
+