teradataml 20.0.0.2__py3-none-any.whl → 20.0.0.4__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 (126) hide show
  1. teradataml/LICENSE-3RD-PARTY.pdf +0 -0
  2. teradataml/README.md +315 -2
  3. teradataml/__init__.py +4 -0
  4. teradataml/_version.py +1 -1
  5. teradataml/analytics/analytic_function_executor.py +95 -8
  6. teradataml/analytics/byom/__init__.py +1 -1
  7. teradataml/analytics/json_parser/metadata.py +12 -3
  8. teradataml/analytics/json_parser/utils.py +7 -2
  9. teradataml/analytics/sqle/__init__.py +5 -1
  10. teradataml/analytics/table_operator/__init__.py +1 -1
  11. teradataml/analytics/uaf/__init__.py +1 -1
  12. teradataml/analytics/utils.py +4 -0
  13. teradataml/analytics/valib.py +18 -4
  14. teradataml/automl/__init__.py +51 -6
  15. teradataml/automl/data_preparation.py +59 -35
  16. teradataml/automl/data_transformation.py +58 -33
  17. teradataml/automl/feature_engineering.py +27 -12
  18. teradataml/automl/model_training.py +73 -46
  19. teradataml/common/constants.py +88 -29
  20. teradataml/common/garbagecollector.py +2 -1
  21. teradataml/common/messagecodes.py +19 -3
  22. teradataml/common/messages.py +6 -1
  23. teradataml/common/sqlbundle.py +64 -12
  24. teradataml/common/utils.py +246 -47
  25. teradataml/common/warnings.py +11 -0
  26. teradataml/context/context.py +161 -27
  27. teradataml/data/amazon_reviews_25.csv +26 -0
  28. teradataml/data/byom_example.json +11 -0
  29. teradataml/data/dataframe_example.json +18 -2
  30. teradataml/data/docs/byom/docs/DataRobotPredict.py +2 -2
  31. teradataml/data/docs/byom/docs/DataikuPredict.py +40 -1
  32. teradataml/data/docs/byom/docs/H2OPredict.py +2 -2
  33. teradataml/data/docs/byom/docs/ONNXEmbeddings.py +242 -0
  34. teradataml/data/docs/byom/docs/ONNXPredict.py +2 -2
  35. teradataml/data/docs/byom/docs/PMMLPredict.py +2 -2
  36. teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +1 -1
  37. teradataml/data/docs/sqle/docs_17_20/Shap.py +34 -6
  38. teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +4 -4
  39. teradataml/data/docs/sqle/docs_17_20/TextParser.py +3 -3
  40. teradataml/data/docs/tableoperator/docs_17_20/Image2Matrix.py +118 -0
  41. teradataml/data/docs/uaf/docs_17_20/CopyArt.py +145 -0
  42. teradataml/data/docs/uaf/docs_17_20/DWT2D.py +4 -1
  43. teradataml/data/docs/uaf/docs_17_20/DickeyFuller.py +18 -21
  44. teradataml/data/hnsw_alter_data.csv +5 -0
  45. teradataml/data/hnsw_data.csv +10 -0
  46. teradataml/data/jsons/byom/h2opredict.json +1 -1
  47. teradataml/data/jsons/byom/onnxembeddings.json +266 -0
  48. teradataml/data/jsons/sqle/17.20/TD_Shap.json +0 -1
  49. teradataml/data/jsons/sqle/17.20/TD_TextParser.json +1 -1
  50. teradataml/data/jsons/sqle/20.00/TD_HNSW.json +296 -0
  51. teradataml/data/jsons/sqle/20.00/TD_HNSWPredict.json +206 -0
  52. teradataml/data/jsons/sqle/20.00/TD_HNSWSummary.json +32 -0
  53. teradataml/data/jsons/sqle/20.00/TD_KMeans.json +250 -0
  54. teradataml/data/jsons/sqle/20.00/TD_SMOTE.json +266 -0
  55. teradataml/data/jsons/sqle/20.00/TD_VectorDistance.json +278 -0
  56. teradataml/data/jsons/storedprocedure/17.20/TD_COPYART.json +71 -0
  57. teradataml/data/jsons/tableoperator/17.20/IMAGE2MATRIX.json +53 -0
  58. teradataml/data/jsons/uaf/17.20/TD_DICKEY_FULLER.json +10 -19
  59. teradataml/data/jsons/uaf/17.20/TD_SAX.json +3 -1
  60. teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +15 -5
  61. teradataml/data/medical_readings.csv +101 -0
  62. teradataml/data/patient_profile.csv +101 -0
  63. teradataml/data/scripts/lightgbm/dataset.template +157 -0
  64. teradataml/data/scripts/lightgbm/lightgbm_class_functions.template +247 -0
  65. teradataml/data/scripts/lightgbm/lightgbm_function.template +216 -0
  66. teradataml/data/scripts/lightgbm/lightgbm_sklearn.template +159 -0
  67. teradataml/data/scripts/sklearn/sklearn_fit.py +194 -167
  68. teradataml/data/scripts/sklearn/sklearn_fit_predict.py +136 -115
  69. teradataml/data/scripts/sklearn/sklearn_function.template +14 -19
  70. teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +155 -137
  71. teradataml/data/scripts/sklearn/sklearn_transform.py +129 -42
  72. teradataml/data/target_udt_data.csv +8 -0
  73. teradataml/data/templates/open_source_ml.json +3 -2
  74. teradataml/data/teradataml_example.json +8 -0
  75. teradataml/data/vectordistance_example.json +4 -0
  76. teradataml/dataframe/copy_to.py +8 -3
  77. teradataml/dataframe/data_transfer.py +11 -1
  78. teradataml/dataframe/dataframe.py +1049 -285
  79. teradataml/dataframe/dataframe_utils.py +152 -20
  80. teradataml/dataframe/functions.py +578 -35
  81. teradataml/dataframe/setop.py +11 -6
  82. teradataml/dataframe/sql.py +185 -16
  83. teradataml/dbutils/dbutils.py +1049 -115
  84. teradataml/dbutils/filemgr.py +48 -1
  85. teradataml/hyperparameter_tuner/optimizer.py +12 -1
  86. teradataml/lib/aed_0_1.dll +0 -0
  87. teradataml/opensource/__init__.py +1 -1
  88. teradataml/opensource/_base.py +1466 -0
  89. teradataml/opensource/_class.py +464 -0
  90. teradataml/opensource/{sklearn/constants.py → _constants.py} +21 -14
  91. teradataml/opensource/_lightgbm.py +949 -0
  92. teradataml/opensource/_sklearn.py +1008 -0
  93. teradataml/opensource/{sklearn/_wrapper_utils.py → _wrapper_utils.py} +5 -6
  94. teradataml/options/__init__.py +54 -38
  95. teradataml/options/configure.py +131 -27
  96. teradataml/options/display.py +13 -2
  97. teradataml/plot/axis.py +47 -8
  98. teradataml/plot/figure.py +33 -0
  99. teradataml/plot/plot.py +63 -13
  100. teradataml/scriptmgmt/UserEnv.py +5 -5
  101. teradataml/scriptmgmt/lls_utils.py +130 -40
  102. teradataml/store/__init__.py +12 -0
  103. teradataml/store/feature_store/__init__.py +0 -0
  104. teradataml/store/feature_store/constants.py +291 -0
  105. teradataml/store/feature_store/feature_store.py +2318 -0
  106. teradataml/store/feature_store/models.py +1505 -0
  107. teradataml/table_operators/Apply.py +32 -18
  108. teradataml/table_operators/Script.py +3 -1
  109. teradataml/table_operators/TableOperator.py +3 -1
  110. teradataml/table_operators/query_generator.py +3 -0
  111. teradataml/table_operators/table_operator_query_generator.py +3 -1
  112. teradataml/table_operators/table_operator_util.py +37 -38
  113. teradataml/table_operators/templates/dataframe_register.template +69 -0
  114. teradataml/utils/dtypes.py +51 -2
  115. teradataml/utils/internal_buffer.py +18 -0
  116. teradataml/utils/validators.py +99 -8
  117. {teradataml-20.0.0.2.dist-info → teradataml-20.0.0.4.dist-info}/METADATA +321 -5
  118. {teradataml-20.0.0.2.dist-info → teradataml-20.0.0.4.dist-info}/RECORD +121 -94
  119. teradataml/libaed_0_1.dylib +0 -0
  120. teradataml/libaed_0_1.so +0 -0
  121. teradataml/opensource/sklearn/__init__.py +0 -1
  122. teradataml/opensource/sklearn/_class.py +0 -255
  123. teradataml/opensource/sklearn/_sklearn_wrapper.py +0 -1800
  124. {teradataml-20.0.0.2.dist-info → teradataml-20.0.0.4.dist-info}/WHEEL +0 -0
  125. {teradataml-20.0.0.2.dist-info → teradataml-20.0.0.4.dist-info}/top_level.txt +0 -0
  126. {teradataml-20.0.0.2.dist-info → teradataml-20.0.0.4.dist-info}/zip-safe +0 -0
@@ -15,12 +15,16 @@ import os
15
15
  from pathlib import Path
16
16
  from sqlalchemy import func
17
17
  from sqlalchemy.sql.expression import text
18
+ import teradataml.dataframe as tdmldf
19
+ from teradataml.utils.internal_buffer import _InternalBuffer
18
20
  from teradatasql import OperationalError as SqlOperationalError
19
21
  from teradataml.common.exceptions import TeradataMlException
20
22
  from teradataml.common.messages import Messages
21
23
  from teradataml.common.messagecodes import MessageCodes
22
- from teradataml.dbutils.dbutils import _execute_stored_procedure
24
+ from teradataml.dbutils.dbutils import _execute_stored_procedure, set_session_param
23
25
  from teradataml.utils.validators import _Validators
26
+ from teradataml.options.configure import configure
27
+ from teradataml.common.constants import TableOperatorConstants
24
28
 
25
29
  def install_file(file_identifier, file_path = None, file_on_client = True, is_binary = False,
26
30
  replace = False, force_replace = False, suppress_output = False):
@@ -265,3 +269,46 @@ def remove_file(file_identifier, force_remove = None, suppress_output = False):
265
269
  raise TeradataMlException(Messages.get_message(MessageCodes.REMOVE_FILE_FAILED, file_identifier) +
266
270
  '\n' + str(err),
267
271
  MessageCodes.REMOVE_FILE_FAILED)
272
+
273
+ def list_files():
274
+ """
275
+ DESCRIPTION:
276
+ List all the files installed in Vantage or in Vantage Languages Ecosystem.
277
+
278
+ PARAMETERS:
279
+ None
280
+
281
+ RETURNS:
282
+ teradataml DataFrame
283
+
284
+ RAISES:
285
+ TeradataMLException.
286
+
287
+ EXAMPLES:
288
+ # Example 1: List files installed in the Vantage Ecosystem.
289
+ # Install the file mapper.py found at the relative path data/scripts/
290
+ >>> install_file (file_identifier='mapper', file_path='data/scripts/mapper.py')
291
+ File mapper.py installed in Vantage
292
+
293
+ # List file installed in the Vantage Ecosystem.
294
+ >>> list_files()
295
+ Files
296
+ 0 mapper.py
297
+ """
298
+ # Get the current database name.
299
+ import teradataml.context.context as context
300
+ database = context._get_current_databasename()
301
+
302
+ # set_session_param maintains a buffer of session parameters.
303
+ # If the session parameter is not set or if setted SearchUIFDBPath is different
304
+ # from the current database, then we will set the SEARCHUIFDBPATH to the current
305
+ # database. This will avoid setting the SEARCHUIFDBPATH multiple times.
306
+ session_params = _InternalBuffer.get('session_params')
307
+ if session_params is None or session_params["SearchUIFDBPath"] != database:
308
+ set_session_param("SEARCHUIFDBPATH", database)
309
+
310
+ # Get the query to list files installed in Vantage.
311
+ list_files_query = TableOperatorConstants.SCRIPT_LIST_FILES_QUERY.value \
312
+ .format(database, configure.default_varchar_size)
313
+
314
+ return tdmldf.dataframe.DataFrame.from_query(list_files_query)
@@ -25,6 +25,8 @@ from teradataml.common.messages import Messages, MessageCodes
25
25
  from teradataml.hyperparameter_tuner.utils import _ProgressBar
26
26
  from teradataml.utils.utils import _AsyncDBExecutor
27
27
  from teradataml.utils.validators import _Validators
28
+ from teradataml.options.configure import configure
29
+ from teradataml.common.constants import TeradataConstants
28
30
 
29
31
 
30
32
  class _BaseSearch:
@@ -1287,7 +1289,8 @@ class _BaseSearch:
1287
1289
  # Initialize logging.
1288
1290
  if verbose > 0:
1289
1291
  self.__progress_bar = _ProgressBar(jobs=len(self._parameter_grid), verbose=verbose)
1290
- if not run_parallel:
1292
+ # With VT option Parallel execution won't be possible, as it opens multiple connections.
1293
+ if not run_parallel or configure.temp_object_type == TeradataConstants.TERADATA_VOLATILE_TABLE:
1291
1294
  # Setting start time of Sequential execution.
1292
1295
  self.__start_time = time.time() if self.__timeout is not None else None
1293
1296
  # TODO: Factorize the code once parallel execution part is completed in ELE-6154 JIRA.
@@ -1339,6 +1342,10 @@ class _BaseSearch:
1339
1342
  self.__start_time = time.time() if self.__timeout is not None else None
1340
1343
  # Trigger parallel thread execution.
1341
1344
  self._async_executor.submit(self._execute_fit, *async_exec_params)
1345
+
1346
+ if len(self.__model_err_records) > 0 and not kwargs.get('suppress_refer_msg', False):
1347
+ print('\nAn error occurred during Model Training.'\
1348
+ ' Refer to get_error_log() for more details.')
1342
1349
 
1343
1350
 
1344
1351
  def __model_trainer_routine(self, model_param, iter, **kwargs):
@@ -2272,6 +2279,8 @@ class GridSearch(_BaseSearch):
2272
2279
  set of data as hyperparameter for model trainer function, the search
2273
2280
  determines the best data along with the best model based on the
2274
2281
  evaluation metrics.
2282
+ Note:
2283
+ * configure.temp_object_type="VT" follows sequential execution.
2275
2284
 
2276
2285
  PARAMETERS:
2277
2286
  func:
@@ -3196,6 +3205,8 @@ class RandomSearch(_BaseSearch):
3196
3205
  set of data as hyperparameter for model trainer function, the search
3197
3206
  determines the best data along with the best model based on the
3198
3207
  evaluation metrics.
3208
+ Note:
3209
+ * configure.temp_object_type="VT" follows sequential execution.
3199
3210
 
3200
3211
  PARAMETERS:
3201
3212
  func:
Binary file
@@ -1 +1 @@
1
- from teradataml.opensource.sklearn import td_sklearn
1
+ from teradataml.opensource._class import td_sklearn, td_lightgbm