teradataml 20.0.0.0__py3-none-any.whl → 20.0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of teradataml might be problematic. Click here for more details.

Files changed (263) hide show
  1. teradataml/LICENSE-3RD-PARTY.pdf +0 -0
  2. teradataml/LICENSE.pdf +0 -0
  3. teradataml/README.md +183 -0
  4. teradataml/__init__.py +6 -3
  5. teradataml/_version.py +2 -2
  6. teradataml/analytics/__init__.py +3 -2
  7. teradataml/analytics/analytic_function_executor.py +275 -40
  8. teradataml/analytics/analytic_query_generator.py +92 -0
  9. teradataml/analytics/byom/__init__.py +3 -2
  10. teradataml/analytics/json_parser/metadata.py +1 -0
  11. teradataml/analytics/json_parser/utils.py +17 -21
  12. teradataml/analytics/meta_class.py +40 -1
  13. teradataml/analytics/sqle/DecisionTreePredict.py +1 -1
  14. teradataml/analytics/sqle/__init__.py +10 -2
  15. teradataml/analytics/table_operator/__init__.py +3 -2
  16. teradataml/analytics/uaf/__init__.py +21 -2
  17. teradataml/analytics/utils.py +62 -1
  18. teradataml/analytics/valib.py +1 -1
  19. teradataml/automl/__init__.py +1553 -319
  20. teradataml/automl/custom_json_utils.py +139 -61
  21. teradataml/automl/data_preparation.py +276 -319
  22. teradataml/automl/data_transformation.py +163 -81
  23. teradataml/automl/feature_engineering.py +402 -239
  24. teradataml/automl/feature_exploration.py +9 -2
  25. teradataml/automl/model_evaluation.py +48 -51
  26. teradataml/automl/model_training.py +291 -189
  27. teradataml/catalog/byom.py +8 -8
  28. teradataml/catalog/model_cataloging_utils.py +1 -1
  29. teradataml/clients/auth_client.py +133 -0
  30. teradataml/clients/pkce_client.py +1 -1
  31. teradataml/common/aed_utils.py +3 -2
  32. teradataml/common/constants.py +48 -6
  33. teradataml/common/deprecations.py +13 -7
  34. teradataml/common/garbagecollector.py +156 -120
  35. teradataml/common/messagecodes.py +6 -1
  36. teradataml/common/messages.py +3 -1
  37. teradataml/common/sqlbundle.py +1 -1
  38. teradataml/common/utils.py +103 -11
  39. teradataml/common/wrapper_utils.py +1 -1
  40. teradataml/context/context.py +121 -31
  41. teradataml/data/advertising.csv +201 -0
  42. teradataml/data/bank_marketing.csv +11163 -0
  43. teradataml/data/bike_sharing.csv +732 -0
  44. teradataml/data/boston2cols.csv +721 -0
  45. teradataml/data/breast_cancer.csv +570 -0
  46. teradataml/data/complaints_test_tokenized.csv +353 -0
  47. teradataml/data/complaints_tokens_model.csv +348 -0
  48. teradataml/data/covid_confirm_sd.csv +83 -0
  49. teradataml/data/customer_segmentation_test.csv +2628 -0
  50. teradataml/data/customer_segmentation_train.csv +8069 -0
  51. teradataml/data/dataframe_example.json +10 -0
  52. teradataml/data/docs/sqle/docs_17_10/OneHotEncodingFit.py +3 -1
  53. teradataml/data/docs/sqle/docs_17_10/OneHotEncodingTransform.py +6 -0
  54. teradataml/data/docs/sqle/docs_17_10/OutlierFilterTransform.py +5 -1
  55. teradataml/data/docs/sqle/docs_17_20/ANOVA.py +61 -1
  56. teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
  57. teradataml/data/docs/sqle/docs_17_20/ColumnTransformer.py +2 -0
  58. teradataml/data/docs/sqle/docs_17_20/FTest.py +105 -26
  59. teradataml/data/docs/sqle/docs_17_20/GLM.py +162 -1
  60. teradataml/data/docs/sqle/docs_17_20/GetFutileColumns.py +5 -3
  61. teradataml/data/docs/sqle/docs_17_20/KMeans.py +48 -1
  62. teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -0
  63. teradataml/data/docs/sqle/docs_17_20/NonLinearCombineFit.py +3 -2
  64. teradataml/data/docs/sqle/docs_17_20/OneHotEncodingFit.py +5 -0
  65. teradataml/data/docs/sqle/docs_17_20/OneHotEncodingTransform.py +6 -0
  66. teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +2 -0
  67. teradataml/data/docs/sqle/docs_17_20/Pivoting.py +279 -0
  68. teradataml/data/docs/sqle/docs_17_20/ROC.py +3 -2
  69. teradataml/data/docs/sqle/docs_17_20/SVMPredict.py +13 -2
  70. teradataml/data/docs/sqle/docs_17_20/ScaleFit.py +119 -1
  71. teradataml/data/docs/sqle/docs_17_20/ScaleTransform.py +93 -1
  72. teradataml/data/docs/sqle/docs_17_20/Shap.py +197 -0
  73. teradataml/data/docs/sqle/docs_17_20/TDGLMPredict.py +163 -1
  74. teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +189 -0
  75. teradataml/data/docs/sqle/docs_17_20/TFIDF.py +142 -0
  76. teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
  77. teradataml/data/docs/sqle/docs_17_20/XGBoost.py +12 -4
  78. teradataml/data/docs/sqle/docs_17_20/XGBoostPredict.py +7 -1
  79. teradataml/data/docs/sqle/docs_17_20/ZTest.py +72 -7
  80. teradataml/data/docs/uaf/docs_17_20/ACF.py +1 -10
  81. teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +1 -1
  82. teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +35 -5
  83. teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +3 -1
  84. teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +293 -0
  85. teradataml/data/docs/uaf/docs_17_20/AutoArima.py +354 -0
  86. teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +3 -2
  87. teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +1 -1
  88. teradataml/data/docs/uaf/docs_17_20/Convolve.py +13 -10
  89. teradataml/data/docs/uaf/docs_17_20/Convolve2.py +4 -1
  90. teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +5 -4
  91. teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +4 -4
  92. teradataml/data/docs/uaf/docs_17_20/DWT.py +235 -0
  93. teradataml/data/docs/uaf/docs_17_20/DWT2D.py +214 -0
  94. teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +1 -1
  95. teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +1 -1
  96. teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +160 -0
  97. teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +1 -1
  98. teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +9 -31
  99. teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +4 -2
  100. teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +1 -8
  101. teradataml/data/docs/uaf/docs_17_20/IDWT.py +236 -0
  102. teradataml/data/docs/uaf/docs_17_20/IDWT2D.py +226 -0
  103. teradataml/data/docs/uaf/docs_17_20/IQR.py +134 -0
  104. teradataml/data/docs/uaf/docs_17_20/LineSpec.py +1 -1
  105. teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +2 -2
  106. teradataml/data/docs/uaf/docs_17_20/MAMean.py +3 -3
  107. teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +297 -0
  108. teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +15 -6
  109. teradataml/data/docs/uaf/docs_17_20/PACF.py +0 -1
  110. teradataml/data/docs/uaf/docs_17_20/Portman.py +2 -2
  111. teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +2 -2
  112. teradataml/data/docs/uaf/docs_17_20/Resample.py +9 -1
  113. teradataml/data/docs/uaf/docs_17_20/SAX.py +246 -0
  114. teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +17 -10
  115. teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +1 -1
  116. teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +3 -1
  117. teradataml/data/docs/uaf/docs_17_20/WindowDFFT.py +368 -0
  118. teradataml/data/dwt2d_dataTable.csv +65 -0
  119. teradataml/data/dwt_dataTable.csv +8 -0
  120. teradataml/data/dwt_filterTable.csv +3 -0
  121. teradataml/data/finance_data4.csv +13 -0
  122. teradataml/data/glm_example.json +28 -1
  123. teradataml/data/grocery_transaction.csv +19 -0
  124. teradataml/data/housing_train_segment.csv +201 -0
  125. teradataml/data/idwt2d_dataTable.csv +5 -0
  126. teradataml/data/idwt_dataTable.csv +8 -0
  127. teradataml/data/idwt_filterTable.csv +3 -0
  128. teradataml/data/insect2Cols.csv +61 -0
  129. teradataml/data/interval_data.csv +5 -0
  130. teradataml/data/jsons/paired_functions.json +14 -0
  131. teradataml/data/jsons/sqle/17.20/TD_ANOVA.json +99 -27
  132. teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
  133. teradataml/data/jsons/sqle/17.20/TD_FTest.json +166 -83
  134. teradataml/data/jsons/sqle/17.20/TD_GLM.json +90 -14
  135. teradataml/data/jsons/sqle/17.20/TD_GLMPREDICT.json +48 -5
  136. teradataml/data/jsons/sqle/17.20/TD_GetFutileColumns.json +5 -3
  137. teradataml/data/jsons/sqle/17.20/TD_KMeans.json +31 -11
  138. teradataml/data/jsons/sqle/17.20/TD_NaiveBayes.json +193 -0
  139. teradataml/data/jsons/sqle/17.20/TD_NaiveBayesPredict.json +212 -0
  140. teradataml/data/jsons/sqle/17.20/TD_NonLinearCombineFit.json +3 -2
  141. teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +9 -9
  142. teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
  143. teradataml/data/jsons/sqle/17.20/TD_ROC.json +2 -1
  144. teradataml/data/jsons/sqle/17.20/TD_SVM.json +16 -16
  145. teradataml/data/jsons/sqle/17.20/TD_SVMPredict.json +19 -1
  146. teradataml/data/jsons/sqle/17.20/TD_ScaleFit.json +168 -15
  147. teradataml/data/jsons/sqle/17.20/TD_ScaleTransform.json +50 -1
  148. teradataml/data/jsons/sqle/17.20/TD_Shap.json +222 -0
  149. teradataml/data/jsons/sqle/17.20/TD_TFIDF.json +162 -0
  150. teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
  151. teradataml/data/jsons/sqle/17.20/TD_XGBoost.json +25 -7
  152. teradataml/data/jsons/sqle/17.20/TD_XGBoostPredict.json +17 -4
  153. teradataml/data/jsons/sqle/17.20/TD_ZTest.json +157 -80
  154. teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
  155. teradataml/data/jsons/uaf/17.20/TD_ACF.json +1 -18
  156. teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +3 -16
  157. teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +0 -3
  158. teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +5 -3
  159. teradataml/data/jsons/uaf/17.20/TD_ARIMAXESTIMATE.json +362 -0
  160. teradataml/data/jsons/uaf/17.20/TD_AUTOARIMA.json +469 -0
  161. teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +0 -3
  162. teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +0 -2
  163. teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +2 -1
  164. teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +2 -5
  165. teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +3 -6
  166. teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +1 -3
  167. teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +0 -5
  168. teradataml/data/jsons/uaf/17.20/TD_DFFT.json +1 -4
  169. teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +2 -7
  170. teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +1 -2
  171. teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +0 -2
  172. teradataml/data/jsons/uaf/17.20/TD_DTW.json +3 -6
  173. teradataml/data/jsons/uaf/17.20/TD_DWT.json +173 -0
  174. teradataml/data/jsons/uaf/17.20/TD_DWT2D.json +160 -0
  175. teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +1 -1
  176. teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +16 -30
  177. teradataml/data/jsons/uaf/17.20/{TD_HOLT_WINTERS_FORECAST.json → TD_HOLT_WINTERS_FORECASTER.json} +1 -2
  178. teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +1 -15
  179. teradataml/data/jsons/uaf/17.20/TD_IDWT.json +162 -0
  180. teradataml/data/jsons/uaf/17.20/TD_IDWT2D.json +149 -0
  181. teradataml/data/jsons/uaf/17.20/TD_IQR.json +117 -0
  182. teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +1 -1
  183. teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +1 -1
  184. teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +1 -3
  185. teradataml/data/jsons/uaf/17.20/TD_MATRIX2IMAGE.json +209 -0
  186. teradataml/data/jsons/uaf/17.20/TD_PACF.json +2 -2
  187. teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +5 -5
  188. teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +48 -28
  189. teradataml/data/jsons/uaf/17.20/TD_SAX.json +208 -0
  190. teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +12 -6
  191. teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +0 -1
  192. teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +8 -8
  193. teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +1 -1
  194. teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +1 -1
  195. teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +400 -0
  196. teradataml/data/kmeans_example.json +5 -0
  197. teradataml/data/kmeans_table.csv +10 -0
  198. teradataml/data/load_example_data.py +8 -2
  199. teradataml/data/naivebayestextclassifier_example.json +1 -1
  200. teradataml/data/naivebayestextclassifierpredict_example.json +11 -0
  201. teradataml/data/onehot_encoder_train.csv +4 -0
  202. teradataml/data/openml_example.json +29 -0
  203. teradataml/data/peppers.png +0 -0
  204. teradataml/data/real_values.csv +14 -0
  205. teradataml/data/sax_example.json +8 -0
  206. teradataml/data/scale_attributes.csv +3 -0
  207. teradataml/data/scale_example.json +52 -1
  208. teradataml/data/scale_input_part_sparse.csv +31 -0
  209. teradataml/data/scale_input_partitioned.csv +16 -0
  210. teradataml/data/scale_input_sparse.csv +11 -0
  211. teradataml/data/scale_parameters.csv +3 -0
  212. teradataml/data/scripts/deploy_script.py +21 -2
  213. teradataml/data/scripts/sklearn/sklearn_fit.py +40 -37
  214. teradataml/data/scripts/sklearn/sklearn_fit_predict.py +22 -30
  215. teradataml/data/scripts/sklearn/sklearn_function.template +42 -24
  216. teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +23 -33
  217. teradataml/data/scripts/sklearn/sklearn_neighbors.py +19 -28
  218. teradataml/data/scripts/sklearn/sklearn_score.py +32 -32
  219. teradataml/data/scripts/sklearn/sklearn_transform.py +85 -42
  220. teradataml/data/star_pivot.csv +8 -0
  221. teradataml/data/templates/open_source_ml.json +2 -1
  222. teradataml/data/teradataml_example.json +97 -1
  223. teradataml/data/timestamp_data.csv +4 -0
  224. teradataml/data/titanic_dataset_unpivoted.csv +19 -0
  225. teradataml/data/uaf_example.json +55 -1
  226. teradataml/data/unpivot_example.json +15 -0
  227. teradataml/data/url_data.csv +9 -0
  228. teradataml/data/windowdfft.csv +16 -0
  229. teradataml/data/ztest_example.json +16 -0
  230. teradataml/dataframe/copy_to.py +9 -4
  231. teradataml/dataframe/data_transfer.py +125 -64
  232. teradataml/dataframe/dataframe.py +575 -57
  233. teradataml/dataframe/dataframe_utils.py +47 -9
  234. teradataml/dataframe/fastload.py +273 -90
  235. teradataml/dataframe/functions.py +339 -0
  236. teradataml/dataframe/row.py +160 -0
  237. teradataml/dataframe/setop.py +2 -2
  238. teradataml/dataframe/sql.py +740 -18
  239. teradataml/dataframe/window.py +1 -1
  240. teradataml/dbutils/dbutils.py +324 -18
  241. teradataml/geospatial/geodataframe.py +1 -1
  242. teradataml/geospatial/geodataframecolumn.py +1 -1
  243. teradataml/hyperparameter_tuner/optimizer.py +13 -13
  244. teradataml/lib/aed_0_1.dll +0 -0
  245. teradataml/opensource/sklearn/_sklearn_wrapper.py +254 -122
  246. teradataml/options/__init__.py +16 -5
  247. teradataml/options/configure.py +39 -6
  248. teradataml/options/display.py +2 -2
  249. teradataml/plot/axis.py +4 -4
  250. teradataml/scriptmgmt/UserEnv.py +26 -19
  251. teradataml/scriptmgmt/lls_utils.py +120 -16
  252. teradataml/table_operators/Script.py +4 -5
  253. teradataml/table_operators/TableOperator.py +160 -26
  254. teradataml/table_operators/table_operator_util.py +88 -41
  255. teradataml/table_operators/templates/dataframe_udf.template +63 -0
  256. teradataml/telemetry_utils/__init__.py +0 -0
  257. teradataml/telemetry_utils/queryband.py +52 -0
  258. teradataml/utils/validators.py +41 -3
  259. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/METADATA +191 -6
  260. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/RECORD +263 -185
  261. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/WHEEL +0 -0
  262. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/top_level.txt +0 -0
  263. {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/zip-safe +0 -0
@@ -0,0 +1,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
@@ -0,0 +1,297 @@
1
+ def Matrix2Image(data=None, data_filter_expr=None, image="PNG", type=None,
2
+ colormap="viridis", range=None, red=None, green=None,
3
+ blue=None, flip_x=False, flip_y=False,
4
+ input_fmt_input_mode=None,
5
+ output_fmt_index_style="NUMERICAL_SEQUENCE",
6
+ **generic_arguments):
7
+ """
8
+ DESCRIPTION:
9
+ Matrix2Image() function converts a matrix to an image.
10
+ The conversion produces an image using color maps.
11
+ The color image produced by Matrix2Image() is limited to
12
+ 8-bit color depth.
13
+ In previous versions, Plot() with MESH option was used to
14
+ convert a matrix to an image. Plot() is limited to a
15
+ single payload.
16
+ Matrix2Image() can combine three payloads to create RGB
17
+ color images.
18
+
19
+
20
+ PARAMETERS:
21
+ data:
22
+ Required Argument.
23
+ Specifies the input matrix.
24
+ Multiple payloads are supported, and each
25
+ payload column is transformed independently.
26
+ Only REAL or MULTIVAR_REAL payload content types are supported.
27
+ Types: TDMatrix
28
+
29
+ data_filter_expr:
30
+ Optional Argument.
31
+ Specifies the filter expression for "data".
32
+ Types: ColumnExpression
33
+
34
+ image:
35
+ Optional Argument.
36
+ Specifies the image output format.
37
+ It can be PNG or JPG.
38
+ Permitted Values: PNG, JPG
39
+ Default Value: PNG
40
+ Types: str
41
+
42
+ type:
43
+ Optional Argument.
44
+ Specifies the type of the image. It can be GRAY, RGB
45
+ or COLORMAP.
46
+ * GRAY has a single payload, the output
47
+ image is a gray scale image.
48
+ * RGB has three payloads corresponding to RED, GREEN and BLUE channels,
49
+ the output image is a RGB color image.
50
+ * COLORMAP has a single payload. The output image is a RGB color image.
51
+ Note:
52
+ If there is a single payload, then the default
53
+ type is GRAY. If there are three payloads, then the
54
+ default type is RGB.
55
+ Permitted Values: GRAY, RGB, COLORMAP
56
+ Types: str
57
+
58
+ colormap:
59
+ Optional Argument.
60
+ Specifies the colormap to use when the "type" is
61
+ COLORMAP. The values correspond to the colormap of
62
+ Plot(). If not specified, then the default colormap is
63
+ "viridis". The value is case-sensitive.
64
+ Default Value: viridis
65
+ Types: str
66
+
67
+ range:
68
+ Optional Argument.
69
+ Specifies the range of the single payload value to be
70
+ scaled. By default, the MIN and MAX values of the
71
+ payload are used as the range. Used when "type" is 'GRAY'
72
+ or 'COLORMAP'.
73
+ Types: float, list of float
74
+
75
+ red:
76
+ Optional Argument.
77
+ Specifies the range of the first payload value. By
78
+ default, the MIN and MAX values of the payload are
79
+ used as the range. It is only used when "type" is 'RGB'.
80
+ Types: float, list of float
81
+
82
+ green:
83
+ Optional Argument.
84
+ Specifies the range of the second payload value.By
85
+ default, the MIN and MAX values of the payload are
86
+ used as the range. It is only used when "type" is 'RGB'.
87
+ Types: float, list of float
88
+
89
+ blue:
90
+ Optional Argument.
91
+ Specifies the range of the third payload value. By
92
+ default, the MIN and MAX values of the payload are
93
+ used as the range. It is only used when "type" is 'RGB'.
94
+ Types: float, list of float
95
+
96
+ flip_x:
97
+ Optional Argument.
98
+ Specifies the indicator to flip the image horizontally.
99
+ When set to True, flip the image otherwise, do not
100
+ flip the image.
101
+ Default Value: False
102
+ Types: bool
103
+
104
+ flip_y:
105
+ Optional Argument.
106
+ Specifies the indicator to flip the image vertically.
107
+ When set to True, flip the image otherwise,
108
+ do not flip the image.
109
+ Default Value: False
110
+ Types: bool
111
+
112
+ input_fmt_input_mode:
113
+ Optional Argument.
114
+ Specifies the input mode supported by the function.
115
+ When there are two input series, then the "input_fmt_input_mode" .
116
+ specification is mandatory.
117
+ Permitted Values:
118
+ * ONE2ONE: Both the primary and secondary series specifications
119
+ contain a series name which identifies the two series
120
+ in the function.
121
+ * MANY2ONE: The MANY specification is the primary series
122
+ declaration. The secondary series specification
123
+ contains a series name that identifies the single
124
+ secondary series.
125
+ * MATCH: Both series are defined by their respective series
126
+ specification instance name declarations.
127
+ Types: str
128
+
129
+ output_fmt_index_style:
130
+ Optional Argument.
131
+ Specifies the index style of the output format.
132
+ Permitted Values: NUMERICAL_SEQUENCE
133
+ Default Value: NUMERICAL_SEQUENCE
134
+ Types: str
135
+
136
+ **generic_arguments:
137
+ Specifies the generic keyword arguments of UAF functions.
138
+ Below are the generic keyword arguments:
139
+ persist:
140
+ Optional Argument.
141
+ Specifies whether to persist the results of the
142
+ function in a table or not. When set to True,
143
+ results are persisted in a table; otherwise,
144
+ results are garbage collected at the end of the
145
+ session.
146
+ Note that, when UAF function is executed, an
147
+ analytic result table (ART) is created.
148
+ Default Value: False
149
+ Types: bool
150
+
151
+ volatile:
152
+ Optional Argument.
153
+ Specifies whether to put the results of the
154
+ function in a volatile ART or not. When set to
155
+ True, results are stored in a volatile ART,
156
+ otherwise not.
157
+ Default Value: False
158
+ Types: bool
159
+
160
+ output_table_name:
161
+ Optional Argument.
162
+ Specifies the name of the table to store results.
163
+ If not specified, a unique table name is internally
164
+ generated.
165
+ Types: str
166
+
167
+ output_db_name:
168
+ Optional Argument.
169
+ Specifies the name of the database to create output
170
+ table into. If not specified, table is created into
171
+ database specified by the user at the time of context
172
+ creation or configuration parameter. Argument is ignored,
173
+ if "output_table_name" is not specified.
174
+ Types: str
175
+
176
+
177
+ RETURNS:
178
+ Instance of Matrix2Image.
179
+ Output teradataml DataFrames can be accessed using attribute
180
+ references, such as Matrix2Image_obj.<attribute_name>.
181
+ Output teradataml DataFrame attribute name is:
182
+ 1. result
183
+
184
+
185
+ RAISES:
186
+ TeradataMlException, TypeError, ValueError
187
+
188
+
189
+ EXAMPLES:
190
+ # Notes:
191
+ # 1. Get the connection to Vantage, before importing the
192
+ # function in user space.
193
+ # 2. User can import the function, if it is available on
194
+ # Vantage user is connected to.
195
+ # 3. To check the list of UAF analytic functions available
196
+ # on Vantage user connected to, use
197
+ # "display_analytic_functions()".
198
+
199
+ # Check the list of available UAF analytic functions.
200
+ display_analytic_functions(type="UAF")
201
+
202
+ # Import function Matrix2Image.
203
+ from teradataml import Matrix2Image
204
+
205
+ # Convert the image to matrix using 'TD_IMAGE2MATRIX' using output as gray.
206
+ import teradataml
207
+ # Drop the image table, matrixTable, matrixTable_rgb if it is present.
208
+ try:
209
+ db_drop_table('imageTable')
210
+ db_drop_table('matrixTable')
211
+ db_drop_table('matrixTable_rgb')
212
+ except:
213
+ pass
214
+
215
+ execute_sql('CREATE TABLE imageTable(id INTEGER, image BLOB);')
216
+
217
+ file_dir = os.path.join(os.path.dirname(teradataml.__file__), "data")
218
+ with open(os.path.join(file_dir,'peppers.png'), mode='rb') as file:
219
+ fileContent = file.read()
220
+
221
+ sql = 'INSERT INTO imageTable VALUES(?, ?);'
222
+ parameters = (1, fileContent)
223
+ execute_sql(sql, parameters)
224
+
225
+ execute_sql("CREATE TABLE matrixTable AS (SELECT * FROM TD_IMAGE2MATRIX ( ON (SELECT id, image FROM imageTable) USING OUTPUT ('gray')) t) WITH DATA PRIMARY INDEX (id, y, x);")
226
+ data = DataFrame('matrixTable')
227
+
228
+ # Create teradataml TDMatrix object.
229
+ data_matrix_df = TDMatrix(data=data,
230
+ id="id",
231
+ row_index="Y",
232
+ column_index="X",
233
+ row_index_style="SEQUENCE",
234
+ column_index_style="SEQUENCE",
235
+ payload_field="GRAY",
236
+ payload_content="REAL"
237
+ )
238
+
239
+ # Example 1: Generate Gray Scale Image Output with Fixed Range.
240
+ uaf_out = Matrix2Image(data=data_matrix_df,
241
+ range=[0,255])
242
+
243
+ # Print the result DataFrame.
244
+ print(uaf_out.result)
245
+
246
+
247
+ # Example 2: Generate Gray Scale Image Output with Automatic Range.
248
+ uaf_out = Matrix2Image(data=data_matrix_df)
249
+
250
+ # Print the result DataFrame.
251
+ print(uaf_out.result)
252
+
253
+
254
+ # Example 3: Generate Colormap Image Output.
255
+ uaf_out = Matrix2Image(data=data_matrix_df,
256
+ type='colormap',
257
+ colormap='viridis',
258
+ range=[0,255])
259
+
260
+ # Print the result DataFrame.
261
+ print(uaf_out.result)
262
+
263
+ # Convert the image to matrix using 'TD_IMAGE2MATRIX' using output as 'rgb'.
264
+ execute_sql("CREATE TABLE matrixTable_rgb AS (SELECT * FROM TD_IMAGE2MATRIX ( ON (SELECT id, image FROM imageTable) USING OUTPUT ('rgb')) t) WITH DATA PRIMARY INDEX (id, y, x);")
265
+
266
+ # Create teradataml DataFrame object.
267
+ data = DataFrame.from_table("matrixTable_rgb")
268
+
269
+ # Create teradataml TDMatrix object.
270
+ data_matrix_df = TDMatrix(data=data,
271
+ id="id",
272
+ row_index="Y",
273
+ column_index="X",
274
+ row_index_style="SEQUENCE",
275
+ column_index_style="SEQUENCE",
276
+ payload_field=["RED", "BLUE", "GREEN"],
277
+ payload_content="MULTIVAR_REAL"
278
+ )
279
+
280
+ # Example 4: Generate RGB Image Output with All Channels Range Fixed.
281
+ uaf_out = Matrix2Image(data=data_matrix_df,
282
+ red=[0,255],
283
+ green=[0,255],
284
+ blue=[0,255])
285
+
286
+ # Print the result DataFrame.
287
+ print(uaf_out.result)
288
+
289
+
290
+ # Example 5: Generate RGB Image Output with Automatic Range for All Channels.
291
+ uaf_out = Matrix2Image(data=data_matrix_df)
292
+
293
+ # Print the result DataFrame.
294
+ print(uaf_out.result)
295
+
296
+ """
297
+
@@ -113,13 +113,22 @@ def MatrixMultiply(data1=None, data1_filter_expr=None, data2=None,
113
113
  df2 = DataFrame.from_table("mtx2")
114
114
 
115
115
  # Create teradataml TDMatrix objects.
116
- data1_matrix_df = TDMatrix(data=df1, id='buoy_id', row_index='row_i',
117
- column_index = 'column_i', row_index_style="SEQUENCE",
118
- column_index_style="SEQUENCE", payload_field='speed1',
116
+ data1_matrix_df = TDMatrix(data=df1,
117
+ id='buoy_id',
118
+ row_index='row_i',
119
+ column_index='column_i',
120
+ row_index_style="SEQUENCE",
121
+ column_index_style="SEQUENCE",
122
+ payload_field='speed1',
119
123
  payload_content='REAL')
120
- data2_matrix_df = TDMatrix(data=df2, id='buoy_id', row_index='row_i',
121
- column_index = 'column_i', row_index_style="SEQUENCE",
122
- column_index_style="SEQUENCE", payload_field='speed2',
124
+
125
+ data2_matrix_df = TDMatrix(data=df2,
126
+ id='buoy_id',
127
+ row_index='row_i',
128
+ column_index='column_i',
129
+ row_index_style="SEQUENCE",
130
+ column_index_style="SEQUENCE",
131
+ payload_field='speed2',
123
132
  payload_content='REAL')
124
133
 
125
134
  # Example 1 : Perform a point-wise mathematical operation against two matrixes
@@ -146,7 +146,6 @@ def PACF(data=None, data_filter_expr=None,
146
146
 
147
147
  # Example 1 : Calculate the partial autocorrelation function coefficients using
148
148
  # 'LEVINSON_DURBIN' algorithm, with maximum of 10 lags.
149
-
150
149
  PACF_out = PACF(data=data_series_df,
151
150
  algorithm='LEVINSON_DURBIN',
152
151
  max_lags=10)
@@ -12,8 +12,8 @@ def Portman(data=None, data_filter_expr=None, max_lags=None, test=None,
12
12
  The following procedure is an example of how to use Portman() function:
13
13
  1. Use ArimaEstimate() function to get residuals from the data set.
14
14
  2. Use ArimaValidate() function to validate the output.
15
- 3. white noise using the "fitresiduals" output attributed of ArimaValidate() function.
16
-
15
+ 3. Use Portman() to check the residuals for zero mean white noise using the
16
+ "fitresiduals" output attribute of ArimaValidate() function.
17
17
 
18
18
  PARAMETERS:
19
19
  data:
@@ -16,7 +16,7 @@ def PowerSpec(data=None, data_filter_expr=None, freq_style=None,
16
16
  * Use ArimaValidate() to validate spectral candidates.
17
17
  * Use PowerSpec() with "freq_style" argument set to 'K_PERIODICITY'
18
18
  to perform spectral analysis.
19
- * Use Plot() to plot the results.
19
+ * Use DataFrame.plot() to plot the results.
20
20
  * Compute the test statistic.
21
21
  * Use SignifPeriodicities() on the periodicities of interest.
22
22
  More than one periodicities can be entered using the Periodicities
@@ -98,7 +98,7 @@ def PowerSpec(data=None, data_filter_expr=None, freq_style=None,
98
98
  a square wave window, which has a magnitude of '1.0'
99
99
  for the whole duration of the window.
100
100
  * TUKEY : Apply a Tukey smoothing window with the supplied
101
- alpha value. Must use with "window_param".
101
+ alpha value. Must be used with "window_param".
102
102
  * BARTLETT : Apply a Bartlett smoothing window.
103
103
  * PARZEN : Apply a Parzen smoothing window.
104
104
  * WELCH : Apply a Welch smoothing window.
@@ -2,7 +2,7 @@ def Resample(data=None, data_filter_expr=None, timecode_start_value=None,
2
2
  timecode_duration=None, sequence_start_value=None,
3
3
  sequence_duration=None, interpolate=None, weight=None,
4
4
  spline_params_method="NOT_A_KNOT", spline_params_yp1=0.0,
5
- spline_params_ypn=0.0, **generic_arguments):
5
+ spline_params_ypn=0.0, output_fmt_index_style='FLOW_THROUGH', **generic_arguments):
6
6
  """
7
7
  DESCRIPTION:
8
8
  The Resample() function transforms an irregular time series into a
@@ -83,6 +83,7 @@ def Resample(data=None, data_filter_expr=None, timecode_start_value=None,
83
83
  Specifies the interpolated weighted value.
84
84
  Note:
85
85
  * Applicable only when "interpolate" set to 'WEIGHTED'.
86
+ * The interpolated value is calculated as: Y_t = Y_{t_LEFT} * (1 - WEIGHT) + (Y-{t_RIGHT} * WEIGHT).
86
87
  Types: float
87
88
 
88
89
  spline_params_method:
@@ -117,6 +118,13 @@ def Resample(data=None, data_filter_expr=None, timecode_start_value=None,
117
118
  Default Value: 0.0
118
119
  Types: float
119
120
 
121
+ output_fmt_index_style:
122
+ Optional Argument.
123
+ Specifies the index style of the output format.
124
+ Permitted Values: NUMERICAL_SEQUENCE, FLOW_THROUGH
125
+ Default Value: FLOW_THROUGH
126
+ Types: str
127
+
120
128
  **generic_arguments:
121
129
  Specifies the generic keyword arguments of UAF functions.
122
130
  Below are the generic keyword arguments: