teradataml 17.20.0.6__py3-none-any.whl → 20.0.0.0__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 +238 -1
- teradataml/__init__.py +13 -3
- teradataml/_version.py +1 -1
- teradataml/analytics/Transformations.py +4 -4
- teradataml/analytics/__init__.py +0 -2
- teradataml/analytics/analytic_function_executor.py +3 -0
- teradataml/analytics/json_parser/utils.py +13 -12
- teradataml/analytics/sqle/DecisionTreePredict.py +15 -30
- teradataml/analytics/sqle/NaiveBayesPredict.py +11 -20
- teradataml/analytics/sqle/__init__.py +0 -13
- teradataml/analytics/utils.py +1 -0
- teradataml/analytics/valib.py +3 -0
- teradataml/automl/__init__.py +1628 -0
- teradataml/automl/custom_json_utils.py +1270 -0
- teradataml/automl/data_preparation.py +993 -0
- teradataml/automl/data_transformation.py +727 -0
- teradataml/automl/feature_engineering.py +1648 -0
- teradataml/automl/feature_exploration.py +547 -0
- teradataml/automl/model_evaluation.py +163 -0
- teradataml/automl/model_training.py +887 -0
- teradataml/catalog/__init__.py +0 -2
- teradataml/catalog/byom.py +49 -6
- teradataml/catalog/function_argument_mapper.py +0 -2
- teradataml/catalog/model_cataloging_utils.py +2 -1021
- teradataml/common/aed_utils.py +6 -2
- teradataml/common/constants.py +50 -58
- teradataml/common/deprecations.py +160 -0
- teradataml/common/garbagecollector.py +61 -104
- teradataml/common/messagecodes.py +27 -36
- teradataml/common/messages.py +11 -15
- teradataml/common/utils.py +205 -287
- teradataml/common/wrapper_utils.py +1 -110
- teradataml/context/context.py +150 -78
- teradataml/data/bank_churn.csv +10001 -0
- teradataml/data/bmi.csv +501 -0
- teradataml/data/docs/sqle/docs_17_10/BincodeFit.py +3 -3
- teradataml/data/docs/sqle/docs_17_10/BincodeTransform.py +6 -5
- teradataml/data/docs/sqle/docs_17_10/Fit.py +1 -1
- teradataml/data/docs/sqle/docs_17_10/OneHotEncodingTransform.py +1 -1
- teradataml/data/docs/sqle/docs_17_10/OutlierFilterTransform.py +1 -1
- teradataml/data/docs/sqle/docs_17_10/PolynomialFeaturesTransform.py +2 -2
- teradataml/data/docs/sqle/docs_17_10/RowNormalizeTransform.py +2 -1
- teradataml/data/docs/sqle/docs_17_10/ScaleTransform.py +1 -0
- teradataml/data/docs/sqle/docs_17_10/SimpleImputeTransform.py +1 -1
- teradataml/data/docs/sqle/docs_17_10/Transform.py +2 -1
- teradataml/data/docs/sqle/docs_17_20/BincodeFit.py +3 -3
- teradataml/data/docs/sqle/docs_17_20/BincodeTransform.py +6 -5
- teradataml/data/docs/sqle/docs_17_20/Fit.py +1 -1
- teradataml/data/docs/sqle/docs_17_20/GLM.py +1 -1
- teradataml/data/docs/sqle/docs_17_20/GLMPredictPerSegment.py +9 -10
- teradataml/data/docs/sqle/docs_17_20/KMeansPredict.py +3 -2
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierPredict.py +16 -15
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierTrainer.py +2 -2
- teradataml/data/docs/sqle/docs_17_20/NonLinearCombineFit.py +2 -2
- teradataml/data/docs/sqle/docs_17_20/NonLinearCombineTransform.py +8 -8
- teradataml/data/docs/sqle/docs_17_20/OneClassSVMPredict.py +21 -20
- teradataml/data/docs/sqle/docs_17_20/OneHotEncodingTransform.py +1 -1
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterTransform.py +8 -3
- teradataml/data/docs/sqle/docs_17_20/PolynomialFeaturesTransform.py +6 -5
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionTransform.py +6 -6
- teradataml/data/docs/sqle/docs_17_20/RowNormalizeTransform.py +2 -1
- teradataml/data/docs/sqle/docs_17_20/SVM.py +1 -1
- teradataml/data/docs/sqle/docs_17_20/SVMPredict.py +16 -16
- teradataml/data/docs/sqle/docs_17_20/ScaleTransform.py +1 -0
- teradataml/data/docs/sqle/docs_17_20/SimpleImputeTransform.py +3 -2
- teradataml/data/docs/sqle/docs_17_20/TDDecisionForestPredict.py +4 -4
- teradataml/data/docs/sqle/docs_17_20/TDGLMPredict.py +19 -19
- teradataml/data/docs/sqle/docs_17_20/TargetEncodingTransform.py +5 -4
- teradataml/data/docs/sqle/docs_17_20/Transform.py +2 -2
- teradataml/data/docs/sqle/docs_17_20/XGBoostPredict.py +9 -9
- teradataml/data/fish.csv +160 -0
- teradataml/data/glass_types.csv +215 -0
- teradataml/data/insurance.csv +1 -1
- teradataml/data/iris_data.csv +151 -0
- teradataml/data/jsons/sqle/17.10/TD_FunctionTransform.json +1 -0
- teradataml/data/jsons/sqle/17.10/TD_OneHotEncodingTransform.json +1 -0
- teradataml/data/jsons/sqle/17.10/TD_OutlierFilterTransform.json +1 -0
- teradataml/data/jsons/sqle/17.10/TD_PolynomialFeaturesTransform.json +1 -0
- teradataml/data/jsons/sqle/17.10/TD_RowNormalizeTransform.json +1 -0
- teradataml/data/jsons/sqle/17.10/TD_ScaleTransform.json +1 -0
- teradataml/data/jsons/sqle/17.10/TD_SimpleImputeTransform.json +1 -0
- teradataml/data/load_example_data.py +3 -0
- teradataml/data/multi_model_classification.csv +401 -0
- teradataml/data/multi_model_regression.csv +401 -0
- teradataml/data/openml_example.json +63 -0
- teradataml/data/scripts/deploy_script.py +65 -0
- teradataml/data/scripts/mapper.R +20 -0
- teradataml/data/scripts/sklearn/__init__.py +0 -0
- teradataml/data/scripts/sklearn/sklearn_fit.py +175 -0
- teradataml/data/scripts/sklearn/sklearn_fit_predict.py +135 -0
- teradataml/data/scripts/sklearn/sklearn_function.template +113 -0
- teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +158 -0
- teradataml/data/scripts/sklearn/sklearn_neighbors.py +152 -0
- teradataml/data/scripts/sklearn/sklearn_score.py +128 -0
- teradataml/data/scripts/sklearn/sklearn_transform.py +179 -0
- teradataml/data/templates/open_source_ml.json +9 -0
- teradataml/data/teradataml_example.json +73 -1
- teradataml/data/test_classification.csv +101 -0
- teradataml/data/test_prediction.csv +101 -0
- teradataml/data/test_regression.csv +101 -0
- teradataml/data/train_multiclass.csv +101 -0
- teradataml/data/train_regression.csv +101 -0
- teradataml/data/train_regression_multiple_labels.csv +101 -0
- teradataml/data/wine_data.csv +1600 -0
- teradataml/dataframe/copy_to.py +79 -13
- teradataml/dataframe/data_transfer.py +8 -0
- teradataml/dataframe/dataframe.py +910 -311
- teradataml/dataframe/dataframe_utils.py +102 -5
- teradataml/dataframe/fastload.py +11 -3
- teradataml/dataframe/setop.py +15 -2
- teradataml/dataframe/sql.py +3735 -77
- teradataml/dataframe/sql_function_parameters.py +56 -5
- teradataml/dataframe/vantage_function_types.py +45 -1
- teradataml/dataframe/window.py +30 -29
- teradataml/dbutils/dbutils.py +18 -1
- teradataml/geospatial/geodataframe.py +18 -7
- teradataml/geospatial/geodataframecolumn.py +5 -0
- teradataml/hyperparameter_tuner/optimizer.py +910 -120
- teradataml/hyperparameter_tuner/utils.py +131 -37
- teradataml/lib/aed_0_1.dll +0 -0
- teradataml/lib/libaed_0_1.dylib +0 -0
- teradataml/lib/libaed_0_1.so +0 -0
- teradataml/libaed_0_1.dylib +0 -0
- teradataml/libaed_0_1.so +0 -0
- teradataml/opensource/__init__.py +1 -0
- teradataml/opensource/sklearn/__init__.py +1 -0
- teradataml/opensource/sklearn/_class.py +255 -0
- teradataml/opensource/sklearn/_sklearn_wrapper.py +1668 -0
- teradataml/opensource/sklearn/_wrapper_utils.py +268 -0
- teradataml/opensource/sklearn/constants.py +54 -0
- teradataml/options/__init__.py +3 -6
- teradataml/options/configure.py +21 -20
- teradataml/scriptmgmt/UserEnv.py +61 -5
- teradataml/scriptmgmt/lls_utils.py +135 -53
- teradataml/table_operators/Apply.py +38 -6
- teradataml/table_operators/Script.py +45 -308
- teradataml/table_operators/TableOperator.py +182 -591
- teradataml/table_operators/__init__.py +0 -1
- teradataml/table_operators/table_operator_util.py +32 -40
- teradataml/utils/validators.py +127 -3
- {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/METADATA +243 -3
- {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/RECORD +147 -391
- teradataml/analytics/mle/AdaBoost.py +0 -651
- teradataml/analytics/mle/AdaBoostPredict.py +0 -564
- teradataml/analytics/mle/Antiselect.py +0 -342
- teradataml/analytics/mle/Arima.py +0 -641
- teradataml/analytics/mle/ArimaPredict.py +0 -477
- teradataml/analytics/mle/Attribution.py +0 -1070
- teradataml/analytics/mle/Betweenness.py +0 -658
- teradataml/analytics/mle/Burst.py +0 -711
- teradataml/analytics/mle/CCM.py +0 -600
- teradataml/analytics/mle/CCMPrepare.py +0 -324
- teradataml/analytics/mle/CFilter.py +0 -460
- teradataml/analytics/mle/ChangePointDetection.py +0 -572
- teradataml/analytics/mle/ChangePointDetectionRT.py +0 -477
- teradataml/analytics/mle/Closeness.py +0 -737
- teradataml/analytics/mle/ConfusionMatrix.py +0 -420
- teradataml/analytics/mle/Correlation.py +0 -477
- teradataml/analytics/mle/Correlation2.py +0 -573
- teradataml/analytics/mle/CoxHazardRatio.py +0 -679
- teradataml/analytics/mle/CoxPH.py +0 -556
- teradataml/analytics/mle/CoxSurvival.py +0 -478
- teradataml/analytics/mle/CumulativeMovAvg.py +0 -363
- teradataml/analytics/mle/DTW.py +0 -623
- teradataml/analytics/mle/DWT.py +0 -564
- teradataml/analytics/mle/DWT2D.py +0 -599
- teradataml/analytics/mle/DecisionForest.py +0 -716
- teradataml/analytics/mle/DecisionForestEvaluator.py +0 -363
- teradataml/analytics/mle/DecisionForestPredict.py +0 -561
- teradataml/analytics/mle/DecisionTree.py +0 -830
- teradataml/analytics/mle/DecisionTreePredict.py +0 -528
- teradataml/analytics/mle/ExponentialMovAvg.py +0 -418
- teradataml/analytics/mle/FMeasure.py +0 -402
- teradataml/analytics/mle/FPGrowth.py +0 -734
- teradataml/analytics/mle/FrequentPaths.py +0 -695
- teradataml/analytics/mle/GLM.py +0 -558
- teradataml/analytics/mle/GLML1L2.py +0 -547
- teradataml/analytics/mle/GLML1L2Predict.py +0 -519
- teradataml/analytics/mle/GLMPredict.py +0 -529
- teradataml/analytics/mle/HMMDecoder.py +0 -945
- teradataml/analytics/mle/HMMEvaluator.py +0 -901
- teradataml/analytics/mle/HMMSupervised.py +0 -521
- teradataml/analytics/mle/HMMUnsupervised.py +0 -572
- teradataml/analytics/mle/Histogram.py +0 -561
- teradataml/analytics/mle/IDWT.py +0 -476
- teradataml/analytics/mle/IDWT2D.py +0 -493
- teradataml/analytics/mle/IdentityMatch.py +0 -763
- teradataml/analytics/mle/Interpolator.py +0 -918
- teradataml/analytics/mle/KMeans.py +0 -485
- teradataml/analytics/mle/KNN.py +0 -627
- teradataml/analytics/mle/KNNRecommender.py +0 -488
- teradataml/analytics/mle/KNNRecommenderPredict.py +0 -581
- teradataml/analytics/mle/LAR.py +0 -439
- teradataml/analytics/mle/LARPredict.py +0 -478
- teradataml/analytics/mle/LDA.py +0 -548
- teradataml/analytics/mle/LDAInference.py +0 -492
- teradataml/analytics/mle/LDATopicSummary.py +0 -464
- teradataml/analytics/mle/LevenshteinDistance.py +0 -450
- teradataml/analytics/mle/LinReg.py +0 -433
- teradataml/analytics/mle/LinRegPredict.py +0 -438
- teradataml/analytics/mle/MinHash.py +0 -544
- teradataml/analytics/mle/Modularity.py +0 -587
- teradataml/analytics/mle/NEREvaluator.py +0 -410
- teradataml/analytics/mle/NERExtractor.py +0 -595
- teradataml/analytics/mle/NERTrainer.py +0 -458
- teradataml/analytics/mle/NGrams.py +0 -570
- teradataml/analytics/mle/NPath.py +0 -634
- teradataml/analytics/mle/NTree.py +0 -549
- teradataml/analytics/mle/NaiveBayes.py +0 -462
- teradataml/analytics/mle/NaiveBayesPredict.py +0 -513
- teradataml/analytics/mle/NaiveBayesTextClassifier.py +0 -607
- teradataml/analytics/mle/NaiveBayesTextClassifier2.py +0 -531
- teradataml/analytics/mle/NaiveBayesTextClassifierPredict.py +0 -799
- teradataml/analytics/mle/NamedEntityFinder.py +0 -529
- teradataml/analytics/mle/NamedEntityFinderEvaluator.py +0 -414
- teradataml/analytics/mle/NamedEntityFinderTrainer.py +0 -396
- teradataml/analytics/mle/POSTagger.py +0 -417
- teradataml/analytics/mle/Pack.py +0 -411
- teradataml/analytics/mle/PageRank.py +0 -535
- teradataml/analytics/mle/PathAnalyzer.py +0 -426
- teradataml/analytics/mle/PathGenerator.py +0 -367
- teradataml/analytics/mle/PathStart.py +0 -464
- teradataml/analytics/mle/PathSummarizer.py +0 -470
- teradataml/analytics/mle/Pivot.py +0 -471
- teradataml/analytics/mle/ROC.py +0 -425
- teradataml/analytics/mle/RandomSample.py +0 -637
- teradataml/analytics/mle/RandomWalkSample.py +0 -490
- teradataml/analytics/mle/SAX.py +0 -779
- teradataml/analytics/mle/SVMDense.py +0 -677
- teradataml/analytics/mle/SVMDensePredict.py +0 -536
- teradataml/analytics/mle/SVMDenseSummary.py +0 -437
- teradataml/analytics/mle/SVMSparse.py +0 -557
- teradataml/analytics/mle/SVMSparsePredict.py +0 -553
- teradataml/analytics/mle/SVMSparseSummary.py +0 -435
- teradataml/analytics/mle/Sampling.py +0 -549
- teradataml/analytics/mle/Scale.py +0 -565
- teradataml/analytics/mle/ScaleByPartition.py +0 -496
- teradataml/analytics/mle/ScaleMap.py +0 -378
- teradataml/analytics/mle/ScaleSummary.py +0 -320
- teradataml/analytics/mle/SentenceExtractor.py +0 -363
- teradataml/analytics/mle/SentimentEvaluator.py +0 -432
- teradataml/analytics/mle/SentimentExtractor.py +0 -578
- teradataml/analytics/mle/SentimentTrainer.py +0 -405
- teradataml/analytics/mle/SeriesSplitter.py +0 -641
- teradataml/analytics/mle/Sessionize.py +0 -475
- teradataml/analytics/mle/SimpleMovAvg.py +0 -397
- teradataml/analytics/mle/StringSimilarity.py +0 -425
- teradataml/analytics/mle/TF.py +0 -389
- teradataml/analytics/mle/TFIDF.py +0 -504
- teradataml/analytics/mle/TextChunker.py +0 -414
- teradataml/analytics/mle/TextClassifier.py +0 -399
- teradataml/analytics/mle/TextClassifierEvaluator.py +0 -413
- teradataml/analytics/mle/TextClassifierTrainer.py +0 -565
- teradataml/analytics/mle/TextMorph.py +0 -494
- teradataml/analytics/mle/TextParser.py +0 -623
- teradataml/analytics/mle/TextTagger.py +0 -530
- teradataml/analytics/mle/TextTokenizer.py +0 -502
- teradataml/analytics/mle/UnivariateStatistics.py +0 -488
- teradataml/analytics/mle/Unpack.py +0 -526
- teradataml/analytics/mle/Unpivot.py +0 -438
- teradataml/analytics/mle/VarMax.py +0 -776
- teradataml/analytics/mle/VectorDistance.py +0 -762
- teradataml/analytics/mle/WeightedMovAvg.py +0 -400
- teradataml/analytics/mle/XGBoost.py +0 -842
- teradataml/analytics/mle/XGBoostPredict.py +0 -627
- teradataml/analytics/mle/__init__.py +0 -123
- teradataml/analytics/mle/json/adaboost_mle.json +0 -135
- teradataml/analytics/mle/json/adaboostpredict_mle.json +0 -85
- teradataml/analytics/mle/json/antiselect_mle.json +0 -34
- teradataml/analytics/mle/json/antiselect_mle_mle.json +0 -34
- teradataml/analytics/mle/json/arima_mle.json +0 -172
- teradataml/analytics/mle/json/arimapredict_mle.json +0 -52
- teradataml/analytics/mle/json/attribution_mle_mle.json +0 -143
- teradataml/analytics/mle/json/betweenness_mle.json +0 -97
- teradataml/analytics/mle/json/burst_mle.json +0 -140
- teradataml/analytics/mle/json/ccm_mle.json +0 -124
- teradataml/analytics/mle/json/ccmprepare_mle.json +0 -14
- teradataml/analytics/mle/json/cfilter_mle.json +0 -93
- teradataml/analytics/mle/json/changepointdetection_mle.json +0 -92
- teradataml/analytics/mle/json/changepointdetectionrt_mle.json +0 -78
- teradataml/analytics/mle/json/closeness_mle.json +0 -104
- teradataml/analytics/mle/json/confusionmatrix_mle.json +0 -79
- teradataml/analytics/mle/json/correlation_mle.json +0 -86
- teradataml/analytics/mle/json/correlationreduce_mle.json +0 -49
- teradataml/analytics/mle/json/coxhazardratio_mle.json +0 -89
- teradataml/analytics/mle/json/coxph_mle.json +0 -98
- teradataml/analytics/mle/json/coxsurvival_mle.json +0 -79
- teradataml/analytics/mle/json/cumulativemovavg_mle.json +0 -34
- teradataml/analytics/mle/json/decisionforest_mle.json +0 -167
- teradataml/analytics/mle/json/decisionforestevaluator_mle.json +0 -33
- teradataml/analytics/mle/json/decisionforestpredict_mle_mle.json +0 -74
- teradataml/analytics/mle/json/decisiontree_mle.json +0 -194
- teradataml/analytics/mle/json/decisiontreepredict_mle_mle.json +0 -86
- teradataml/analytics/mle/json/dtw_mle.json +0 -97
- teradataml/analytics/mle/json/dwt2d_mle.json +0 -116
- teradataml/analytics/mle/json/dwt_mle.json +0 -101
- teradataml/analytics/mle/json/exponentialmovavg_mle.json +0 -55
- teradataml/analytics/mle/json/fmeasure_mle.json +0 -58
- teradataml/analytics/mle/json/fpgrowth_mle.json +0 -159
- teradataml/analytics/mle/json/frequentpaths_mle.json +0 -129
- teradataml/analytics/mle/json/glm_mle.json +0 -111
- teradataml/analytics/mle/json/glml1l2_mle.json +0 -106
- teradataml/analytics/mle/json/glml1l2predict_mle.json +0 -57
- teradataml/analytics/mle/json/glmpredict_mle_mle.json +0 -74
- teradataml/analytics/mle/json/histogram_mle.json +0 -100
- teradataml/analytics/mle/json/hmmdecoder_mle.json +0 -192
- teradataml/analytics/mle/json/hmmevaluator_mle.json +0 -206
- teradataml/analytics/mle/json/hmmsupervised_mle.json +0 -91
- teradataml/analytics/mle/json/hmmunsupervised_mle.json +0 -114
- teradataml/analytics/mle/json/identitymatch_mle.json +0 -88
- teradataml/analytics/mle/json/idwt2d_mle.json +0 -73
- teradataml/analytics/mle/json/idwt_mle.json +0 -66
- teradataml/analytics/mle/json/interpolator_mle.json +0 -151
- teradataml/analytics/mle/json/kmeans_mle.json +0 -97
- teradataml/analytics/mle/json/knn_mle.json +0 -141
- teradataml/analytics/mle/json/knnrecommender_mle.json +0 -111
- teradataml/analytics/mle/json/knnrecommenderpredict_mle.json +0 -75
- teradataml/analytics/mle/json/lar_mle.json +0 -78
- teradataml/analytics/mle/json/larpredict_mle.json +0 -69
- teradataml/analytics/mle/json/lda_mle.json +0 -130
- teradataml/analytics/mle/json/ldainference_mle.json +0 -78
- teradataml/analytics/mle/json/ldatopicsummary_mle.json +0 -64
- teradataml/analytics/mle/json/levenshteindistance_mle.json +0 -92
- teradataml/analytics/mle/json/linreg_mle.json +0 -42
- teradataml/analytics/mle/json/linregpredict_mle.json +0 -56
- teradataml/analytics/mle/json/minhash_mle.json +0 -113
- teradataml/analytics/mle/json/modularity_mle.json +0 -91
- teradataml/analytics/mle/json/naivebayespredict_mle_mle.json +0 -85
- teradataml/analytics/mle/json/naivebayesreduce_mle.json +0 -52
- teradataml/analytics/mle/json/naivebayestextclassifierpredict_mle_mle.json +0 -147
- teradataml/analytics/mle/json/naivebayestextclassifiertrainer2_mle.json +0 -108
- teradataml/analytics/mle/json/naivebayestextclassifiertrainer_mle.json +0 -102
- teradataml/analytics/mle/json/namedentityfinder_mle.json +0 -84
- teradataml/analytics/mle/json/namedentityfinderevaluatorreduce_mle.json +0 -43
- teradataml/analytics/mle/json/namedentityfindertrainer_mle.json +0 -64
- teradataml/analytics/mle/json/nerevaluator_mle.json +0 -54
- teradataml/analytics/mle/json/nerextractor_mle.json +0 -87
- teradataml/analytics/mle/json/nertrainer_mle.json +0 -89
- teradataml/analytics/mle/json/ngrams_mle.json +0 -137
- teradataml/analytics/mle/json/ngramsplitter_mle_mle.json +0 -137
- teradataml/analytics/mle/json/npath@coprocessor_mle.json +0 -73
- teradataml/analytics/mle/json/ntree@coprocessor_mle.json +0 -123
- teradataml/analytics/mle/json/pack_mle.json +0 -58
- teradataml/analytics/mle/json/pack_mle_mle.json +0 -58
- teradataml/analytics/mle/json/pagerank_mle.json +0 -81
- teradataml/analytics/mle/json/pathanalyzer_mle.json +0 -63
- teradataml/analytics/mle/json/pathgenerator_mle.json +0 -40
- teradataml/analytics/mle/json/pathstart_mle.json +0 -62
- teradataml/analytics/mle/json/pathsummarizer_mle.json +0 -72
- teradataml/analytics/mle/json/pivoting_mle.json +0 -71
- teradataml/analytics/mle/json/postagger_mle.json +0 -51
- teradataml/analytics/mle/json/randomsample_mle.json +0 -131
- teradataml/analytics/mle/json/randomwalksample_mle.json +0 -85
- teradataml/analytics/mle/json/roc_mle.json +0 -73
- teradataml/analytics/mle/json/sampling_mle.json +0 -75
- teradataml/analytics/mle/json/sax_mle.json +0 -154
- teradataml/analytics/mle/json/scale_mle.json +0 -93
- teradataml/analytics/mle/json/scalebypartition_mle.json +0 -89
- teradataml/analytics/mle/json/scalemap_mle.json +0 -44
- teradataml/analytics/mle/json/scalesummary_mle.json +0 -14
- teradataml/analytics/mle/json/sentenceextractor_mle.json +0 -41
- teradataml/analytics/mle/json/sentimentevaluator_mle.json +0 -43
- teradataml/analytics/mle/json/sentimentextractor_mle.json +0 -100
- teradataml/analytics/mle/json/sentimenttrainer_mle.json +0 -68
- teradataml/analytics/mle/json/seriessplitter_mle.json +0 -133
- teradataml/analytics/mle/json/sessionize_mle_mle.json +0 -62
- teradataml/analytics/mle/json/simplemovavg_mle.json +0 -48
- teradataml/analytics/mle/json/stringsimilarity_mle.json +0 -50
- teradataml/analytics/mle/json/stringsimilarity_mle_mle.json +0 -50
- teradataml/analytics/mle/json/svmdense_mle.json +0 -165
- teradataml/analytics/mle/json/svmdensepredict_mle.json +0 -95
- teradataml/analytics/mle/json/svmdensesummary_mle.json +0 -58
- teradataml/analytics/mle/json/svmsparse_mle.json +0 -148
- teradataml/analytics/mle/json/svmsparsepredict_mle_mle.json +0 -103
- teradataml/analytics/mle/json/svmsparsesummary_mle.json +0 -57
- teradataml/analytics/mle/json/textchunker_mle.json +0 -40
- teradataml/analytics/mle/json/textclassifier_mle.json +0 -51
- teradataml/analytics/mle/json/textclassifierevaluator_mle.json +0 -43
- teradataml/analytics/mle/json/textclassifiertrainer_mle.json +0 -103
- teradataml/analytics/mle/json/textmorph_mle.json +0 -63
- teradataml/analytics/mle/json/textparser_mle.json +0 -166
- teradataml/analytics/mle/json/texttagger_mle.json +0 -81
- teradataml/analytics/mle/json/texttokenizer_mle.json +0 -91
- teradataml/analytics/mle/json/tf_mle.json +0 -33
- teradataml/analytics/mle/json/tfidf_mle.json +0 -34
- teradataml/analytics/mle/json/univariatestatistics_mle.json +0 -81
- teradataml/analytics/mle/json/unpack_mle.json +0 -91
- teradataml/analytics/mle/json/unpack_mle_mle.json +0 -91
- teradataml/analytics/mle/json/unpivoting_mle.json +0 -63
- teradataml/analytics/mle/json/varmax_mle.json +0 -176
- teradataml/analytics/mle/json/vectordistance_mle.json +0 -179
- teradataml/analytics/mle/json/weightedmovavg_mle.json +0 -48
- teradataml/analytics/mle/json/xgboost_mle.json +0 -178
- teradataml/analytics/mle/json/xgboostpredict_mle.json +0 -104
- teradataml/analytics/sqle/Antiselect.py +0 -321
- teradataml/analytics/sqle/Attribution.py +0 -603
- teradataml/analytics/sqle/DecisionForestPredict.py +0 -408
- teradataml/analytics/sqle/GLMPredict.py +0 -430
- teradataml/analytics/sqle/MovingAverage.py +0 -543
- teradataml/analytics/sqle/NGramSplitter.py +0 -548
- teradataml/analytics/sqle/NPath.py +0 -632
- teradataml/analytics/sqle/NaiveBayesTextClassifierPredict.py +0 -515
- teradataml/analytics/sqle/Pack.py +0 -388
- teradataml/analytics/sqle/SVMSparsePredict.py +0 -464
- teradataml/analytics/sqle/Sessionize.py +0 -390
- teradataml/analytics/sqle/StringSimilarity.py +0 -400
- teradataml/analytics/sqle/Unpack.py +0 -503
- teradataml/analytics/sqle/json/antiselect_sqle.json +0 -21
- teradataml/analytics/sqle/json/attribution_sqle.json +0 -92
- teradataml/analytics/sqle/json/decisionforestpredict_sqle.json +0 -48
- teradataml/analytics/sqle/json/glmpredict_sqle.json +0 -48
- teradataml/analytics/sqle/json/h2opredict_sqle.json +0 -63
- teradataml/analytics/sqle/json/movingaverage_sqle.json +0 -58
- teradataml/analytics/sqle/json/naivebayestextclassifierpredict_sqle.json +0 -76
- teradataml/analytics/sqle/json/ngramsplitter_sqle.json +0 -126
- teradataml/analytics/sqle/json/npath_sqle.json +0 -67
- teradataml/analytics/sqle/json/pack_sqle.json +0 -47
- teradataml/analytics/sqle/json/pmmlpredict_sqle.json +0 -55
- teradataml/analytics/sqle/json/sessionize_sqle.json +0 -43
- teradataml/analytics/sqle/json/stringsimilarity_sqle.json +0 -39
- teradataml/analytics/sqle/json/svmsparsepredict_sqle.json +0 -74
- teradataml/analytics/sqle/json/unpack_sqle.json +0 -80
- teradataml/catalog/model_cataloging.py +0 -980
- teradataml/config/mlengine_alias_definitions_v1.0 +0 -118
- teradataml/config/mlengine_alias_definitions_v1.1 +0 -127
- teradataml/config/mlengine_alias_definitions_v1.3 +0 -129
- teradataml/table_operators/sandbox_container_util.py +0 -643
- {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/WHEEL +0 -0
- {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/top_level.txt +0 -0
- {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# ##################################################################
|
|
2
|
+
#
|
|
3
|
+
# Copyright 2023 Teradata. All rights reserved.
|
|
4
|
+
# TERADATA CONFIDENTIAL AND TRADE SECRET
|
|
5
|
+
#
|
|
6
|
+
# Primary Owner: Adithya Avvaru (adithya.avvaru@teradata.com)
|
|
7
|
+
# Secondary Owner: Pankaj Purandare (pankajvinod.purandare@teradata.com)
|
|
8
|
+
#
|
|
9
|
+
# Version: 1.0
|
|
10
|
+
# Function Version: 1.0
|
|
11
|
+
#
|
|
12
|
+
# This file contains helper functions for opensource wrapper and sklearn wrapper class.
|
|
13
|
+
#
|
|
14
|
+
# ##################################################################
|
|
15
|
+
|
|
16
|
+
import time
|
|
17
|
+
import functools
|
|
18
|
+
import uuid
|
|
19
|
+
|
|
20
|
+
from math import floor
|
|
21
|
+
from teradataml import TeradataMlException
|
|
22
|
+
from teradataml.common.messagecodes import MessageCodes
|
|
23
|
+
from teradataml.common.messages import Messages
|
|
24
|
+
from teradataml.common.aed_utils import AedUtils
|
|
25
|
+
from teradataml.dataframe.dataframe_utils import DataFrameUtils
|
|
26
|
+
from teradataml.dataframe.dataframe import DataFrame, in_schema
|
|
27
|
+
from teradataml.common.utils import UtilFuncs
|
|
28
|
+
from teradataml.utils.validators import _Validators
|
|
29
|
+
from teradataml.dataframe.sql_interfaces import ColumnExpression
|
|
30
|
+
|
|
31
|
+
aed_utils = AedUtils()
|
|
32
|
+
df_utils = DataFrameUtils()
|
|
33
|
+
|
|
34
|
+
def _validate_fit_run(func):
|
|
35
|
+
"""
|
|
36
|
+
Internal function to validate if the model is fitted before calling function specified
|
|
37
|
+
by "func" parameter.
|
|
38
|
+
|
|
39
|
+
PARAMETERS:
|
|
40
|
+
func - Specifies the function to be called if the model is fitted.
|
|
41
|
+
|
|
42
|
+
RETURNS:
|
|
43
|
+
function call
|
|
44
|
+
|
|
45
|
+
RAISES:
|
|
46
|
+
TeradataMlException if model is not fitted and function is called.
|
|
47
|
+
"""
|
|
48
|
+
@functools.wraps(func)
|
|
49
|
+
def wrapper(self, *args, **kwargs):
|
|
50
|
+
func_name = kwargs["name"]
|
|
51
|
+
if not self._is_model_installed:
|
|
52
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.MODEL_NOT_FITTED,
|
|
53
|
+
func_name),
|
|
54
|
+
MessageCodes.MODEL_NOT_FITTED)
|
|
55
|
+
return func(self, *args, **kwargs)
|
|
56
|
+
|
|
57
|
+
return wrapper
|
|
58
|
+
|
|
59
|
+
def _generate_new_name(type=None, extension=None):
|
|
60
|
+
"""
|
|
61
|
+
Internal function to generate new column name or file name.
|
|
62
|
+
|
|
63
|
+
PARAMETERS:
|
|
64
|
+
type - Specifies the type of the name to be generated.
|
|
65
|
+
Permitted Values: 'column', 'file'
|
|
66
|
+
extension - Specifies the extension to be added to the random file name.
|
|
67
|
+
Applicable only when type is file'
|
|
68
|
+
|
|
69
|
+
RETURNS:
|
|
70
|
+
New name as string
|
|
71
|
+
|
|
72
|
+
RAISES:
|
|
73
|
+
None
|
|
74
|
+
"""
|
|
75
|
+
timestamp = time.time()
|
|
76
|
+
tmp = "{}{}".format(floor(timestamp / 1000000),
|
|
77
|
+
floor(timestamp % 1000000 * 1000000 +
|
|
78
|
+
int(str(uuid.uuid4().fields[-1])[:10])))
|
|
79
|
+
if type:
|
|
80
|
+
tmp = f"{type}_{tmp}_"
|
|
81
|
+
if extension:
|
|
82
|
+
tmp = f"{tmp}.{extension}"
|
|
83
|
+
return tmp
|
|
84
|
+
|
|
85
|
+
def _derive_df_and_required_columns(X=None, y=None, groups=None, kwargs={},
|
|
86
|
+
fit_partition_cols=None):
|
|
87
|
+
"""
|
|
88
|
+
Internal function to get parent teradataml DataFrame from X, y and groups and corresponding
|
|
89
|
+
feature columns, label columns and group columns along with partition_columns passed
|
|
90
|
+
in kwargs.
|
|
91
|
+
|
|
92
|
+
PARAMETERS:
|
|
93
|
+
X - Specifies the teradataml DataFrame containing data related to feature columns.
|
|
94
|
+
y - Specifies the teradataml DataFrame containing data related to label columns.
|
|
95
|
+
groups - Specifies the teradataml DataFrame containing data related to group columns.
|
|
96
|
+
kwargs - Specifies the dictionary of arguments with keys:
|
|
97
|
+
- data
|
|
98
|
+
- feature_columns
|
|
99
|
+
- label_columns
|
|
100
|
+
- group_columns
|
|
101
|
+
- partition_columns
|
|
102
|
+
fit_partition_cols - Specifies the partition columns fitted to the model.
|
|
103
|
+
|
|
104
|
+
RETURNS:
|
|
105
|
+
parent DataFrame, feature columns, label columns, group columns, data partition columns
|
|
106
|
+
|
|
107
|
+
RAISES:
|
|
108
|
+
TeradataMlException if columns are not from the given DataFrame "data".
|
|
109
|
+
"""
|
|
110
|
+
data = kwargs.get("data", None)
|
|
111
|
+
feature_columns = kwargs.get("feature_columns", None)
|
|
112
|
+
feature_columns = UtilFuncs._as_list(feature_columns) if feature_columns else []
|
|
113
|
+
label_columns = kwargs.get("label_columns", None)
|
|
114
|
+
label_columns = UtilFuncs._as_list(label_columns) if label_columns else []
|
|
115
|
+
group_columns = kwargs.get("group_columns", None)
|
|
116
|
+
group_columns = UtilFuncs._as_list(group_columns) if group_columns else []
|
|
117
|
+
partition_columns = kwargs.get("partition_columns", None)
|
|
118
|
+
if partition_columns:
|
|
119
|
+
partition_columns = UtilFuncs._as_list(partition_columns)
|
|
120
|
+
elif fit_partition_cols:
|
|
121
|
+
partition_columns = fit_partition_cols
|
|
122
|
+
else:
|
|
123
|
+
partition_columns = []
|
|
124
|
+
|
|
125
|
+
if X:
|
|
126
|
+
# If X is passed, then data, feature_columns, label_columns, group_columns are
|
|
127
|
+
# ignored and derived from X, y, groups arguments.
|
|
128
|
+
feature_columns = [col for col in X.columns if col not in partition_columns]
|
|
129
|
+
all_dfs = [X]
|
|
130
|
+
label_columns = []
|
|
131
|
+
group_columns = []
|
|
132
|
+
if y:
|
|
133
|
+
all_dfs.append(y)
|
|
134
|
+
label_columns = y.columns
|
|
135
|
+
if groups:
|
|
136
|
+
all_dfs.append(groups)
|
|
137
|
+
group_columns = groups.columns
|
|
138
|
+
|
|
139
|
+
data = df_utils._get_common_parent_df_from_dataframes(all_dfs)
|
|
140
|
+
|
|
141
|
+
if data:
|
|
142
|
+
# Execute node, if not executed already to get table name.
|
|
143
|
+
if aed_utils._aed_is_node_executed(data._nodeid):
|
|
144
|
+
_ = df_utils._execute_node_return_db_object_name(data._nodeid)
|
|
145
|
+
|
|
146
|
+
# Validate if columns in "feature_columns", "label_columns" are different or not.
|
|
147
|
+
if set(feature_columns).intersection(set(label_columns)):
|
|
148
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.ARGS_WITH_SAME_COLUMNS,
|
|
149
|
+
"feature_columns/X DataFrame",
|
|
150
|
+
"label_columns/y DataFrame",
|
|
151
|
+
" not"),
|
|
152
|
+
MessageCodes.ARGS_WITH_SAME_COLUMNS)
|
|
153
|
+
|
|
154
|
+
return data, feature_columns, label_columns, group_columns, partition_columns
|
|
155
|
+
|
|
156
|
+
def _validate_df_query_type(df, node_query_type, arg_name):
|
|
157
|
+
"""
|
|
158
|
+
Internal function to validate if the DataFrame's node type is same as the type specified.
|
|
159
|
+
|
|
160
|
+
PARAMETERS:
|
|
161
|
+
df - Specifies the teradataml DataFrame to be validated for node type.
|
|
162
|
+
node_query_type - Specifies the type of the node to be compared with.
|
|
163
|
+
arg_name - Specifies the name of the argument in which the node id is passed.
|
|
164
|
+
|
|
165
|
+
RETURNS:
|
|
166
|
+
None
|
|
167
|
+
|
|
168
|
+
RAISES:
|
|
169
|
+
TeradataMlException if node with given id is not same as the type specified.
|
|
170
|
+
"""
|
|
171
|
+
if df and aed_utils._aed_get_node_query_type(df._nodeid) != node_query_type:
|
|
172
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.NODE_NOT_GIVEN_TYPE,
|
|
173
|
+
arg_name, node_query_type),
|
|
174
|
+
MessageCodes.NODE_NOT_GIVEN_TYPE)
|
|
175
|
+
|
|
176
|
+
def _validate_opensource_func_args(X=None, y=None, groups=None, fit_partition_cols=None,
|
|
177
|
+
kwargs={}, skip_either_or_that=False):
|
|
178
|
+
"""
|
|
179
|
+
Internal function to validate arguments passed to exposed opensource APIs.
|
|
180
|
+
|
|
181
|
+
PARAMETERS:
|
|
182
|
+
X - Specifies the teradataml DataFrame containing data related to feature columns.
|
|
183
|
+
y - Specifies the teradataml DataFrame containing data related to label columns.
|
|
184
|
+
groups - Specifies the teradataml DataFrame containing data related to group columns.
|
|
185
|
+
fit_partition_cols - Specifies the partition columns fitted to the model.
|
|
186
|
+
kwargs - Specifies the dictionary of arguments with keys:
|
|
187
|
+
- data
|
|
188
|
+
- feature_columns
|
|
189
|
+
- label_columns
|
|
190
|
+
- group_columns
|
|
191
|
+
- partition_columns
|
|
192
|
+
skip_either_or_that - Specifies whether to skip validation of either or that arguments.
|
|
193
|
+
RETURNS:
|
|
194
|
+
None
|
|
195
|
+
|
|
196
|
+
RAISES:
|
|
197
|
+
TeradataMlException if arguments' validations fail.
|
|
198
|
+
"""
|
|
199
|
+
data = kwargs.get("data", None)
|
|
200
|
+
feature_columns = kwargs.get("feature_columns", None)
|
|
201
|
+
label_columns = kwargs.get("label_columns", None)
|
|
202
|
+
group_columns = kwargs.get("group_columns", None)
|
|
203
|
+
partition_columns = kwargs.get("partition_columns", None)
|
|
204
|
+
|
|
205
|
+
# Argument validations
|
|
206
|
+
arg_info_matrix = []
|
|
207
|
+
arg_info_matrix.append(["X", X, True, (DataFrame)])
|
|
208
|
+
arg_info_matrix.append(["y", y, True, (DataFrame)])
|
|
209
|
+
arg_info_matrix.append(["groups", groups, True, (DataFrame)])
|
|
210
|
+
arg_info_matrix.append(["partition_columns", partition_columns, True, (str, list)])
|
|
211
|
+
arg_info_matrix.append(["data", data, True, (DataFrame)])
|
|
212
|
+
arg_info_matrix.append(["feature_columns", feature_columns, True, (str, list)])
|
|
213
|
+
arg_info_matrix.append(["label_columns", label_columns, True, (str, list)])
|
|
214
|
+
arg_info_matrix.append(["group_columns", group_columns, True, (str, list)])
|
|
215
|
+
|
|
216
|
+
# Validate argument types
|
|
217
|
+
_Validators._validate_function_arguments(arg_info_matrix)
|
|
218
|
+
|
|
219
|
+
if not skip_either_or_that and not X and not data and not feature_columns:
|
|
220
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.EITHER_THIS_OR_THAT_ARGUMENT,
|
|
221
|
+
"X", "data and feature_columns"),
|
|
222
|
+
MessageCodes.EITHER_THIS_OR_THAT_ARGUMENT)
|
|
223
|
+
|
|
224
|
+
if X:
|
|
225
|
+
# Validate if "X", "y" and "groups" are from select() call.
|
|
226
|
+
# Whether they are from same parent or not, will be validated while parent is being
|
|
227
|
+
# extracted.
|
|
228
|
+
if y or groups:
|
|
229
|
+
# If any one of "y" or "groups" exists, then "X" must be from select() call.
|
|
230
|
+
# Otherwise, it can be from any parent or direct DataFrame.
|
|
231
|
+
_validate_df_query_type(X, "select", "X")
|
|
232
|
+
|
|
233
|
+
_validate_df_query_type(y, "select", "y")
|
|
234
|
+
_validate_df_query_type(groups, "select", "groups")
|
|
235
|
+
|
|
236
|
+
# Validate if columns in "partition_columns" argument are present in "X".
|
|
237
|
+
_Validators._validate_column_exists_in_dataframe(columns=partition_columns,
|
|
238
|
+
metaexpr=X._metaexpr,
|
|
239
|
+
column_arg="partition_columns",
|
|
240
|
+
data_arg="X")
|
|
241
|
+
|
|
242
|
+
if fit_partition_cols and not partition_columns and \
|
|
243
|
+
not all([col in X.columns for col in fit_partition_cols]):
|
|
244
|
+
# Check if fitted partition columns are present in "X" if "partition_columns" is not
|
|
245
|
+
# not passed.
|
|
246
|
+
msg = Messages.get_message(MessageCodes.PARTITIONING_COLS_DIFFERENT, "X")
|
|
247
|
+
raise TeradataMlException(msg, MessageCodes.PARTITIONING_COLS_DIFFERENT)
|
|
248
|
+
|
|
249
|
+
if data and not X:
|
|
250
|
+
# Thse validations are required only when "X" is not passed because "data" is ignored when
|
|
251
|
+
# "X" is passed.
|
|
252
|
+
|
|
253
|
+
all_cols_list = [feature_columns, label_columns, group_columns, partition_columns]
|
|
254
|
+
arg_name_list = ["feature_columns", "label_columns", "group_columns", "partition_columns"]
|
|
255
|
+
|
|
256
|
+
for cols, arg_name in zip(all_cols_list, arg_name_list):
|
|
257
|
+
# Validate if columns in these arguments are present in "data".
|
|
258
|
+
_Validators._validate_column_exists_in_dataframe(columns=cols,
|
|
259
|
+
metaexpr=data._metaexpr,
|
|
260
|
+
column_arg=arg_name,
|
|
261
|
+
data_arg="data")
|
|
262
|
+
|
|
263
|
+
if fit_partition_cols and not partition_columns and \
|
|
264
|
+
not all([col in data.columns for col in fit_partition_cols]):
|
|
265
|
+
# Check if fitted partition columns are present in "data" if "partition_columns" is not
|
|
266
|
+
# not passed.
|
|
267
|
+
msg = Messages.get_message(MessageCodes.PARTITIONING_COLS_DIFFERENT, "data")
|
|
268
|
+
raise TeradataMlException(msg, MessageCodes.PARTITIONING_COLS_DIFFERENT)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# ##################################################################
|
|
2
|
+
#
|
|
3
|
+
# Copyright 2023 Teradata. All rights reserved.
|
|
4
|
+
# TERADATA CONFIDENTIAL AND TRADE SECRET
|
|
5
|
+
#
|
|
6
|
+
# Primary Owner: Adithya Avvaru (adithya.avvaru@teradata.com)
|
|
7
|
+
# Secondary Owner: Pankaj Purandare (pankajvinod.purandare@teradata.com)
|
|
8
|
+
#
|
|
9
|
+
# Version: 1.0
|
|
10
|
+
# Function Version: 1.0
|
|
11
|
+
#
|
|
12
|
+
# This file contains constants needed for the opensource packages.
|
|
13
|
+
#
|
|
14
|
+
# ##################################################################
|
|
15
|
+
|
|
16
|
+
from enum import Enum
|
|
17
|
+
from teradataml import VARCHAR, BLOB
|
|
18
|
+
from dataclasses import dataclass, field
|
|
19
|
+
from typing import Any, Dict, Tuple, Optional, List
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
_MODULES = ["sklearn.calibration", "sklearn.cluster", "sklearn.compose", "sklearn.covariance",
|
|
23
|
+
"sklearn.decomposition", "sklearn.discriminant_analysis",
|
|
24
|
+
"sklearn.dummy", "sklearn.ensemble", "sklearn.feature_extraction", "sklearn.feature_selection",
|
|
25
|
+
"sklearn.gaussian_process", "sklearn.impute", "sklearn.isotonic", "sklearn.kernel_approximation",
|
|
26
|
+
"sklearn.kernel_ridge", "sklearn.linear_model", "sklearn.manifold", "sklearn.mixture",
|
|
27
|
+
"sklearn.model_selection", "sklearn.multiclass", "sklearn.multioutput", "sklearn.naive_bayes",
|
|
28
|
+
"sklearn.neighbors", "sklearn.neural_network", "sklearn.preprocessing", "sklearn.random_projection",
|
|
29
|
+
"sklearn.semi_supervised", "sklearn.svm", "sklearn.tree", "sklearn.pipeline", "sklearn.cross_decomposition",
|
|
30
|
+
"sklearn.gaussian_process.kernels", "sklearn.metrics"]
|
|
31
|
+
|
|
32
|
+
class OpenSourcePackage(Enum):
|
|
33
|
+
SKLEARN = "sklearn"
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def values(cls):
|
|
37
|
+
return [item.value for item in cls]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass
|
|
41
|
+
class OpensourceModels:
|
|
42
|
+
"""Dataclass for Opensource Models details."""
|
|
43
|
+
is_default_partition_value: bool # Whether partition value is default or not.
|
|
44
|
+
partition_file_prefix: str
|
|
45
|
+
model: Any # Either individual model or pandas dataframe of models with partition columns.
|
|
46
|
+
pos_args: Tuple[Any] = tuple() # Positional arguments used for model creation.
|
|
47
|
+
key_args: Dict[str, Any] = field(default_factory=dict) # Keyword arguments used for model creation.
|
|
48
|
+
fit_partition_columns_non_default: Optional[str] = None # Columns used for partitioning.
|
|
49
|
+
|
|
50
|
+
# Model table details used by opensource BYOM.
|
|
51
|
+
_OSML_MODELS_TABLE_NAME = "opensourceml_models"
|
|
52
|
+
_OSML_MODELS_PRIMARY_INDEX = "model_id"
|
|
53
|
+
_OSML_ADDITIONAL_COLUMN_TYPES = {"package": VARCHAR(128)} # sklearn or keras etc
|
|
54
|
+
_OSML_MODELS_TABLE_COLUMNS_TYPE_DICT = {"model_id": VARCHAR(128), "model": BLOB()}
|
teradataml/options/__init__.py
CHANGED
|
@@ -3,7 +3,10 @@ from teradataml.common.messagecodes import MessageCodes
|
|
|
3
3
|
from teradataml.common.messages import Messages
|
|
4
4
|
from teradataml.options.configure import configure
|
|
5
5
|
from teradataml.utils.internal_buffer import _InternalBuffer
|
|
6
|
+
from teradatasqlalchemy.telemetry.queryband import collect_queryband
|
|
6
7
|
|
|
8
|
+
|
|
9
|
+
@collect_queryband(queryband="StCnfgPrms")
|
|
7
10
|
def set_config_params(**kwargs):
|
|
8
11
|
"""
|
|
9
12
|
DESCRIPTION:
|
|
@@ -54,10 +57,6 @@ def set_config_params(**kwargs):
|
|
|
54
57
|
are installed.
|
|
55
58
|
Types: str
|
|
56
59
|
|
|
57
|
-
sandbox_container_id:
|
|
58
|
-
Specifies the id of sandbox container that will be used by Script.test_script() method.
|
|
59
|
-
Types: string
|
|
60
|
-
|
|
61
60
|
database_version:
|
|
62
61
|
Specifies the database version of the system teradataml is connected to.
|
|
63
62
|
Types: str
|
|
@@ -92,7 +91,6 @@ def set_config_params(**kwargs):
|
|
|
92
91
|
... certificate_file="cert.crt",
|
|
93
92
|
... default_varchar_size=512,
|
|
94
93
|
... val_install_location="VAL_USER",
|
|
95
|
-
... sandbox_container_id="bgf1233csdh123",
|
|
96
94
|
... read_nos_function_mapping="read_nos_fm",
|
|
97
95
|
... write_nos_function_mapping="write_nos_fm",
|
|
98
96
|
... indb_install_location="/opt/teradata/languages/Python")
|
|
@@ -105,7 +103,6 @@ def set_config_params(**kwargs):
|
|
|
105
103
|
>>> configure.certificate_file="cert.crt"
|
|
106
104
|
>>> configure.default_varchar_size=512
|
|
107
105
|
>>> configure.val_install_location="VAL_USER"
|
|
108
|
-
>>> configure.sandbox_container_id="bgf1233csdh123"
|
|
109
106
|
>>> configure.read_nos_function_mapping="read_nos_fm"
|
|
110
107
|
>>> configure.write_nos_function_mapping="write_nos_fm"
|
|
111
108
|
>>> configure.indb_install_location="/opt/teradata/languages/Python"
|
teradataml/options/configure.py
CHANGED
|
@@ -50,7 +50,6 @@ class _Configure(_ConfigureSuper):
|
|
|
50
50
|
vantage_version = _create_property('vantage_version')
|
|
51
51
|
val_install_location = _create_property('VAL_install_location')
|
|
52
52
|
byom_install_location = _create_property('BYOM_install_location')
|
|
53
|
-
sandbox_container_id = _create_property('sandbox_container_id')
|
|
54
53
|
temp_table_database = _create_property('temp_table_database')
|
|
55
54
|
temp_view_database = _create_property('temp_view_database')
|
|
56
55
|
read_nos_function_mapping = _create_property('read_nos_function_mapping')
|
|
@@ -58,14 +57,16 @@ class _Configure(_ConfigureSuper):
|
|
|
58
57
|
cran_repositories = _create_property('cran_repositories')
|
|
59
58
|
inline_plot = _create_property('inline_plot')
|
|
60
59
|
indb_install_location = _create_property('indb_install_location')
|
|
60
|
+
openml_user_env = _create_property('openml_user_env')
|
|
61
61
|
|
|
62
62
|
def __init__(self, default_varchar_size=1024, column_casesensitive_handler = False,
|
|
63
63
|
vantage_version="vantage1.1", val_install_location=None,
|
|
64
|
-
byom_install_location=None,
|
|
65
|
-
|
|
64
|
+
byom_install_location=None, temp_table_database=None,
|
|
65
|
+
temp_view_database=None, database_version=None,
|
|
66
66
|
read_nos_function_mapping="read_nos", write_nos_function_mapping="write_nos",
|
|
67
67
|
cran_repositories=None, inline_plot=True,
|
|
68
|
-
indb_install_location="/var/opt/teradata/languages/sles12sp3/Python/"
|
|
68
|
+
indb_install_location="/var/opt/teradata/languages/sles12sp3/Python/",
|
|
69
|
+
openml_user_env=None):
|
|
69
70
|
|
|
70
71
|
"""
|
|
71
72
|
PARAMETERS:
|
|
@@ -113,13 +114,6 @@ class _Configure(_ConfigureSuper):
|
|
|
113
114
|
# when BYOM functions are installed in 'SYSLIB'.
|
|
114
115
|
teradataml.options.configure.byom_install_location = "SYSLIB"
|
|
115
116
|
|
|
116
|
-
sandbox_container_id:
|
|
117
|
-
Specifies the id of sandbox container that will be used by test_script method.
|
|
118
|
-
Types: string
|
|
119
|
-
Example:
|
|
120
|
-
# Set the sandbox_container_id.
|
|
121
|
-
teradataml.options.configure.sandbox_container_id = '734rfjsls3'
|
|
122
|
-
|
|
123
117
|
database_version:
|
|
124
118
|
Specifies the actual database version of the system teradataml is connected to.
|
|
125
119
|
Types: string
|
|
@@ -161,6 +155,14 @@ class _Configure(_ConfigureSuper):
|
|
|
161
155
|
Example:
|
|
162
156
|
# Set the installation location for older versions.
|
|
163
157
|
teradataml.options.configure.indb_install_location = "/opt/teradata/languages/Python/"
|
|
158
|
+
|
|
159
|
+
openml_user_env:
|
|
160
|
+
Specifies the user environment to be used for OpenML.
|
|
161
|
+
Types: UserEnv
|
|
162
|
+
Example:
|
|
163
|
+
# Set the environment to be used for OpenML.
|
|
164
|
+
_env_name = "OpenAF" # Name of the user defined environment.
|
|
165
|
+
teradataml.options.configure.openml_user_env = get_env(_env_name)
|
|
164
166
|
"""
|
|
165
167
|
super().__init__()
|
|
166
168
|
super().__setattr__('default_varchar_size', default_varchar_size)
|
|
@@ -168,7 +170,6 @@ class _Configure(_ConfigureSuper):
|
|
|
168
170
|
super().__setattr__('vantage_version', vantage_version)
|
|
169
171
|
super().__setattr__('val_install_location', val_install_location)
|
|
170
172
|
super().__setattr__('byom_install_location', byom_install_location)
|
|
171
|
-
super().__setattr__('sandbox_container_id', sandbox_container_id)
|
|
172
173
|
super().__setattr__('temp_table_database', temp_table_database)
|
|
173
174
|
super().__setattr__('temp_view_database', temp_view_database)
|
|
174
175
|
super().__setattr__('database_version', database_version)
|
|
@@ -177,6 +178,7 @@ class _Configure(_ConfigureSuper):
|
|
|
177
178
|
super().__setattr__('cran_repositories', cran_repositories)
|
|
178
179
|
super().__setattr__('inline_plot', True)
|
|
179
180
|
super().__setattr__('indb_install_location', indb_install_location)
|
|
181
|
+
super().__setattr__('openml_user_env', openml_user_env)
|
|
180
182
|
|
|
181
183
|
# internal configurations
|
|
182
184
|
# These configurations are internal and should not be
|
|
@@ -185,11 +187,6 @@ class _Configure(_ConfigureSuper):
|
|
|
185
187
|
# Internal parameter, that should be used while testing to validate whether
|
|
186
188
|
# Garbage collection is being done or not.
|
|
187
189
|
super().__setattr__('_validate_gc', False)
|
|
188
|
-
# Internal parameter, that is used for checking if sto sandbox image exists on user's system
|
|
189
|
-
super().__setattr__('_latest_sandbox_exists', False)
|
|
190
|
-
# Internal parameter, that is used for checking whether a container was started by
|
|
191
|
-
# teradataml.
|
|
192
|
-
super().__setattr__('_container_started_by_teradataml', None)
|
|
193
190
|
# Internal parameter, that is used for specifying the global model cataloging schema name which
|
|
194
191
|
# will be used by the byom APIs.
|
|
195
192
|
super().__setattr__('_byom_model_catalog_database', None)
|
|
@@ -246,7 +243,7 @@ class _Configure(_ConfigureSuper):
|
|
|
246
243
|
"greater than or equal to"),
|
|
247
244
|
MessageCodes.TDMLDF_POSITIVE_INT)
|
|
248
245
|
elif name in ['column_casesensitive_handler', '_validate_metaexpression',
|
|
249
|
-
'_validate_gc', '
|
|
246
|
+
'_validate_gc', 'inline_plot']:
|
|
250
247
|
|
|
251
248
|
if not isinstance(value, bool):
|
|
252
249
|
raise TeradataMlException(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name,
|
|
@@ -307,8 +304,7 @@ class _Configure(_ConfigureSuper):
|
|
|
307
304
|
if name == 'ues_url':
|
|
308
305
|
value = value[: -1] if value.endswith("/") else value
|
|
309
306
|
|
|
310
|
-
elif name in ['
|
|
311
|
-
'temp_table_database', 'temp_view_database',
|
|
307
|
+
elif name in ['temp_table_database', 'temp_view_database',
|
|
312
308
|
"_byom_model_catalog_license_table", "_byom_model_catalog_license_database"]:
|
|
313
309
|
if not isinstance(value, str) and not isinstance(value, type(None)):
|
|
314
310
|
raise TeradataMlException(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name,
|
|
@@ -328,6 +324,11 @@ class _Configure(_ConfigureSuper):
|
|
|
328
324
|
raise TypeError(
|
|
329
325
|
Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name, 'str, list of str or None'))
|
|
330
326
|
|
|
327
|
+
elif name == 'openml_user_env':
|
|
328
|
+
from teradataml.scriptmgmt.UserEnv import UserEnv
|
|
329
|
+
if not isinstance(value, UserEnv) and not isinstance(value, type(None)):
|
|
330
|
+
raise TypeError(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name, 'UserEnv or None'))
|
|
331
|
+
|
|
331
332
|
super().__setattr__(name, value)
|
|
332
333
|
else:
|
|
333
334
|
raise AttributeError("'{}' object has no attribute '{}'".format(self.__class__.__name__, name))
|