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.
- teradataml/LICENSE-3RD-PARTY.pdf +0 -0
- teradataml/LICENSE.pdf +0 -0
- teradataml/README.md +183 -0
- teradataml/__init__.py +6 -3
- teradataml/_version.py +2 -2
- teradataml/analytics/__init__.py +3 -2
- teradataml/analytics/analytic_function_executor.py +275 -40
- teradataml/analytics/analytic_query_generator.py +92 -0
- teradataml/analytics/byom/__init__.py +3 -2
- teradataml/analytics/json_parser/metadata.py +1 -0
- teradataml/analytics/json_parser/utils.py +17 -21
- teradataml/analytics/meta_class.py +40 -1
- teradataml/analytics/sqle/DecisionTreePredict.py +1 -1
- teradataml/analytics/sqle/__init__.py +10 -2
- teradataml/analytics/table_operator/__init__.py +3 -2
- teradataml/analytics/uaf/__init__.py +21 -2
- teradataml/analytics/utils.py +62 -1
- teradataml/analytics/valib.py +1 -1
- teradataml/automl/__init__.py +1553 -319
- teradataml/automl/custom_json_utils.py +139 -61
- teradataml/automl/data_preparation.py +276 -319
- teradataml/automl/data_transformation.py +163 -81
- teradataml/automl/feature_engineering.py +402 -239
- teradataml/automl/feature_exploration.py +9 -2
- teradataml/automl/model_evaluation.py +48 -51
- teradataml/automl/model_training.py +291 -189
- teradataml/catalog/byom.py +8 -8
- teradataml/catalog/model_cataloging_utils.py +1 -1
- teradataml/clients/auth_client.py +133 -0
- teradataml/clients/pkce_client.py +1 -1
- teradataml/common/aed_utils.py +3 -2
- teradataml/common/constants.py +48 -6
- teradataml/common/deprecations.py +13 -7
- teradataml/common/garbagecollector.py +156 -120
- teradataml/common/messagecodes.py +6 -1
- teradataml/common/messages.py +3 -1
- teradataml/common/sqlbundle.py +1 -1
- teradataml/common/utils.py +103 -11
- teradataml/common/wrapper_utils.py +1 -1
- teradataml/context/context.py +121 -31
- teradataml/data/advertising.csv +201 -0
- teradataml/data/bank_marketing.csv +11163 -0
- teradataml/data/bike_sharing.csv +732 -0
- teradataml/data/boston2cols.csv +721 -0
- teradataml/data/breast_cancer.csv +570 -0
- teradataml/data/complaints_test_tokenized.csv +353 -0
- teradataml/data/complaints_tokens_model.csv +348 -0
- teradataml/data/covid_confirm_sd.csv +83 -0
- teradataml/data/customer_segmentation_test.csv +2628 -0
- teradataml/data/customer_segmentation_train.csv +8069 -0
- teradataml/data/dataframe_example.json +10 -0
- teradataml/data/docs/sqle/docs_17_10/OneHotEncodingFit.py +3 -1
- teradataml/data/docs/sqle/docs_17_10/OneHotEncodingTransform.py +6 -0
- teradataml/data/docs/sqle/docs_17_10/OutlierFilterTransform.py +5 -1
- teradataml/data/docs/sqle/docs_17_20/ANOVA.py +61 -1
- teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
- teradataml/data/docs/sqle/docs_17_20/ColumnTransformer.py +2 -0
- teradataml/data/docs/sqle/docs_17_20/FTest.py +105 -26
- teradataml/data/docs/sqle/docs_17_20/GLM.py +162 -1
- teradataml/data/docs/sqle/docs_17_20/GetFutileColumns.py +5 -3
- teradataml/data/docs/sqle/docs_17_20/KMeans.py +48 -1
- teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -0
- teradataml/data/docs/sqle/docs_17_20/NonLinearCombineFit.py +3 -2
- teradataml/data/docs/sqle/docs_17_20/OneHotEncodingFit.py +5 -0
- teradataml/data/docs/sqle/docs_17_20/OneHotEncodingTransform.py +6 -0
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +2 -0
- teradataml/data/docs/sqle/docs_17_20/Pivoting.py +279 -0
- teradataml/data/docs/sqle/docs_17_20/ROC.py +3 -2
- teradataml/data/docs/sqle/docs_17_20/SVMPredict.py +13 -2
- teradataml/data/docs/sqle/docs_17_20/ScaleFit.py +119 -1
- teradataml/data/docs/sqle/docs_17_20/ScaleTransform.py +93 -1
- teradataml/data/docs/sqle/docs_17_20/Shap.py +197 -0
- teradataml/data/docs/sqle/docs_17_20/TDGLMPredict.py +163 -1
- teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +189 -0
- teradataml/data/docs/sqle/docs_17_20/TFIDF.py +142 -0
- teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
- teradataml/data/docs/sqle/docs_17_20/XGBoost.py +12 -4
- teradataml/data/docs/sqle/docs_17_20/XGBoostPredict.py +7 -1
- teradataml/data/docs/sqle/docs_17_20/ZTest.py +72 -7
- teradataml/data/docs/uaf/docs_17_20/ACF.py +1 -10
- teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +35 -5
- teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +3 -1
- teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +293 -0
- teradataml/data/docs/uaf/docs_17_20/AutoArima.py +354 -0
- teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +3 -2
- teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/Convolve.py +13 -10
- teradataml/data/docs/uaf/docs_17_20/Convolve2.py +4 -1
- teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +5 -4
- teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +4 -4
- teradataml/data/docs/uaf/docs_17_20/DWT.py +235 -0
- teradataml/data/docs/uaf/docs_17_20/DWT2D.py +214 -0
- teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +160 -0
- teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +9 -31
- teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +4 -2
- teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +1 -8
- teradataml/data/docs/uaf/docs_17_20/IDWT.py +236 -0
- teradataml/data/docs/uaf/docs_17_20/IDWT2D.py +226 -0
- teradataml/data/docs/uaf/docs_17_20/IQR.py +134 -0
- teradataml/data/docs/uaf/docs_17_20/LineSpec.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/MAMean.py +3 -3
- teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +297 -0
- teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +15 -6
- teradataml/data/docs/uaf/docs_17_20/PACF.py +0 -1
- teradataml/data/docs/uaf/docs_17_20/Portman.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/Resample.py +9 -1
- teradataml/data/docs/uaf/docs_17_20/SAX.py +246 -0
- teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +17 -10
- teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +3 -1
- teradataml/data/docs/uaf/docs_17_20/WindowDFFT.py +368 -0
- teradataml/data/dwt2d_dataTable.csv +65 -0
- teradataml/data/dwt_dataTable.csv +8 -0
- teradataml/data/dwt_filterTable.csv +3 -0
- teradataml/data/finance_data4.csv +13 -0
- teradataml/data/glm_example.json +28 -1
- teradataml/data/grocery_transaction.csv +19 -0
- teradataml/data/housing_train_segment.csv +201 -0
- teradataml/data/idwt2d_dataTable.csv +5 -0
- teradataml/data/idwt_dataTable.csv +8 -0
- teradataml/data/idwt_filterTable.csv +3 -0
- teradataml/data/insect2Cols.csv +61 -0
- teradataml/data/interval_data.csv +5 -0
- teradataml/data/jsons/paired_functions.json +14 -0
- teradataml/data/jsons/sqle/17.20/TD_ANOVA.json +99 -27
- teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
- teradataml/data/jsons/sqle/17.20/TD_FTest.json +166 -83
- teradataml/data/jsons/sqle/17.20/TD_GLM.json +90 -14
- teradataml/data/jsons/sqle/17.20/TD_GLMPREDICT.json +48 -5
- teradataml/data/jsons/sqle/17.20/TD_GetFutileColumns.json +5 -3
- teradataml/data/jsons/sqle/17.20/TD_KMeans.json +31 -11
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayes.json +193 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayesPredict.json +212 -0
- teradataml/data/jsons/sqle/17.20/TD_NonLinearCombineFit.json +3 -2
- teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +9 -9
- teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
- teradataml/data/jsons/sqle/17.20/TD_ROC.json +2 -1
- teradataml/data/jsons/sqle/17.20/TD_SVM.json +16 -16
- teradataml/data/jsons/sqle/17.20/TD_SVMPredict.json +19 -1
- teradataml/data/jsons/sqle/17.20/TD_ScaleFit.json +168 -15
- teradataml/data/jsons/sqle/17.20/TD_ScaleTransform.json +50 -1
- teradataml/data/jsons/sqle/17.20/TD_Shap.json +222 -0
- teradataml/data/jsons/sqle/17.20/TD_TFIDF.json +162 -0
- teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
- teradataml/data/jsons/sqle/17.20/TD_XGBoost.json +25 -7
- teradataml/data/jsons/sqle/17.20/TD_XGBoostPredict.json +17 -4
- teradataml/data/jsons/sqle/17.20/TD_ZTest.json +157 -80
- teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
- teradataml/data/jsons/uaf/17.20/TD_ACF.json +1 -18
- teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +3 -16
- teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +0 -3
- teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +5 -3
- teradataml/data/jsons/uaf/17.20/TD_ARIMAXESTIMATE.json +362 -0
- teradataml/data/jsons/uaf/17.20/TD_AUTOARIMA.json +469 -0
- teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +0 -3
- teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +0 -2
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +2 -1
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +2 -5
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +3 -6
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +1 -3
- teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +0 -5
- teradataml/data/jsons/uaf/17.20/TD_DFFT.json +1 -4
- teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +2 -7
- teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +1 -2
- teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +0 -2
- teradataml/data/jsons/uaf/17.20/TD_DTW.json +3 -6
- teradataml/data/jsons/uaf/17.20/TD_DWT.json +173 -0
- teradataml/data/jsons/uaf/17.20/TD_DWT2D.json +160 -0
- teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +16 -30
- teradataml/data/jsons/uaf/17.20/{TD_HOLT_WINTERS_FORECAST.json → TD_HOLT_WINTERS_FORECASTER.json} +1 -2
- teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +1 -15
- teradataml/data/jsons/uaf/17.20/TD_IDWT.json +162 -0
- teradataml/data/jsons/uaf/17.20/TD_IDWT2D.json +149 -0
- teradataml/data/jsons/uaf/17.20/TD_IQR.json +117 -0
- teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +1 -3
- teradataml/data/jsons/uaf/17.20/TD_MATRIX2IMAGE.json +209 -0
- teradataml/data/jsons/uaf/17.20/TD_PACF.json +2 -2
- teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +5 -5
- teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +48 -28
- teradataml/data/jsons/uaf/17.20/TD_SAX.json +208 -0
- teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +12 -6
- teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +0 -1
- teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +8 -8
- teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +400 -0
- teradataml/data/kmeans_example.json +5 -0
- teradataml/data/kmeans_table.csv +10 -0
- teradataml/data/load_example_data.py +8 -2
- teradataml/data/naivebayestextclassifier_example.json +1 -1
- teradataml/data/naivebayestextclassifierpredict_example.json +11 -0
- teradataml/data/onehot_encoder_train.csv +4 -0
- teradataml/data/openml_example.json +29 -0
- teradataml/data/peppers.png +0 -0
- teradataml/data/real_values.csv +14 -0
- teradataml/data/sax_example.json +8 -0
- teradataml/data/scale_attributes.csv +3 -0
- teradataml/data/scale_example.json +52 -1
- teradataml/data/scale_input_part_sparse.csv +31 -0
- teradataml/data/scale_input_partitioned.csv +16 -0
- teradataml/data/scale_input_sparse.csv +11 -0
- teradataml/data/scale_parameters.csv +3 -0
- teradataml/data/scripts/deploy_script.py +21 -2
- teradataml/data/scripts/sklearn/sklearn_fit.py +40 -37
- teradataml/data/scripts/sklearn/sklearn_fit_predict.py +22 -30
- teradataml/data/scripts/sklearn/sklearn_function.template +42 -24
- teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +23 -33
- teradataml/data/scripts/sklearn/sklearn_neighbors.py +19 -28
- teradataml/data/scripts/sklearn/sklearn_score.py +32 -32
- teradataml/data/scripts/sklearn/sklearn_transform.py +85 -42
- teradataml/data/star_pivot.csv +8 -0
- teradataml/data/templates/open_source_ml.json +2 -1
- teradataml/data/teradataml_example.json +97 -1
- teradataml/data/timestamp_data.csv +4 -0
- teradataml/data/titanic_dataset_unpivoted.csv +19 -0
- teradataml/data/uaf_example.json +55 -1
- teradataml/data/unpivot_example.json +15 -0
- teradataml/data/url_data.csv +9 -0
- teradataml/data/windowdfft.csv +16 -0
- teradataml/data/ztest_example.json +16 -0
- teradataml/dataframe/copy_to.py +9 -4
- teradataml/dataframe/data_transfer.py +125 -64
- teradataml/dataframe/dataframe.py +575 -57
- teradataml/dataframe/dataframe_utils.py +47 -9
- teradataml/dataframe/fastload.py +273 -90
- teradataml/dataframe/functions.py +339 -0
- teradataml/dataframe/row.py +160 -0
- teradataml/dataframe/setop.py +2 -2
- teradataml/dataframe/sql.py +740 -18
- teradataml/dataframe/window.py +1 -1
- teradataml/dbutils/dbutils.py +324 -18
- teradataml/geospatial/geodataframe.py +1 -1
- teradataml/geospatial/geodataframecolumn.py +1 -1
- teradataml/hyperparameter_tuner/optimizer.py +13 -13
- teradataml/lib/aed_0_1.dll +0 -0
- teradataml/opensource/sklearn/_sklearn_wrapper.py +254 -122
- teradataml/options/__init__.py +16 -5
- teradataml/options/configure.py +39 -6
- teradataml/options/display.py +2 -2
- teradataml/plot/axis.py +4 -4
- teradataml/scriptmgmt/UserEnv.py +26 -19
- teradataml/scriptmgmt/lls_utils.py +120 -16
- teradataml/table_operators/Script.py +4 -5
- teradataml/table_operators/TableOperator.py +160 -26
- teradataml/table_operators/table_operator_util.py +88 -41
- teradataml/table_operators/templates/dataframe_udf.template +63 -0
- teradataml/telemetry_utils/__init__.py +0 -0
- teradataml/telemetry_utils/queryband.py +52 -0
- teradataml/utils/validators.py +41 -3
- {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/METADATA +191 -6
- {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/RECORD +263 -185
- {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/WHEEL +0 -0
- {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/top_level.txt +0 -0
- {teradataml-20.0.0.0.dist-info → teradataml-20.0.0.2.dist-info}/zip-safe +0 -0
|
@@ -172,7 +172,7 @@ def __get_json_files_directory():
|
|
|
172
172
|
# Check if current function type is allowed on connected Vantage version or not.
|
|
173
173
|
if func_info.value["func_type"] in func_type_json_version.keys():
|
|
174
174
|
yield [UtilFuncs._get_data_directory(dir_name="jsons", func_type=func_info,
|
|
175
|
-
|
|
175
|
+
version=func_type_json_version[func_info.value["func_type"]]),
|
|
176
176
|
func_info.name]
|
|
177
177
|
else:
|
|
178
178
|
yield [UtilFuncs._get_data_directory(dir_name="jsons", func_type=func_info), func_info.name]
|
|
@@ -237,7 +237,7 @@ def _process_paired_functions():
|
|
|
237
237
|
"""
|
|
238
238
|
|
|
239
239
|
json_path = os.path.join(UtilFuncs._get_data_directory(), "jsons", "paired_functions.json")
|
|
240
|
-
with open(json_path) as fp:
|
|
240
|
+
with open(json_path, encoding="utf8") as fp:
|
|
241
241
|
_json = json.load(fp)
|
|
242
242
|
|
|
243
243
|
_available_functions, _ = _JsonStore._get_function_list()
|
|
@@ -556,8 +556,10 @@ class _KNNPredict:
|
|
|
556
556
|
"train_data": self.train_data,
|
|
557
557
|
"input_columns": self.input_columns,
|
|
558
558
|
"response_column": kwargs.get("response_column", self.response_column),
|
|
559
|
-
|
|
560
|
-
|
|
559
|
+
# Retrieve the accumulate value from kwargs if available.
|
|
560
|
+
# otherwise, no accumulation will occur.
|
|
561
|
+
"accumulate": kwargs.get("accumulate")
|
|
562
|
+
}
|
|
561
563
|
|
|
562
564
|
# KNN works in a different way. predict calls the same function with test data along with
|
|
563
565
|
# the arguments passed to the actual function. The above parameters are required
|
|
@@ -608,12 +610,16 @@ class _Evaluate:
|
|
|
608
610
|
if self.get_function_name() == "NaiveBayesTextClassifierTrainer":
|
|
609
611
|
return True
|
|
610
612
|
# name of argument is model_type for most of the functions but for some it is different
|
|
611
|
-
if "model_type" not in kwargs:
|
|
613
|
+
if "model_type" not in kwargs and "tree_type" not in kwargs:
|
|
612
614
|
arg_name = self.get_arg_name()
|
|
613
615
|
model_type = getattr(self.obj, arg_name)
|
|
614
|
-
|
|
616
|
+
if self.get_function_name() == "DecisionForest":
|
|
617
|
+
kwargs["tree_type"] = model_type
|
|
618
|
+
else:
|
|
619
|
+
kwargs["model_type"] = model_type
|
|
615
620
|
|
|
616
|
-
if kwargs["model_type"].lower() == "binomial" or kwargs["model_type"].lower() == "classification"
|
|
621
|
+
if ("model_type" in kwargs and (kwargs["model_type"].lower() == "binomial" or kwargs["model_type"].lower() == "classification")) \
|
|
622
|
+
or ( "tree_type" in kwargs and kwargs["tree_type"].lower() == "classification"):
|
|
617
623
|
is_classification_model = True
|
|
618
624
|
|
|
619
625
|
return is_classification_model
|
|
@@ -720,20 +726,10 @@ class _Evaluate:
|
|
|
720
726
|
kwargs["observation_column"] = response_column
|
|
721
727
|
kwargs["prediction_column"] = "Prediction" if "Prediction" in predict.result.columns else "prediction"
|
|
722
728
|
|
|
723
|
-
#
|
|
724
|
-
#
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
pre_col_name = kwargs["prediction_column"]
|
|
728
|
-
if res[kwargs["observation_column"]] != res[pre_col_name]:
|
|
729
|
-
# Converting the prediction column datatype to observation column datatype.
|
|
730
|
-
cast_cols_pre = {pre_col_name: getattr(predict.result, pre_col_name).expression.cast(
|
|
731
|
-
type_=res[kwargs["observation_column"]])}
|
|
732
|
-
# Update the predicted result dataframe.
|
|
733
|
-
predict.result = predict.result.assign(**cast_cols_pre)
|
|
734
|
-
|
|
735
|
-
# Update the num_labels by the number of unique values.
|
|
736
|
-
kwargs["num_labels"] = predict.result.drop_duplicate(kwargs["observation_column"]).shape[0]
|
|
729
|
+
# Update the num_labels by the number of unique values if
|
|
730
|
+
# Labels are not passed.
|
|
731
|
+
if "labels" not in kwargs:
|
|
732
|
+
kwargs["num_labels"] = predict.result.drop_duplicate(kwargs["observation_column"]).shape[0]
|
|
737
733
|
|
|
738
734
|
kwargs["data"] = predict.result
|
|
739
735
|
|
|
@@ -192,6 +192,45 @@ def _common_init(self, function_type, **kwargs):
|
|
|
192
192
|
elif function_type == 'byom':
|
|
193
193
|
from teradataml.analytics.analytic_function_executor import _BYOMFunctionExecutor
|
|
194
194
|
self.obj = _BYOMFunctionExecutor(self.__class__.__name__)._execute_function(**kwargs)
|
|
195
|
+
elif function_type == 'stored_procedure':
|
|
196
|
+
from teradataml.analytics.analytic_function_executor import _StoredProcedureExecutor
|
|
197
|
+
self.obj = _StoredProcedureExecutor(self.__class__.__name__)._execute_function(**kwargs)
|
|
195
198
|
else:
|
|
196
199
|
from teradataml.analytics.analytic_function_executor import _TableOperatorExecutor
|
|
197
|
-
self.obj = _TableOperatorExecutor(self.__class__.__name__)._execute_function(**kwargs)
|
|
200
|
+
self.obj = _TableOperatorExecutor(self.__class__.__name__)._execute_function(**kwargs)
|
|
201
|
+
|
|
202
|
+
def _common_dir(self):
|
|
203
|
+
"""
|
|
204
|
+
DESCRIPTION:
|
|
205
|
+
Function returns the attributes and/or names of the methods of the
|
|
206
|
+
Analytic function.
|
|
207
|
+
|
|
208
|
+
PARAMETERS:
|
|
209
|
+
None
|
|
210
|
+
|
|
211
|
+
RETURNS:
|
|
212
|
+
list
|
|
213
|
+
|
|
214
|
+
RAISES:
|
|
215
|
+
None
|
|
216
|
+
|
|
217
|
+
Examples:
|
|
218
|
+
# Load the data.
|
|
219
|
+
titanic_data = DataFrame.from_table("titanic")
|
|
220
|
+
bin_fit_ip = DataFrame.from_table("bin_fit_ip")
|
|
221
|
+
|
|
222
|
+
# Run the function.
|
|
223
|
+
bin_code_1 = BincodeFit(data=titanic_data,
|
|
224
|
+
fit_data=bin_fit_ip,
|
|
225
|
+
fit_data_order_column = ['minVal', 'maxVal'],
|
|
226
|
+
target_columns='age',
|
|
227
|
+
minvalue_column='minVal',
|
|
228
|
+
maxvalue_column='maxVal',
|
|
229
|
+
label_column='label',
|
|
230
|
+
method_type='Variable-Width',
|
|
231
|
+
label_prefix='label_prefix'
|
|
232
|
+
)
|
|
233
|
+
# Run dir on the function.
|
|
234
|
+
dir(bin_code_1)
|
|
235
|
+
"""
|
|
236
|
+
return [attr for attr in super(self.__class__, self).__dir__() if attr != 'obj']
|
|
@@ -223,7 +223,7 @@ class DecisionTreePredict:
|
|
|
223
223
|
|
|
224
224
|
# Check to make sure input table types are strings or data frame objects or of valid type.
|
|
225
225
|
self.__awu._validate_input_table_datatype(self.newdata, "newdata", None)
|
|
226
|
-
self.__awu._validate_input_table_datatype(self.object, "object",
|
|
226
|
+
self.__awu._validate_input_table_datatype(self.object, "object", reference_function_name=None)
|
|
227
227
|
|
|
228
228
|
# Check whether the input columns passed to the argument are not empty.
|
|
229
229
|
# Also check whether the input columns passed to the argument valid or not.
|
|
@@ -2,7 +2,7 @@ from teradataml.analytics.sqle.DecisionTreePredict import DecisionTreePredict
|
|
|
2
2
|
from teradataml.analytics.sqle.NaiveBayesPredict import NaiveBayesPredict
|
|
3
3
|
|
|
4
4
|
from teradataml.analytics.meta_class import _AnalyticFunction
|
|
5
|
-
from teradataml.analytics.meta_class import _common_init
|
|
5
|
+
from teradataml.analytics.meta_class import _common_init, _common_dir
|
|
6
6
|
from teradataml.analytics.json_parser.utils import _get_associated_parent_classes
|
|
7
7
|
|
|
8
8
|
_sqle_functions = ['ANOVA',
|
|
@@ -11,6 +11,7 @@ _sqle_functions = ['ANOVA',
|
|
|
11
11
|
'BincodeFit',
|
|
12
12
|
'BincodeTransform',
|
|
13
13
|
'CategoricalSummary',
|
|
14
|
+
'CFilter',
|
|
14
15
|
'ChiSq',
|
|
15
16
|
'ClassificationEvaluator',
|
|
16
17
|
'ColumnSummary',
|
|
@@ -33,6 +34,8 @@ _sqle_functions = ['ANOVA',
|
|
|
33
34
|
'KMeansPredict',
|
|
34
35
|
'KNN',
|
|
35
36
|
'MovingAverage',
|
|
37
|
+
'NaiveBayes',
|
|
38
|
+
'TDNaiveBayesPredict',
|
|
36
39
|
'NaiveBayesTextClassifierPredict',
|
|
37
40
|
'NaiveBayesTextClassifierTrainer',
|
|
38
41
|
'NGramSplitter',
|
|
@@ -49,6 +52,7 @@ _sqle_functions = ['ANOVA',
|
|
|
49
52
|
'OutlierFilterFit',
|
|
50
53
|
'OutlierFilterTransform',
|
|
51
54
|
'Pack',
|
|
55
|
+
'Pivoting',
|
|
52
56
|
'PolynomialFeaturesFit',
|
|
53
57
|
'PolynomialFeaturesTransform',
|
|
54
58
|
'QQNorm',
|
|
@@ -72,15 +76,18 @@ _sqle_functions = ['ANOVA',
|
|
|
72
76
|
'SVM',
|
|
73
77
|
'SVMPredict',
|
|
74
78
|
'SVMSparsePredict',
|
|
79
|
+
'Shap',
|
|
75
80
|
'TDGLMPredict',
|
|
76
81
|
'TDDecisionForestPredict',
|
|
77
82
|
'TargetEncodingFit',
|
|
78
83
|
'TargetEncodingTransform',
|
|
79
84
|
'TextParser',
|
|
85
|
+
'TFIDF',
|
|
80
86
|
'Transform',
|
|
81
87
|
'TrainTestSplit',
|
|
82
88
|
'UnivariateStatistics',
|
|
83
89
|
'Unpack',
|
|
90
|
+
'Unpivoting',
|
|
84
91
|
'VectorDistance',
|
|
85
92
|
'WhichMax',
|
|
86
93
|
'WhichMin',
|
|
@@ -95,4 +102,5 @@ for func in _sqle_functions:
|
|
|
95
102
|
for assoc_cl in _get_associated_parent_classes(func):
|
|
96
103
|
_c = _c + (assoc_cl, )
|
|
97
104
|
globals()[func] = type("{}".format(func), _c, {"__init__": lambda self, **kwargs: _common_init(self, 'sqle',
|
|
98
|
-
**kwargs), "__doc__": _AnalyticFunction.__doc__
|
|
105
|
+
**kwargs), "__doc__": _AnalyticFunction.__doc__,
|
|
106
|
+
"__dir__": _common_dir})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from teradataml.analytics.meta_class import _AnalyticFunction
|
|
2
|
-
from teradataml.analytics.meta_class import _common_init
|
|
2
|
+
from teradataml.analytics.meta_class import _common_init, _common_dir
|
|
3
3
|
|
|
4
4
|
_nos_functions = ['ReadNOS', 'WriteNOS']
|
|
5
5
|
|
|
@@ -7,4 +7,5 @@ for func in _nos_functions:
|
|
|
7
7
|
globals()[func] = type("{}".format(func), (_AnalyticFunction,),
|
|
8
8
|
{"__init__": lambda self, **kwargs: _common_init(self,
|
|
9
9
|
'nos', **kwargs),
|
|
10
|
-
"__doc__": _AnalyticFunction.__doc__
|
|
10
|
+
"__doc__": _AnalyticFunction.__doc__,
|
|
11
|
+
"__dir__": _common_dir})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from teradataml.analytics.meta_class import _AnalyticFunction
|
|
2
|
-
from teradataml.analytics.meta_class import _common_init
|
|
2
|
+
from teradataml.analytics.meta_class import _common_init, _common_dir
|
|
3
3
|
from teradataml.analytics.json_parser.utils import _get_associated_parent_classes
|
|
4
4
|
|
|
5
5
|
_uaf_functions = ['ACF',
|
|
@@ -51,7 +51,17 @@ _uaf_functions = ['ACF',
|
|
|
51
51
|
'InputValidator',
|
|
52
52
|
'MInfo',
|
|
53
53
|
'SInfo',
|
|
54
|
-
'TrackingOp'
|
|
54
|
+
'TrackingOp',
|
|
55
|
+
'AutoArima',
|
|
56
|
+
'ArimaXEstimate',
|
|
57
|
+
'DWT',
|
|
58
|
+
'DWT2D',
|
|
59
|
+
'IDWT',
|
|
60
|
+
'IDWT2D',
|
|
61
|
+
'IQR',
|
|
62
|
+
'Matrix2Image',
|
|
63
|
+
'SAX',
|
|
64
|
+
'WindowDFFT']
|
|
55
65
|
|
|
56
66
|
for func in _uaf_functions:
|
|
57
67
|
_c = (_AnalyticFunction,)
|
|
@@ -60,4 +70,13 @@ for func in _uaf_functions:
|
|
|
60
70
|
globals()[func] = type("{}".format(func), _c,
|
|
61
71
|
{"__init__": lambda self, **kwargs: _common_init(self,
|
|
62
72
|
'uaf', **kwargs),
|
|
73
|
+
"__doc__": _AnalyticFunction.__doc__,
|
|
74
|
+
"__dir__": _common_dir})
|
|
75
|
+
|
|
76
|
+
_stored_procedure = ['FilterFactory1d']
|
|
77
|
+
|
|
78
|
+
for func in _stored_procedure:
|
|
79
|
+
globals()[func] = type("{}".format(func), (_AnalyticFunction,),
|
|
80
|
+
{"__init__": lambda self, **kwargs: _common_init(self,
|
|
81
|
+
'stored_procedure', **kwargs),
|
|
63
82
|
"__doc__": _AnalyticFunction.__doc__})
|
teradataml/analytics/utils.py
CHANGED
|
@@ -434,7 +434,25 @@ class FuncSpecialCaseHandler():
|
|
|
434
434
|
"NPath": {"mode": self._avoid_quote_for_arg,
|
|
435
435
|
"symbols": self._avoid_quote_for_arg,
|
|
436
436
|
"result": self._avoid_quote_for_arg,
|
|
437
|
-
"filter": self._avoid_quote_for_arg}
|
|
437
|
+
"filter": self._avoid_quote_for_arg},
|
|
438
|
+
"Pivoting": {"combined_column_sizes": self._handle_multiple_datatype},
|
|
439
|
+
"FilterFactory1d": {"database_name": self._single_quote_arg,
|
|
440
|
+
"table_name": self._single_quote_arg,
|
|
441
|
+
"filter_type": self._single_quote_arg,
|
|
442
|
+
"window_type": self._single_quote_arg,
|
|
443
|
+
"filter_description": self._single_quote_arg},
|
|
444
|
+
"DWT": {"wavelet": self._single_quote_arg},
|
|
445
|
+
"IDWT": {"part": self._single_quote_arg,
|
|
446
|
+
"wavelet": self._single_quote_arg,
|
|
447
|
+
"mode": self._single_quote_arg},
|
|
448
|
+
"DWT2D": {"wavelet": self._single_quote_arg,
|
|
449
|
+
"mode": self._single_quote_arg},
|
|
450
|
+
"IDWT2D": {"wavelet": self._single_quote_arg,
|
|
451
|
+
"mode": self._single_quote_arg},
|
|
452
|
+
"Matrix2Image": {"type": self._single_quote_arg,
|
|
453
|
+
"colormap": self._single_quote_arg
|
|
454
|
+
}
|
|
455
|
+
}
|
|
438
456
|
|
|
439
457
|
# Setter method for argument.
|
|
440
458
|
def set_arg_name(self, argument):
|
|
@@ -691,4 +709,47 @@ class FuncSpecialCaseHandler():
|
|
|
691
709
|
if sep in value and "-" != value[0]:
|
|
692
710
|
arg_value[num] = "[{}]".format(arg_value[num])
|
|
693
711
|
break
|
|
712
|
+
return arg_value
|
|
713
|
+
|
|
714
|
+
def _handle_multiple_datatype(self, arg_value, *args, **kwargs):
|
|
715
|
+
|
|
716
|
+
"""
|
|
717
|
+
DESCRIPTION:
|
|
718
|
+
Function to handle multiple data types in "arg_value".
|
|
719
|
+
* Function returns the "arg_value" in sqle expected format.
|
|
720
|
+
|
|
721
|
+
PARAMETERS:
|
|
722
|
+
arg_value:
|
|
723
|
+
Required Argument.
|
|
724
|
+
Specifies the arg_value to handle multiple data types.
|
|
725
|
+
Types: int or str or list of str(s)
|
|
726
|
+
|
|
727
|
+
RETURNS:
|
|
728
|
+
arg_value converted into sqle expected format.
|
|
729
|
+
|
|
730
|
+
RAISES:
|
|
731
|
+
None
|
|
732
|
+
|
|
733
|
+
EXAMPLES:
|
|
734
|
+
# Scenario 1: convert list of string into sqle expected format.
|
|
735
|
+
self._handle_multiple_datatype(arg_value)
|
|
736
|
+
# returns "'col1:1234','col2:1144','col3:214'"
|
|
737
|
+
|
|
738
|
+
# Scenario 2: convert string into sqle expected format.
|
|
739
|
+
self._handle_multiple_datatype(arg_value)
|
|
740
|
+
# returns "'col1:1234'"
|
|
741
|
+
"""
|
|
742
|
+
# Datatype of arg_value already validated inside function.
|
|
743
|
+
|
|
744
|
+
# Convert the pass value into sqle expected format.
|
|
745
|
+
# If argument value is a list, convert into sqle expected string format.
|
|
746
|
+
# If argument value is a string, add single quote.
|
|
747
|
+
# If argument value is a integer, return as it is.
|
|
748
|
+
if isinstance(arg_value, list):
|
|
749
|
+
if all(isinstance(i, str) for i in arg_value):
|
|
750
|
+
arg_value = "'" + "','".join(arg_value) + "'"
|
|
751
|
+
elif isinstance(arg_value, str):
|
|
752
|
+
arg_value = [arg_value]
|
|
753
|
+
arg_value = "'" + "','".join(arg_value) + "'"
|
|
754
|
+
|
|
694
755
|
return arg_value
|
teradataml/analytics/valib.py
CHANGED
|
@@ -13,7 +13,7 @@ import time
|
|
|
13
13
|
import uuid
|
|
14
14
|
from math import floor
|
|
15
15
|
|
|
16
|
-
from
|
|
16
|
+
from teradataml.telemetry_utils.queryband import collect_queryband
|
|
17
17
|
from teradataml.common import messages
|
|
18
18
|
from teradataml.common.constants import TeradataConstants, ValibConstants as VC
|
|
19
19
|
from teradataml.common.exceptions import TeradataMlException
|