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.
- teradataml/LICENSE-3RD-PARTY.pdf +0 -0
- teradataml/LICENSE.pdf +0 -0
- teradataml/README.md +306 -0
- teradataml/__init__.py +10 -3
- teradataml/_version.py +1 -1
- teradataml/analytics/__init__.py +3 -2
- teradataml/analytics/analytic_function_executor.py +299 -16
- teradataml/analytics/analytic_query_generator.py +92 -0
- teradataml/analytics/byom/__init__.py +3 -2
- teradataml/analytics/json_parser/metadata.py +13 -3
- teradataml/analytics/json_parser/utils.py +13 -6
- teradataml/analytics/meta_class.py +40 -1
- teradataml/analytics/sqle/DecisionTreePredict.py +1 -1
- teradataml/analytics/sqle/__init__.py +11 -2
- teradataml/analytics/table_operator/__init__.py +4 -3
- teradataml/analytics/uaf/__init__.py +21 -2
- teradataml/analytics/utils.py +66 -1
- teradataml/analytics/valib.py +1 -1
- teradataml/automl/__init__.py +1502 -323
- teradataml/automl/custom_json_utils.py +139 -61
- teradataml/automl/data_preparation.py +247 -307
- teradataml/automl/data_transformation.py +32 -12
- teradataml/automl/feature_engineering.py +325 -86
- teradataml/automl/model_evaluation.py +44 -35
- teradataml/automl/model_training.py +122 -153
- teradataml/catalog/byom.py +8 -8
- teradataml/clients/pkce_client.py +1 -1
- teradataml/common/__init__.py +2 -1
- teradataml/common/constants.py +72 -0
- teradataml/common/deprecations.py +13 -7
- teradataml/common/garbagecollector.py +152 -120
- teradataml/common/messagecodes.py +11 -2
- teradataml/common/messages.py +4 -1
- teradataml/common/sqlbundle.py +26 -4
- teradataml/common/utils.py +225 -14
- teradataml/common/wrapper_utils.py +1 -1
- teradataml/context/context.py +82 -2
- teradataml/data/SQL_Fundamentals.pdf +0 -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/dataframe_example.json +27 -1
- teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -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/Shap.py +203 -0
- 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/TextParser.py +3 -3
- teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
- teradataml/data/docs/tableoperator/docs_17_20/Image2Matrix.py +118 -0
- 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/CopyArt.py +145 -0
- 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/DickeyFuller.py +18 -21
- 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/grocery_transaction.csv +19 -0
- teradataml/data/idwt2d_dataTable.csv +5 -0
- teradataml/data/idwt_dataTable.csv +8 -0
- teradataml/data/idwt_filterTable.csv +3 -0
- teradataml/data/interval_data.csv +5 -0
- teradataml/data/jsons/paired_functions.json +14 -0
- teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
- 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_OneClassSVM.json +9 -9
- teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
- 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_TextParser.json +1 -1
- teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
- teradataml/data/jsons/sqle/20.00/TD_KMeans.json +250 -0
- teradataml/data/jsons/sqle/20.00/TD_SMOTE.json +266 -0
- teradataml/data/jsons/sqle/20.00/TD_VectorDistance.json +278 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_COPYART.json +71 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
- teradataml/data/jsons/tableoperator/17.20/IMAGE2MATRIX.json +53 -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_DICKEY_FULLER.json +10 -19
- 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 +210 -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 +410 -0
- teradataml/data/load_example_data.py +8 -2
- teradataml/data/medical_readings.csv +101 -0
- teradataml/data/naivebayestextclassifier_example.json +1 -1
- teradataml/data/naivebayestextclassifierpredict_example.json +11 -0
- teradataml/data/patient_profile.csv +101 -0
- teradataml/data/peppers.png +0 -0
- teradataml/data/real_values.csv +14 -0
- teradataml/data/sax_example.json +8 -0
- teradataml/data/scripts/deploy_script.py +1 -1
- teradataml/data/scripts/lightgbm/dataset.template +157 -0
- teradataml/data/scripts/lightgbm/lightgbm_class_functions.template +247 -0
- teradataml/data/scripts/lightgbm/lightgbm_function.template +216 -0
- teradataml/data/scripts/lightgbm/lightgbm_sklearn.template +159 -0
- teradataml/data/scripts/sklearn/sklearn_fit.py +194 -160
- teradataml/data/scripts/sklearn/sklearn_fit_predict.py +136 -115
- teradataml/data/scripts/sklearn/sklearn_function.template +34 -16
- teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +155 -137
- teradataml/data/scripts/sklearn/sklearn_neighbors.py +1 -1
- teradataml/data/scripts/sklearn/sklearn_score.py +12 -3
- teradataml/data/scripts/sklearn/sklearn_transform.py +162 -24
- teradataml/data/star_pivot.csv +8 -0
- teradataml/data/target_udt_data.csv +8 -0
- teradataml/data/templates/open_source_ml.json +3 -1
- teradataml/data/teradataml_example.json +20 -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/vectordistance_example.json +4 -0
- teradataml/data/windowdfft.csv +16 -0
- teradataml/dataframe/copy_to.py +1 -1
- teradataml/dataframe/data_transfer.py +5 -3
- teradataml/dataframe/dataframe.py +1002 -201
- teradataml/dataframe/fastload.py +3 -3
- teradataml/dataframe/functions.py +867 -0
- teradataml/dataframe/row.py +160 -0
- teradataml/dataframe/setop.py +2 -2
- teradataml/dataframe/sql.py +840 -33
- teradataml/dataframe/window.py +1 -1
- teradataml/dbutils/dbutils.py +878 -34
- teradataml/dbutils/filemgr.py +48 -1
- 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/__init__.py +1 -1
- teradataml/opensource/{sklearn/_class.py → _class.py} +102 -17
- teradataml/opensource/_lightgbm.py +950 -0
- teradataml/opensource/{sklearn/_wrapper_utils.py → _wrapper_utils.py} +1 -2
- teradataml/opensource/{sklearn/constants.py → constants.py} +13 -10
- teradataml/opensource/sklearn/__init__.py +0 -1
- teradataml/opensource/sklearn/_sklearn_wrapper.py +1019 -574
- teradataml/options/__init__.py +9 -23
- teradataml/options/configure.py +42 -4
- teradataml/options/display.py +2 -2
- teradataml/plot/axis.py +4 -4
- teradataml/scriptmgmt/UserEnv.py +13 -9
- teradataml/scriptmgmt/lls_utils.py +77 -23
- teradataml/store/__init__.py +13 -0
- teradataml/store/feature_store/__init__.py +0 -0
- teradataml/store/feature_store/constants.py +291 -0
- teradataml/store/feature_store/feature_store.py +2223 -0
- teradataml/store/feature_store/models.py +1505 -0
- teradataml/store/vector_store/__init__.py +1586 -0
- teradataml/table_operators/Script.py +2 -2
- teradataml/table_operators/TableOperator.py +106 -20
- teradataml/table_operators/query_generator.py +3 -0
- teradataml/table_operators/table_operator_query_generator.py +3 -1
- teradataml/table_operators/table_operator_util.py +102 -56
- teradataml/table_operators/templates/dataframe_register.template +69 -0
- 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/dtypes.py +4 -2
- teradataml/utils/validators.py +34 -2
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/METADATA +311 -3
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/RECORD +240 -157
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/WHEEL +0 -0
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/top_level.txt +0 -0
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
city,row_axis,cnumber
|
|
2
|
+
SanDiego,1,2
|
|
3
|
+
SanDiego,2,2
|
|
4
|
+
SanDiego,3,2
|
|
5
|
+
SanDiego,4,2
|
|
6
|
+
SanDiego,5,3
|
|
7
|
+
SanDiego,6,3
|
|
8
|
+
SanDiego,7,3
|
|
9
|
+
SanDiego,8,3
|
|
10
|
+
SanDiego,9,3
|
|
11
|
+
SanDiego,10,3
|
|
12
|
+
SanDiego,11,3
|
|
13
|
+
SanDiego,12,5
|
|
14
|
+
SanDiego,13,8
|
|
15
|
+
SanDiego,14,10
|
|
16
|
+
SanDiego,15,16
|
|
17
|
+
SanDiego,16,55
|
|
18
|
+
SanDiego,17,55
|
|
19
|
+
SanDiego,18,60
|
|
20
|
+
SanDiego,19,80
|
|
21
|
+
SanDiego,20,127
|
|
22
|
+
SanDiego,21,127
|
|
23
|
+
SanDiego,22,155
|
|
24
|
+
SanDiego,23,201
|
|
25
|
+
SanDiego,24,226
|
|
26
|
+
SanDiego,25,238
|
|
27
|
+
SanDiego,26,293
|
|
28
|
+
SanDiego,27,341
|
|
29
|
+
SanDiego,28,413
|
|
30
|
+
SanDiego,29,484
|
|
31
|
+
SanDiego,30,515
|
|
32
|
+
SanDiego,31,603
|
|
33
|
+
SanDiego,32,733
|
|
34
|
+
SanDiego,33,849
|
|
35
|
+
SanDiego,34,966
|
|
36
|
+
SanDiego,35,1112
|
|
37
|
+
SanDiego,36,1209
|
|
38
|
+
SanDiego,37,1326
|
|
39
|
+
SanDiego,38,1404
|
|
40
|
+
SanDiego,39,1454
|
|
41
|
+
SanDiego,40,1530
|
|
42
|
+
SanDiego,41,1628
|
|
43
|
+
SanDiego,42,1693
|
|
44
|
+
SanDiego,43,1761
|
|
45
|
+
SanDiego,44,1804
|
|
46
|
+
SanDiego,45,1847
|
|
47
|
+
SanDiego,46,1930
|
|
48
|
+
SanDiego,47,2012
|
|
49
|
+
SanDiego,48,2087
|
|
50
|
+
SanDiego,49,2158
|
|
51
|
+
SanDiego,50,2213
|
|
52
|
+
SanDiego,51,2268
|
|
53
|
+
SanDiego,52,2325
|
|
54
|
+
SanDiego,53,2491
|
|
55
|
+
SanDiego,54,2643
|
|
56
|
+
SanDiego,55,2826
|
|
57
|
+
SanDiego,56,2943
|
|
58
|
+
SanDiego,57,2943
|
|
59
|
+
SanDiego,58,3043
|
|
60
|
+
SanDiego,59,3141
|
|
61
|
+
SanDiego,60,3432
|
|
62
|
+
SanDiego,61,3432
|
|
63
|
+
SanDiego,62,3564
|
|
64
|
+
SanDiego,63,3711
|
|
65
|
+
SanDiego,64,3927
|
|
66
|
+
SanDiego,65,3927
|
|
67
|
+
SanDiego,66,4020
|
|
68
|
+
SanDiego,67,4319
|
|
69
|
+
SanDiego,68,4319
|
|
70
|
+
SanDiego,69,4429
|
|
71
|
+
SanDiego,70,4662
|
|
72
|
+
SanDiego,71,4776
|
|
73
|
+
SanDiego,72,5065
|
|
74
|
+
SanDiego,73,5161
|
|
75
|
+
SanDiego,74,5161
|
|
76
|
+
SanDiego,75,5391
|
|
77
|
+
SanDiego,76,5391
|
|
78
|
+
SanDiego,77,5662
|
|
79
|
+
SanDiego,78,5836
|
|
80
|
+
SanDiego,79,5836
|
|
81
|
+
SanDiego,80,6026
|
|
82
|
+
SanDiego,81,6140
|
|
83
|
+
SanDiego,82,6140
|
|
@@ -143,5 +143,31 @@
|
|
|
143
143
|
"smoker" : "varchar(4)",
|
|
144
144
|
"region" : "varchar(12)",
|
|
145
145
|
"charges" : "real"
|
|
146
|
-
}
|
|
146
|
+
},
|
|
147
|
+
"grocery_transaction":{
|
|
148
|
+
"tranid" : "integer",
|
|
149
|
+
"period" : "varchar(20)",
|
|
150
|
+
"storeid" : "integer",
|
|
151
|
+
"region" : "varchar(20)",
|
|
152
|
+
"item" : "varchar(20)",
|
|
153
|
+
"sku" : "integer",
|
|
154
|
+
"category" : "varchar(20)"
|
|
155
|
+
},
|
|
156
|
+
"medical_readings": {
|
|
157
|
+
"patient_id": "BIGINT",
|
|
158
|
+
"record_timestamp": "timestamp",
|
|
159
|
+
"glucose": "BIGINT",
|
|
160
|
+
"blood_pressure": "BIGINT",
|
|
161
|
+
"insulin": "BIGINT",
|
|
162
|
+
"diabetes_pedigree_function": "FLOAT",
|
|
163
|
+
"outcome": "BIGINT"
|
|
164
|
+
},
|
|
165
|
+
"patient_profile": {
|
|
166
|
+
"patient_id": "BIGINT",
|
|
167
|
+
"record_timestamp": "timestamp",
|
|
168
|
+
"pregnancies": "BIGINT",
|
|
169
|
+
"age": "BIGINT",
|
|
170
|
+
"bmi": "FLOAT",
|
|
171
|
+
"skin_thickness": "FLOAT"
|
|
172
|
+
}
|
|
147
173
|
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
def CFilter(data = None, target_column = None, transaction_id_columns = None,
|
|
2
|
+
partition_columns = None, max_distinct_items = 100,
|
|
3
|
+
**generic_arguments):
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
DESCRIPTION:
|
|
7
|
+
Function calculates several statistical measures of how likely
|
|
8
|
+
each pair of items is to be purchased together.
|
|
9
|
+
|
|
10
|
+
PARAMETERS:
|
|
11
|
+
data:
|
|
12
|
+
Required Argument.
|
|
13
|
+
Specifies the input teradataml DataFrame.
|
|
14
|
+
Types: teradataml DataFrame
|
|
15
|
+
|
|
16
|
+
target_column:
|
|
17
|
+
Required Argument.
|
|
18
|
+
Specifies name of the column from the "data" containing data for filtration.
|
|
19
|
+
Types: str
|
|
20
|
+
|
|
21
|
+
transaction_id_columns:
|
|
22
|
+
Required Argument.
|
|
23
|
+
Specifies the name of the columns in "data" containing transaction id that defines the groups of items listed
|
|
24
|
+
in the input columns that are purchased together.
|
|
25
|
+
Types: str OR list of Strings (str)
|
|
26
|
+
|
|
27
|
+
partition_columns:
|
|
28
|
+
Optional Argument.
|
|
29
|
+
Specifies the name of the column in "data" to partition the data on.
|
|
30
|
+
Types: str OR list of Strings (str)
|
|
31
|
+
|
|
32
|
+
max_distinct_items:
|
|
33
|
+
Optional Argument.
|
|
34
|
+
Specifies the maximum size of the item set.
|
|
35
|
+
Default Value: 100
|
|
36
|
+
Types: int
|
|
37
|
+
|
|
38
|
+
**generic_arguments:
|
|
39
|
+
Specifies the generic keyword arguments SQLE functions accept. Below
|
|
40
|
+
are the generic keyword arguments:
|
|
41
|
+
persist:
|
|
42
|
+
Optional Argument.
|
|
43
|
+
Specifies whether to persist the results of the
|
|
44
|
+
function in a table or not. When set to True,
|
|
45
|
+
results are persisted in a table; otherwise,
|
|
46
|
+
results are garbage collected at the end of the
|
|
47
|
+
session.
|
|
48
|
+
Default Value: False
|
|
49
|
+
Types: bool
|
|
50
|
+
|
|
51
|
+
volatile:
|
|
52
|
+
Optional Argument.
|
|
53
|
+
Specifies whether to put the results of the
|
|
54
|
+
function in a volatile table or not. When set to
|
|
55
|
+
True, results are stored in a volatile table,
|
|
56
|
+
otherwise not.
|
|
57
|
+
Default Value: False
|
|
58
|
+
Types: bool
|
|
59
|
+
|
|
60
|
+
Function allows the user to partition, hash, order or local
|
|
61
|
+
order the input data. These generic arguments are available
|
|
62
|
+
for each argument that accepts teradataml DataFrame as
|
|
63
|
+
input and can be accessed as:
|
|
64
|
+
* "<input_data_arg_name>_partition_column" accepts str or
|
|
65
|
+
list of str (Strings)
|
|
66
|
+
* "<input_data_arg_name>_hash_column" accepts str or list
|
|
67
|
+
of str (Strings)
|
|
68
|
+
* "<input_data_arg_name>_order_column" accepts str or list
|
|
69
|
+
of str (Strings)
|
|
70
|
+
* "local_order_<input_data_arg_name>" accepts boolean
|
|
71
|
+
Note:
|
|
72
|
+
These generic arguments are supported by teradataml if
|
|
73
|
+
the underlying SQL Engine function supports, else an
|
|
74
|
+
exception is raised.
|
|
75
|
+
|
|
76
|
+
RETURNS:
|
|
77
|
+
Instance of CFilter.
|
|
78
|
+
Output teradataml DataFrames can be accessed using attribute
|
|
79
|
+
references, such as CFilterObj.<attribute_name>.
|
|
80
|
+
Output teradataml DataFrame attribute name is:
|
|
81
|
+
result
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
RAISES:
|
|
85
|
+
TeradataMlException, TypeError, ValueError
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
EXAMPLES:
|
|
89
|
+
# Notes:
|
|
90
|
+
# 1. Get the connection to Vantage, before importing the
|
|
91
|
+
# function in user space.
|
|
92
|
+
# 2. User can import the function, if it is available on
|
|
93
|
+
# Vantage user is connected to.
|
|
94
|
+
# 3. To check the list of analytic functions available on
|
|
95
|
+
# Vantage user connected to, use
|
|
96
|
+
# "display_analytic_functions()".
|
|
97
|
+
|
|
98
|
+
# Load the example data.
|
|
99
|
+
load_example_data("dataframe", ["grocery_transaction"])
|
|
100
|
+
|
|
101
|
+
# Create teradataml DataFrame objects.
|
|
102
|
+
df = DataFrame.from_table("grocery_transaction")
|
|
103
|
+
|
|
104
|
+
# Check the list of available analytic functions.
|
|
105
|
+
display_analytic_functions()
|
|
106
|
+
|
|
107
|
+
# Import function CFilter.
|
|
108
|
+
from teradataml import CFilter
|
|
109
|
+
|
|
110
|
+
# Example 1: CFilter function to calculate the statistical measures
|
|
111
|
+
# of how likely each pair of items is to be purchased together, without
|
|
112
|
+
# specifying the partition_columns.
|
|
113
|
+
CFilter_out = CFilter(data=df,
|
|
114
|
+
target_column='item',
|
|
115
|
+
transaction_id_columns = 'tranid',
|
|
116
|
+
max_distinct_items=100)
|
|
117
|
+
|
|
118
|
+
# Print the result DataFrame.
|
|
119
|
+
print(CFilter_out.result)
|
|
120
|
+
|
|
121
|
+
# Example 2: CFilter function to calculate the statistical measures
|
|
122
|
+
# of how likely each pair of items is to be purchased together,
|
|
123
|
+
# specifying the partition_columns.
|
|
124
|
+
CFilter_out2 = CFilter(data=df,
|
|
125
|
+
target_column='item',
|
|
126
|
+
transaction_id_columns = 'tranid',
|
|
127
|
+
partiton_columns='storeid',
|
|
128
|
+
max_distinct_items=100)
|
|
129
|
+
|
|
130
|
+
# Print the result DataFrame.
|
|
131
|
+
print(CFilter_out2.result)
|
|
132
|
+
"""
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
def NaiveBayes(data = None, response_column = None, numeric_inputs = None,
|
|
2
|
+
categorical_inputs = None, attribute_name_column = None,
|
|
3
|
+
attribute_value_column = None, attribute_type = None,
|
|
4
|
+
numeric_attributes = None, categorical_attributes = None,
|
|
5
|
+
**generic_arguments):
|
|
6
|
+
"""
|
|
7
|
+
DESCRIPTION:
|
|
8
|
+
Function generates classification model using NaiveBayes
|
|
9
|
+
algorithm.
|
|
10
|
+
The Naive Bayes classification algorithm uses a training dataset with known discrete outcomes
|
|
11
|
+
and either discrete or continuous numeric input variables, along with categorical variables, to generate a model.
|
|
12
|
+
This model can then be used to predict the outcomes of future observations based on their input variable values.
|
|
13
|
+
|
|
14
|
+
PARAMETERS:
|
|
15
|
+
data:
|
|
16
|
+
Required Argument.
|
|
17
|
+
Specifies the input teradataml DataFrame .
|
|
18
|
+
Types: teradataml DataFrame
|
|
19
|
+
|
|
20
|
+
response_column:
|
|
21
|
+
Required Argument.
|
|
22
|
+
Specifies the name of the column in "data" containing response values.
|
|
23
|
+
Types: str
|
|
24
|
+
|
|
25
|
+
numeric_inputs:
|
|
26
|
+
Optional Argument.
|
|
27
|
+
Specifies the names of the columns in "data" containing numeric attributes values.
|
|
28
|
+
Types: str OR list of Strings (str)
|
|
29
|
+
|
|
30
|
+
categorical_inputs:
|
|
31
|
+
Optional Argument.
|
|
32
|
+
Specifies the names of the columns in "data" containing categorical attributes values.
|
|
33
|
+
Types: str OR list of Strings (str)
|
|
34
|
+
|
|
35
|
+
attribute_name_column:
|
|
36
|
+
Optional Argument.
|
|
37
|
+
Specifies the names of the columns in "data" containing attributes names.
|
|
38
|
+
Types: str
|
|
39
|
+
|
|
40
|
+
attribute_value_column:
|
|
41
|
+
Optional Argument.
|
|
42
|
+
Specifies the names of the columns in "data" containing attributes values.
|
|
43
|
+
Types: str
|
|
44
|
+
|
|
45
|
+
attribute_type:
|
|
46
|
+
Optional Argument, Required if "data" is in sparse format and
|
|
47
|
+
both "numeric_attributes" and "categorical_attributes" are not provided.
|
|
48
|
+
Specifies the attribute type.
|
|
49
|
+
Permitted Values:
|
|
50
|
+
* ALLNUMERIC - if all the attributes are of numeric type.
|
|
51
|
+
* ALLCATEGORICAL - if all the attributes are of categorical type.
|
|
52
|
+
Types: str
|
|
53
|
+
|
|
54
|
+
numeric_attributes:
|
|
55
|
+
Optional Argument.
|
|
56
|
+
Specifies the numeric attributes names.
|
|
57
|
+
Types: str OR list of strs
|
|
58
|
+
|
|
59
|
+
categorical_attributes:
|
|
60
|
+
Optional Argument.
|
|
61
|
+
Specifies the categorical attributes names.
|
|
62
|
+
Types: str OR list of strs
|
|
63
|
+
|
|
64
|
+
**generic_arguments:
|
|
65
|
+
Specifies the generic keyword arguments SQLE functions accept. Below
|
|
66
|
+
are the generic keyword arguments:
|
|
67
|
+
persist:
|
|
68
|
+
Optional Argument.
|
|
69
|
+
Specifies whether to persist the results of the
|
|
70
|
+
function in a table or not. When set to True,
|
|
71
|
+
results are persisted in a table; otherwise,
|
|
72
|
+
results are garbage collected at the end of the
|
|
73
|
+
session.
|
|
74
|
+
Default Value: False
|
|
75
|
+
Types: bool
|
|
76
|
+
|
|
77
|
+
volatile:
|
|
78
|
+
Optional Argument.
|
|
79
|
+
Specifies whether to put the results of the
|
|
80
|
+
function in a volatile table or not. When set to
|
|
81
|
+
True, results are stored in a volatile table,
|
|
82
|
+
otherwise not.
|
|
83
|
+
Default Value: False
|
|
84
|
+
Types: bool
|
|
85
|
+
|
|
86
|
+
Function allows the user to partition, hash, order or local
|
|
87
|
+
order the input data. These generic arguments are available
|
|
88
|
+
for each argument that accepts teradataml DataFrame as
|
|
89
|
+
input and can be accessed as:
|
|
90
|
+
* "<input_data_arg_name>_partition_column" accepts str or
|
|
91
|
+
list of str (Strings)
|
|
92
|
+
* "<input_data_arg_name>_hash_column" accepts str or list
|
|
93
|
+
of str (Strings)
|
|
94
|
+
* "<input_data_arg_name>_order_column" accepts str or list
|
|
95
|
+
of str (Strings)
|
|
96
|
+
* "local_order_<input_data_arg_name>" accepts boolean
|
|
97
|
+
Note:
|
|
98
|
+
These generic arguments are supported by teradataml if
|
|
99
|
+
the underlying SQL Engine function supports, else an
|
|
100
|
+
exception is raised.
|
|
101
|
+
|
|
102
|
+
RETURNS:
|
|
103
|
+
Instance of NaiveBayes.
|
|
104
|
+
Output teradataml DataFrames can be accessed using attribute
|
|
105
|
+
references, such as NaiveBayesObj.<attribute_name>.
|
|
106
|
+
Output teradataml DataFrame attribute name is:
|
|
107
|
+
result
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
RAISES:
|
|
111
|
+
TeradataMlException, TypeError, ValueError
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
EXAMPLES:
|
|
115
|
+
# Notes:
|
|
116
|
+
# 1. Get the connection to Vantage, before importing the
|
|
117
|
+
# function in user space.
|
|
118
|
+
# 2. User can import the function, if it is available on
|
|
119
|
+
# Vantage user is connected to.
|
|
120
|
+
# 3. To check the list of analytic functions available on
|
|
121
|
+
# Vantage user connected to, use
|
|
122
|
+
# "display_analytic_functions()".
|
|
123
|
+
|
|
124
|
+
# Load the example data.
|
|
125
|
+
load_example_data("decisionforestpredict", ["housing_train", "housing_test"])
|
|
126
|
+
|
|
127
|
+
# Create teradataml DataFrame objects.
|
|
128
|
+
housing_train = DataFrame.from_table("housing_train")
|
|
129
|
+
|
|
130
|
+
# Check the list of available analytic functions.
|
|
131
|
+
display_analytic_functions()
|
|
132
|
+
|
|
133
|
+
# Import function NaiveBayes.
|
|
134
|
+
from teradataml import NaiveBayes, Unpivoting
|
|
135
|
+
|
|
136
|
+
# Example 1: NaiveBayes function to generate classification model using Dense input.
|
|
137
|
+
NaiveBayes_out = NaiveBayes(data=housing_train, response_column='homestyle',
|
|
138
|
+
numeric_inputs=['price','lotsize','bedrooms','bathrms','stories','garagepl'],
|
|
139
|
+
categorical_inputs=['driveway','recroom','fullbase','gashw','airco','prefarea'])
|
|
140
|
+
|
|
141
|
+
# Print the result DataFrame.
|
|
142
|
+
print( NaiveBayes_out.result)
|
|
143
|
+
|
|
144
|
+
# Example 2: NaiveBayes function to generate classification model using Sparse input.
|
|
145
|
+
|
|
146
|
+
# Unpivoting the data for sparse input to naive bayes.
|
|
147
|
+
upvt_data = Unpivoting(data = housing_train, id_column = 'sn',
|
|
148
|
+
target_columns = ['price','lotsize','bedrooms','bathrms','stories','garagepl','driveway',
|
|
149
|
+
'recroom','fullbase','gashw','airco','prefarea'],
|
|
150
|
+
attribute_column = "AttributeName", value_column = "AttributeValue",
|
|
151
|
+
accumulate = 'homestyle')
|
|
152
|
+
|
|
153
|
+
NaiveBayes_out = NaiveBayes(data=upvt_data.result,
|
|
154
|
+
response_column='homestyle',
|
|
155
|
+
attribute_name_column='AttributeName',
|
|
156
|
+
attribute_value_column='AttributeValue',
|
|
157
|
+
numeric_attributes=['price','lotsize','bedrooms','bathrms','stories','garagepl'],
|
|
158
|
+
categorical_attributes=['driveway','recroom','fullbase','gashw','airco','prefarea'])
|
|
159
|
+
|
|
160
|
+
# Print the result DataFrame.
|
|
161
|
+
print( NaiveBayes_out.result)
|
|
162
|
+
"""
|
|
@@ -16,6 +16,8 @@ def OutlierFilterFit(data=None, target_columns=None, group_columns=None, lower_p
|
|
|
16
16
|
* For information about PTCs, see Teradata Vantage™ - Analytics
|
|
17
17
|
Database International Character Set Support.
|
|
18
18
|
* This function does not support KanjiSJIS or Graphic data types.
|
|
19
|
+
* This function does not support "data_partition_column" and "data_order_column"
|
|
20
|
+
if the corresponding Vantage version is greater than or equal to 17.20.03.20.
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
PARAMETERS:
|