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,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:
@@ -0,0 +1,246 @@
1
+ def SAX(data=None, data_filter_expr=None, window_type='GLOBAL',
2
+ output_type='STRING', mean=None, std_dev=None,
3
+ window_size=None, output_frequency=1,
4
+ points_per_symbol=1, symbols_per_window=1,
5
+ alphabet_size=4, bitmap_level=2, code_stats=0,
6
+ breakpoints=None,
7
+ output_fmt_index_style="NUMERICAL_SEQUENCE",
8
+ **generic_arguments):
9
+ """
10
+ DESCRIPTION:
11
+ SAX() function uses Piecewise Aggregate Approximation (PAA) and
12
+ transform a timeseries into sequence of symbols.
13
+ The symbols can be characters, string, and bitmap.
14
+
15
+
16
+ PARAMETERS:
17
+ data:
18
+ Required Argument.
19
+ Specifies the time series whose value can be REAL or MULTIVAR_REAL.
20
+ Types: TDSeries
21
+
22
+ data_filter_expr:
23
+ Optional Argument.
24
+ Specifies the filter expression for "data".
25
+ Types: ColumnExpression
26
+
27
+ window_type:
28
+ Optional Argument.
29
+ Specifies the window type used in the SAX transformation.
30
+ Default Value: GLOBAL
31
+ Permitted Values: GLOBAL, SLIDING
32
+ Types: str
33
+
34
+ output_type:
35
+ Optional Argument.
36
+ Specifies the output format of the result.
37
+ Default Value: STRING
38
+ Permitted Values: STRING, BITMAP, O_CHARS
39
+ Types: str
40
+
41
+ mean:
42
+ Optional Argument.
43
+ Specifies the global mean values that used to
44
+ calculate the SAX code for every partition.
45
+ Note:
46
+ * If "mean" not specified, the function calculates the mean values
47
+ for every partition.
48
+ * If "mean" specifies a single value but there are multiple payloads,
49
+ the specified value will apply to all payloads.
50
+ * If "mean" specifies multiple values, each value will be
51
+ applied to its corresponding payload.
52
+ Types: float, list of float
53
+
54
+ std_dev:
55
+ Optional Argument.
56
+ Specifies the global standard deviation values that used to
57
+ calculate the SAX code for every partition.
58
+ Note:
59
+ * If "std_dev" not specified, the function calculates the standard
60
+ deviation values for every partition.
61
+ * If "std_dev" specifies a single value but there are multiple payloads,
62
+ the specified value will apply to all payloads.
63
+ * If "std_dev" specifies multiple values, each value will be
64
+ applied to its corresponding payload.
65
+ Types: float, list of float
66
+
67
+ window_size:
68
+ Optional Argument, Required if "window_type" is SLIDING.
69
+ Specifies the size of the window used in the SAX
70
+ transformation. Maximum value is 64000.
71
+ Types: int
72
+
73
+ output_frequency:
74
+ Optional Argument.
75
+ Specifies the number of data points that the window slides
76
+ between successive outputs.
77
+ Note:
78
+ * "output_frequency" is valid only for SLIDING "window_type".
79
+ Default Value: 1
80
+ Types: int
81
+
82
+ points_per_symbol:
83
+ Optional Argument.
84
+ Specifies the number of data points to be converted to one SAX
85
+ symbol.
86
+ Note:
87
+ * "points_per_symbol" is valid for GLOBAL "window_type".
88
+ Default Value: 1
89
+ Types: int
90
+
91
+ symbols_per_window:
92
+ Optional Argument.
93
+ Specifies the number of SAX symbols to be generated for each
94
+ window.
95
+ Note:
96
+ * "symbols_per_window" is valid for SLIDING "window_type".
97
+ Default Value: 1
98
+ Types: int
99
+
100
+ alphabet_size:
101
+ Optional Argument.
102
+ Specifies the number of symbols in the SAX alphabet.
103
+ The alphabet consists of letters from 'a' to 't'.
104
+ The size of the alphabet must be less than or equal to 20
105
+ and greater than or equal to 2.
106
+ Default Value: 4
107
+ Types: int
108
+
109
+ bitmap_level:
110
+ Optional Argument.
111
+ Specifies the level of the bitmap. The bitmap level
112
+ determines the number of consecutive symbols to be
113
+ converted to one symbol on a bitmap.
114
+ "bitmap_level" must be greater than or equal to 1 and less than or equal to 4.
115
+ Default Value: 2
116
+ Types: int
117
+
118
+ code_stats:
119
+ Optional Argument.
120
+ Specifies whether to print the mean and standard deviation
121
+ Default Value: 0
122
+ Types: int
123
+
124
+ breakpoints:
125
+ Optional Argument.
126
+ Specifies the breakpoints to form the SAX code based on "data".
127
+ Types: float, list of float
128
+
129
+ output_fmt_index_style:
130
+ Optional Argument.
131
+ Specifies the index style of the output format.
132
+ Permitted Values: NUMERICAL_SEQUENCE
133
+ Default Value: NUMERICAL_SEQUENCE
134
+ Types: str
135
+
136
+ **generic_arguments:
137
+ Specifies the generic keyword arguments of UAF functions.
138
+ Below are the generic keyword arguments:
139
+ persist:
140
+ Optional Argument.
141
+ Specifies whether to persist the results of the
142
+ function in a table or not. When set to True,
143
+ results are persisted in a table; otherwise,
144
+ results are garbage collected at the end of the
145
+ session.
146
+ Note that, when UAF function is executed, an
147
+ analytic result table (ART) is created.
148
+ Default Value: False
149
+ Types: bool
150
+
151
+ volatile:
152
+ Optional Argument.
153
+ Specifies whether to put the results of the
154
+ function in a volatile ART or not. When set to
155
+ True, results are stored in a volatile ART,
156
+ otherwise not.
157
+ Default Value: False
158
+ Types: bool
159
+
160
+ output_table_name:
161
+ Optional Argument.
162
+ Specifies the name of the table to store results.
163
+ If not specified, a unique table name is internally
164
+ generated.
165
+ Types: str
166
+
167
+ output_db_name:
168
+ Optional Argument.
169
+ Specifies the name of the database to create output
170
+ table into. If not specified, table is created into
171
+ database specified by the user at the time of context
172
+ creation or configuration parameter. Argument is ignored,
173
+ if "output_table_name" is not specified.
174
+ Types: str
175
+
176
+
177
+ RETURNS:
178
+ Instance of SAX.
179
+ Output teradataml DataFrames can be accessed using attribute
180
+ references, such as SAX_obj.<attribute_name>.
181
+ Output teradataml DataFrame attribute name is:
182
+ 1. result
183
+
184
+
185
+ RAISES:
186
+ TeradataMlException, TypeError, ValueError
187
+
188
+
189
+ EXAMPLES:
190
+ # Notes:
191
+ # 1. Get the connection to Vantage, before importing the
192
+ # function in user space.
193
+ # 2. User can import the function, if it is available on
194
+ # Vantage user is connected to.
195
+ # 3. To check the list of UAF analytic functions available
196
+ # on Vantage user connected to, use
197
+ # "display_analytic_functions()".
198
+
199
+ # Check the list of available UAF analytic functions.
200
+ display_analytic_functions(type="UAF")
201
+
202
+ # Import function SAX.
203
+ from teradataml import SAX
204
+
205
+ # Load the example data.
206
+ load_example_data("sax", ["finance_data4"])
207
+
208
+ # Create teradataml DataFrame object.
209
+ data = DataFrame.from_table("finance_data4")
210
+
211
+ # Create teradataml TDSeries object.
212
+ data_series_df = TDSeries(data=data,
213
+ id="id",
214
+ row_index="period",
215
+ row_index_style="SEQUENCE",
216
+ payload_field=["expenditure", "income", "investment"],
217
+ payload_content="MULTIVAR_REAL")
218
+
219
+ # Example 1: Execute SAX() function on the TDSeries to transform the
220
+ # time series into sequence of symbols using GLOBAL window.
221
+ uaf_out = SAX(data=data_series_df,
222
+ window_type='GLOBAL',
223
+ output_type='STRING',
224
+ mean=[2045.16666, 2387.41666,759.083333],
225
+ std_dev=[256.612489,317.496587,113.352594],
226
+ output_frequency=1,
227
+ points_per_symbol=2,
228
+ alphabet_size=10,
229
+ code_stats=True)
230
+
231
+ # Print the result DataFrame.
232
+ print(uaf_out.result)
233
+
234
+ # Example 2: Execute SAX() function on the TDSeries to transform the
235
+ # time series into sequence of symbols using SLIDING window.
236
+ uaf_out1 = SAX(data=data_series_df,
237
+ window_type='SLIDING',
238
+ window_size=4,
239
+ symbols_per_window=5,
240
+ code_stats=True)
241
+
242
+ # Print the result DataFrame.
243
+ print(uaf_out1.result)
244
+
245
+ """
246
+