teradataml 20.0.0.3__py3-none-any.whl → 20.0.0.5__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/README.md +193 -1
- teradataml/__init__.py +2 -1
- teradataml/_version.py +2 -2
- teradataml/analytics/analytic_function_executor.py +25 -18
- teradataml/analytics/byom/__init__.py +1 -1
- teradataml/analytics/json_parser/analytic_functions_argument.py +4 -0
- teradataml/analytics/sqle/__init__.py +20 -2
- teradataml/analytics/utils.py +15 -1
- teradataml/analytics/valib.py +18 -4
- teradataml/automl/__init__.py +341 -112
- teradataml/automl/autodataprep/__init__.py +471 -0
- teradataml/automl/data_preparation.py +84 -42
- teradataml/automl/data_transformation.py +69 -33
- teradataml/automl/feature_engineering.py +76 -9
- teradataml/automl/feature_exploration.py +639 -25
- teradataml/automl/model_training.py +35 -14
- teradataml/clients/auth_client.py +2 -2
- teradataml/common/__init__.py +1 -2
- teradataml/common/constants.py +122 -63
- teradataml/common/messagecodes.py +14 -3
- teradataml/common/messages.py +8 -4
- teradataml/common/sqlbundle.py +40 -10
- teradataml/common/utils.py +366 -74
- teradataml/common/warnings.py +11 -0
- teradataml/context/context.py +348 -86
- teradataml/data/amazon_reviews_25.csv +26 -0
- teradataml/data/apriori_example.json +22 -0
- teradataml/data/byom_example.json +11 -0
- teradataml/data/docs/byom/docs/DataRobotPredict.py +2 -2
- teradataml/data/docs/byom/docs/DataikuPredict.py +40 -1
- teradataml/data/docs/byom/docs/H2OPredict.py +2 -2
- teradataml/data/docs/byom/docs/ONNXEmbeddings.py +242 -0
- teradataml/data/docs/byom/docs/ONNXPredict.py +2 -2
- teradataml/data/docs/byom/docs/PMMLPredict.py +2 -2
- teradataml/data/docs/sqle/docs_17_20/Apriori.py +138 -0
- teradataml/data/docs/sqle/docs_17_20/NERExtractor.py +121 -0
- teradataml/data/docs/sqle/docs_17_20/NGramSplitter.py +3 -3
- teradataml/data/docs/sqle/docs_17_20/SMOTE.py +212 -0
- teradataml/data/docs/sqle/docs_17_20/Shap.py +28 -6
- teradataml/data/docs/sqle/docs_17_20/TextMorph.py +119 -0
- teradataml/data/docs/sqle/docs_17_20/TextParser.py +54 -3
- teradataml/data/docs/uaf/docs_17_20/ACF.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/DFFT.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/DFFT2.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/DFFTConv.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/DWT2D.py +4 -1
- teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +4 -4
- teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +6 -6
- teradataml/data/docs/uaf/docs_17_20/LineSpec.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +4 -4
- teradataml/data/docs/uaf/docs_17_20/MultivarRegr.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/PACF.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/PowerTransform.py +3 -3
- teradataml/data/docs/uaf/docs_17_20/Resample.py +5 -5
- teradataml/data/docs/uaf/docs_17_20/SAX.py +3 -3
- teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/SimpleExp.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/Smoothma.py +3 -3
- teradataml/data/docs/uaf/docs_17_20/UNDIFF.py +1 -1
- teradataml/data/hnsw_alter_data.csv +5 -0
- teradataml/data/hnsw_data.csv +10 -0
- teradataml/data/jsons/byom/h2opredict.json +1 -1
- teradataml/data/jsons/byom/onnxembeddings.json +266 -0
- teradataml/data/jsons/sqle/17.20/NGramSplitter.json +6 -6
- teradataml/data/jsons/sqle/17.20/TD_Apriori.json +181 -0
- teradataml/data/jsons/sqle/17.20/TD_NERExtractor.json +145 -0
- teradataml/data/jsons/sqle/17.20/TD_SMOTE.json +267 -0
- teradataml/data/jsons/sqle/17.20/TD_Shap.json +0 -1
- teradataml/data/jsons/sqle/17.20/TD_TextMorph.json +134 -0
- teradataml/data/jsons/sqle/17.20/TD_TextParser.json +114 -9
- teradataml/data/jsons/sqle/20.00/AI_AnalyzeSentiment.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_AskLLM.json +420 -0
- teradataml/data/jsons/sqle/20.00/AI_DetectLanguage.json +343 -0
- teradataml/data/jsons/sqle/20.00/AI_ExtractKeyPhrases.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_MaskPII.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_RecognizeEntities.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_RecognizePIIEntities.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_TextClassifier.json +359 -0
- teradataml/data/jsons/sqle/20.00/AI_TextEmbeddings.json +360 -0
- teradataml/data/jsons/sqle/20.00/AI_TextSummarize.json +343 -0
- teradataml/data/jsons/sqle/20.00/AI_TextTranslate.json +343 -0
- teradataml/data/jsons/sqle/20.00/TD_HNSW.json +296 -0
- teradataml/data/jsons/sqle/20.00/TD_HNSWPredict.json +206 -0
- teradataml/data/jsons/sqle/20.00/TD_HNSWSummary.json +32 -0
- teradataml/data/jsons/sqle/20.00/TD_KMeans.json +2 -2
- teradataml/data/jsons/sqle/20.00/TD_SMOTE.json +3 -3
- teradataml/data/jsons/sqle/20.00/TD_VectorDistance.json +6 -6
- teradataml/data/ner_dict.csv +8 -0
- teradataml/data/ner_input_eng.csv +7 -0
- teradataml/data/ner_rule.csv +5 -0
- teradataml/data/pos_input.csv +40 -0
- teradataml/data/tdnerextractor_example.json +14 -0
- teradataml/data/teradataml_example.json +21 -0
- teradataml/data/textmorph_example.json +5 -0
- teradataml/data/to_num_data.csv +4 -0
- teradataml/data/tochar_data.csv +5 -0
- teradataml/data/trans_dense.csv +16 -0
- teradataml/data/trans_sparse.csv +55 -0
- teradataml/data/vectordistance_example.json +1 -1
- teradataml/dataframe/copy_to.py +45 -29
- teradataml/dataframe/data_transfer.py +72 -46
- teradataml/dataframe/dataframe.py +642 -166
- teradataml/dataframe/dataframe_utils.py +167 -22
- teradataml/dataframe/functions.py +135 -20
- teradataml/dataframe/setop.py +11 -6
- teradataml/dataframe/sql.py +330 -78
- teradataml/dbutils/dbutils.py +556 -140
- teradataml/dbutils/filemgr.py +14 -10
- teradataml/hyperparameter_tuner/optimizer.py +12 -1
- teradataml/lib/aed_0_1.dll +0 -0
- teradataml/opensource/{sklearn/_sklearn_wrapper.py → _base.py} +168 -1013
- teradataml/opensource/_class.py +141 -17
- teradataml/opensource/{constants.py → _constants.py} +7 -3
- teradataml/opensource/_lightgbm.py +52 -53
- teradataml/opensource/_sklearn.py +1008 -0
- teradataml/opensource/_wrapper_utils.py +5 -5
- teradataml/options/__init__.py +47 -15
- teradataml/options/configure.py +103 -26
- teradataml/options/display.py +13 -2
- teradataml/plot/axis.py +47 -8
- teradataml/plot/figure.py +33 -0
- teradataml/plot/plot.py +63 -13
- teradataml/scriptmgmt/UserEnv.py +307 -40
- teradataml/scriptmgmt/lls_utils.py +428 -145
- teradataml/store/__init__.py +2 -3
- teradataml/store/feature_store/feature_store.py +102 -7
- teradataml/table_operators/Apply.py +48 -19
- teradataml/table_operators/Script.py +23 -2
- teradataml/table_operators/TableOperator.py +3 -1
- teradataml/table_operators/table_operator_util.py +58 -9
- teradataml/utils/dtypes.py +49 -1
- teradataml/utils/internal_buffer.py +38 -0
- teradataml/utils/validators.py +377 -62
- {teradataml-20.0.0.3.dist-info → teradataml-20.0.0.5.dist-info}/METADATA +200 -4
- {teradataml-20.0.0.3.dist-info → teradataml-20.0.0.5.dist-info}/RECORD +146 -112
- teradataml/data/SQL_Fundamentals.pdf +0 -0
- teradataml/libaed_0_1.dylib +0 -0
- teradataml/libaed_0_1.so +0 -0
- teradataml/opensource/sklearn/__init__.py +0 -0
- teradataml/store/vector_store/__init__.py +0 -1586
- {teradataml-20.0.0.3.dist-info → teradataml-20.0.0.5.dist-info}/WHEEL +0 -0
- {teradataml-20.0.0.3.dist-info → teradataml-20.0.0.5.dist-info}/top_level.txt +0 -0
- {teradataml-20.0.0.3.dist-info → teradataml-20.0.0.5.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"rev_id","aid","rev_name","helpful","rev_text","rating","prodsummary","unixrevtime","revtime"
|
|
2
|
+
A10000012B7CGYKOMPQ4L,"000100039X",Adam,"[0, 0]",Spiritually and mentally inspiring! A book that allows you to question your morals and will help you discover who you really are!,5.00,Wonderful!,1355616000,"12 16, 2012"
|
|
3
|
+
A2KU9IU07LOJS1,"000100039X",Amazon Customer,"[0, 0]",This book has been a classic for many years. It has so much wisdom in it that it can be read numerous times and new things will come out each time. My favorite chapter is the one on children.,5.00,Great classic that everyone should read,1384905600,"11 20, 2013"
|
|
4
|
+
A19N3FCQCLJYUA,"000100039X",Amazon Customer,"[1, 1]","I discovered The Prophet fifty years ago in college and have read it dozens of times since then. Now, in addition to my beat up hard copy, I have a portable e-copy. If you were looking for an example of an intelligently designed (pun intended) book of spiritual guidance, this would be it. It doesn""t care how you picture, name or define "God" or whether you give him a gender and a personality. It just cuts to the heart of how to live and how to relate to others. If Jesus and the Buddha teamed up to write a book, it might come out like this.When I first read it, I found some passages difficult to grasp. Looking back, I now think that it was not because they were hard to understand, but because I did not want to hear gently spoken, intelligently phrased ideas that contradicted my own. Now, if I could have only one book, this would probably be it.",5.00,A book everyone "should" read,1358899200,"01 23, 2013"
|
|
5
|
+
A5E9TSD20U9PR,"000100039X",April,"[0, 0]","For those who don""t know Gibran, get to know his work. The Prophet is a must read. His outlook on life is truly an inspiring guide on how to approach major life decisions. This is a relationship with a man""s work you won""t regret having.",5.00,Just beautiful.,1377475200,"08 26, 2013"
|
|
6
|
+
A1BM81XB4QHOA3,"000100039X","""Ahoro Blethends """"Seriously""""""","[0, 0]","This book provides a reflection that you can apply to your own life.And, a way for you to try and assess whether you are truly doing the right thing and making the most of your short time on this plane.",5.00,Must Read for Life Afficianados,1390003200,"01 18, 2014"
|
|
7
|
+
A26GKZPS079GFF,"000100039X",Areej,"[2, 3]","I would have to say that this is the best book I""ve ever read.. I could feel every word deep in my heart everytime, of the many times I""ve read it! I would never get enough of it! its a treasure..",5.00,Touches my heart.. again and.. again...,982972800,"02 24, 2001"
|
|
8
|
+
A1MOSTXNIO5MPJ,"000100039X",Alan Krug,"[0, 0]","I first read THE PROPHET in college back in the 60""s. The book had a revival as did anything metaphysical in the turbulent 60""s. It had a profound effect on me and became a book I always took with me. After graduation I joined the Peace Corps and during stressful training in country (Liberia) at times of illness and the night before I left, this book gave me great comfort. I read it before I married, just before and again after my children were born and again after two near fatal illnesses. I am always amazed that there is a chapter that reaches out to you, grabs you and offers both comfort and hope for the future.Gibran offers timeless insights and love with each word. I think that we as a nation should read AND learn the lessons here. It is definitely a time for thought and reflection this book could guide us through.",5.00,Timeless for every good and bad time in your life.,1317081600,"09 27, 2011"
|
|
9
|
+
A1TT4CY55WLHAR,"000100039X",anonymous,"[0, 0]","I have the 1972 version, bought in 1974. The 1972 version originally had a dust jacket but my dust jacket is long gone. This particular rendition has had many re-printings, for a reason: it""s very popular. The textured paper, old-style typography, and leather cover are better than a plain-old paperback. The size is diminutive, which is perfect for this book.",5.00,"textured paper, old-style typography, and leather cover",1342396800,"07 16, 2012"
|
|
10
|
+
A3FFNE1DR5SI1W,"000100039X",A. Morelli,"[1, 1]","Can""t say enough about Kahlil Gibran""s work among this piece. Everybody in the whole world should read this! There is almost too much to take in, really appreciate and put towards our daily lives. In my opinion, it is just one of the most beautiful literature pieces ever written. Would recommend to as a gift for anyone spiritual/poetic/philosophy/educational piece or just something to enjoy here and there. 5 stars for sure!",5.00,phenomenal piece of literature!,1340755200,"06 27, 2012"
|
|
11
|
+
A1340OFLZBW5NG,"000100039X",Amazon Customer,"[0, 0]",I LOVE this book... his writing seems to just flow from page to page. I get something different from this book each time I read it..,5.00,Perhaps the greatest book that I have ever read,1231977600,"01 15, 2009"
|
|
12
|
+
A29TRDMK51GKZR,"000100039X",Alpine Plume,"[0, 0]","Deep, moving dramatic verses of the heart and soul.Truths of ancient wisdom from a true and romantic poet.Relevant for all eternity.",5.00,Such Beauty,1383436800,"11 3, 2013"
|
|
13
|
+
A3FI0744PG1WYG,"000100039X","""Always Reading """"tkm""""""","[0, 0]","This is a timeless classic. Over the years I""ve given it as a gift more times than I can count, and will continue to do so. Addresses real life issues in a beautiful way and makes us reexamine our own attitude about how we see what happens in our lives. So easy to read over and over.",5.00,The Prophet,1390953600,"01 29, 2014"
|
|
14
|
+
A2XQ5LZHTD4AFT,"000100039X",Alaturka,"[7, 9]","A timeless classic. It is a very demanding and assuming title, but Gibran backs it up with some excellent style and content. If he had the means to publish it a century or two earlier, he could have inspired a new religion.From the mouth of an old man about to sail away to a far away destination, we hear the wisdom of life and all important aspects of it. It is a messege. A guide book. A Sufi sermon. Much is put in perspective without any hint of a dogma. There is much that hints at his birth place, Lebanon where many of the old prophets walked the Earth and where this book project first germinated most likely.Probably becuase it was written in English originally, the writing flows, it is pleasant to read, and the charcoal drawings of the author decorating the pages is a plus. I loved the cover.",5.00,A Modern Rumi,1033948800,"10 7, 2002"
|
|
15
|
+
A2LBBQHYLEHM7P,"000100039X","""Amazon Customer """"Full Frontal Nerdity""""""","[0, 0]","An amazing work. Realizing extensive use of Biblical imagery and sentence structure, "The Prophet" by Khalil Gibran is a literary classic. Influencing the Free Love movement of the 1960""s, Gibran""s master work explores themes of love, longing and loss.",5.00,A Modern Classic,1379808000,"09 22, 2013"
|
|
16
|
+
AENNW2G826191,"000100039X",Ashish A,"[1, 4]","Its a thin book, very readable and has interesting 1-2 page thoughts on various entities like anger, children, religion, speech, silence and its COOL.........reading. Ofcourse if one needs to imbibe the thoughts of the author, it has to be consumed slowly and perhaps revisited but leaves you pretty heady and clear about certain things.",3.00,Good Read,963446400,"07 13, 2000"
|
|
17
|
+
A2X4HE21JTAL98,"000100039X",Antiquarian,"[3, 5]","Anything I""ve read by Gibran is, in my mind, flawless. This, the most famous of his works, is no exception. It is simple, yet deep; honest and profound; moving and inspirational. Gibran""s work is one of a kind, and can be far more encouraging and moving than any self-help program or therapy or anything like that. The poetic style, the aphorisms, the parables, the almost biblical feel, are all just what over-worked, over-stressed, modern and spiritually starved worldly people need.",5.00,Flawless,1132099200,"11 16, 2005"
|
|
18
|
+
A3V1MKC2BVWY48,"000100039X",Alex Dawson,"[0, 0]","Reading this made my mind feel like a still pool of water, cool and quiet in a mossy grotto. It""s direct and simple wisdom has a depth of complexity that takes a quiet day to sink in, leaving you at peace. It is best to set time aside for it, relax, absorb, and let it softly clear your mind.",5.00,This book will bring you peace,1390780800,"01 27, 2014"
|
|
19
|
+
A1KQ80Y692CDOI,"000100039X",Atown,"[2, 9]","I read this about a year ago and can""t recall a great deal of the book. From what I do recall it was like a poem all the way through. While the writing was beautiful, I found it ambiguous and befuddled with meaning that I could not identify with. When Gibran speaks of God, I cannot identify because I have since abandoned those philosophies. It is thus difficult to revisit them in this book. I have the feeling a may have missed something great about this book. Indeed, I pulled wisdom from parts, but rather than go back and read it again, for now, perhaps I will move on to another of the many books out there that are enlightening and worth reading. Someday, I would like to read this again and dig deeper.",2.00,Eloquent,1206057600,"03 21, 2008"
|
|
20
|
+
AUTNO7VDY4H4A,"000100039X",Austin guy,"[0, 0]","Loved this book since first I read it, years gone by. Purchased this copy for a friend who has not ever read Gibran.",5.00,"A great book, buying it for a friend.",1371427200,"06 17, 2013"
|
|
21
|
+
A2WVHIRDMLM82E,"000100039X",Amazon Customer,"[0, 0]","This book has so much you can take out of it to use in your real life. Amazing, and one of my favorite reads of all time.",5.00,Amazing,1394928000,"03 16, 2014"
|
|
22
|
+
A2I35JB67U20C0,"000100039X",Amazon Customer,"[0, 0]","When I was in college in the 70""s this book had a revival and I did not read it then. Recently a friend (who is 90) and I were talking about work and she said: "work is love made visible," and told me it was from the Prophet. I though that was so beautiful I got the book and was not disappointed.You see, if you have ideas and you do not realize them, then they are nothing, and if your ideas do not come from love and joy, then they are bitter and what they produce will be bitter, but if they flow from love and joy, then their realization will be love and joy, thus work is love made visible.He says it WAY better that I do and says much more in just a few paragraphs. But as you can see from the example, what he says is not religious, but positive ways of looking at things. Since I rediscoverd the book I have given away many copies and everyone I have given it to sincerly thanked me.",5.00,Everyone should have this book,983318400,"02 28, 2001"
|
|
23
|
+
A12387207U8U24,"000100039X",Alex,"[0, 0]","As you read, Gibran""s poetry brings spiritual and visual beauty to life within you. Gibran is justly famous for rich metaphors that brilliantly highlight the pursuit of Truth and Goodness amidst all the darkness and light of human nature.",5.00,Graet Work,1206662400,"03 28, 2008"
|
|
24
|
+
A2S166WSCFIFP5,"000100039X","""adead_poet@hotmail.com """"adead_poet@hotmail.com""""""","[0, 2]","This is one my must have books. It is a masterpiece of spirituality. I""ll be the first to admit, its literary quality isn""t much. It is rather simplistically written, but the message behind it is so powerful that you have to read it. It will take you to enlightenment.",5.00,close to god,1071100800,"12 11, 2003"
|
|
25
|
+
A27ZH1AQORJ1L,"000100039X","""anybody else or """"amanuet""""""","[3, 3]","This book is everything that is simple, delicate, true, and beautiful.I have read few books so touching and enlightening; "The Prophet" is a true masterpiece that has that feeling of ancient wisdom in it. The wisdom of the text is gentle, yet insistent, it lets you understand things you""ve always known.My feelings defy description.",5.00,Enchanting,1066003200,"10 13, 2003"
|
|
26
|
+
ARDQ9KNB8K22N,"000100039X",Anwar,"[1, 1]","Cool book, I really like the quality of the production. Black clothbound with gold embossing and nice paper, looks to be cotton rag. I am proud to include it in my collection. Intrigueing story full of the sort of passion that does not cloud the mind or divert truth but instead is revealing and living. Very readable, the stories are short and highly economic so that one is likely to read for only a minute or two until something insightful is revealed. It is full of timeless truths which are of lasting value to the reader and inform life. The language and delivery is familiar yet of a quality that is penetrating in a similar way as it might be listening to a surmon by Jesus. I give it 5 stars. I considered giving only 4 stars because the format is fairly predictable but I have decided that this quality is actually a strength as one can pick up the book at any point and continue until the end...and then start over for that matter. Excellent for busy people or commuters!",5.00,"""""""The Prophet"""" is cool""",1329264000,"02 15, 2012"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"trans_dense": {
|
|
3
|
+
"location": "varchar(100)",
|
|
4
|
+
"tranid": "int",
|
|
5
|
+
"period": "varchar(20)",
|
|
6
|
+
"storeid": "int",
|
|
7
|
+
"region": "varchar(20)",
|
|
8
|
+
"item": "varchar(200)",
|
|
9
|
+
"sku": "int",
|
|
10
|
+
"category": "varchar(20)"
|
|
11
|
+
},
|
|
12
|
+
"trans_sparse": {
|
|
13
|
+
"location": "varchar(20)",
|
|
14
|
+
"tranid": "int",
|
|
15
|
+
"period": "varchar(20)",
|
|
16
|
+
"storeid": "int",
|
|
17
|
+
"region": "varchar(20)",
|
|
18
|
+
"item": "varchar(20)",
|
|
19
|
+
"sku": "int",
|
|
20
|
+
"category": "varchar(20)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -14,5 +14,16 @@
|
|
|
14
14
|
"petal_length" : "float",
|
|
15
15
|
"petal_width" : "float",
|
|
16
16
|
"species": "integer"
|
|
17
|
+
},
|
|
18
|
+
"amazon_reviews_25": {
|
|
19
|
+
"rev_id": "VARCHAR(64000)",
|
|
20
|
+
"aid": "VARCHAR(64000)",
|
|
21
|
+
"rev_name": "VARCHAR(64000)",
|
|
22
|
+
"helpful": "VARCHAR(64000)",
|
|
23
|
+
"rev_text": "VARCHAR(64000)",
|
|
24
|
+
"rating": "DECIMAL(10,2)",
|
|
25
|
+
"prodsummary": "VARCHAR(64000)",
|
|
26
|
+
"unixrevtime": "BIGINT",
|
|
27
|
+
"revtime": "VARCHAR(64000)"
|
|
17
28
|
}
|
|
18
29
|
}
|
|
@@ -23,7 +23,7 @@ def DataRobotPredict(modeldata=None, newdata=None, accumulate=None, model_output
|
|
|
23
23
|
Required Argument.
|
|
24
24
|
Specifies the name(s) of input teradataml DataFrame column(s) to
|
|
25
25
|
copy to the output.
|
|
26
|
-
Types: str OR list of Strings (str)
|
|
26
|
+
Types: str OR list of Strings (str) OR Feature OR list of Features
|
|
27
27
|
|
|
28
28
|
model_output_fields:
|
|
29
29
|
Optional Argument.
|
|
@@ -108,7 +108,7 @@ def DataRobotPredict(modeldata=None, newdata=None, accumulate=None, model_output
|
|
|
108
108
|
for each argument that accepts teradataml DataFrame as
|
|
109
109
|
input and can be accessed as:
|
|
110
110
|
* "<input_data_arg_name>_partition_column" accepts str or
|
|
111
|
-
list of str (Strings)
|
|
111
|
+
list of str (Strings) or PartitionKind
|
|
112
112
|
* "<input_data_arg_name>_hash_column" accepts str or list
|
|
113
113
|
of str (Strings)
|
|
114
114
|
* "<input_data_arg_name>_order_column" accepts str or list
|
|
@@ -24,7 +24,7 @@ def DataikuPredict(modeldata=None, newdata=None, accumulate=None, model_output_f
|
|
|
24
24
|
Specifies the name(s) of input teradataml DataFrame column(s) to
|
|
25
25
|
copy to the output. By default, the function copies all input
|
|
26
26
|
teradataml DataFrame columns to the output.
|
|
27
|
-
Types: str OR list of Strings (str)
|
|
27
|
+
Types: str OR list of Strings (str) OR Feature OR list of Features
|
|
28
28
|
|
|
29
29
|
model_output_fields:
|
|
30
30
|
Optional Argument.
|
|
@@ -86,6 +86,45 @@ def DataikuPredict(modeldata=None, newdata=None, accumulate=None, model_output_f
|
|
|
86
86
|
Default Value: False
|
|
87
87
|
Types: bool
|
|
88
88
|
|
|
89
|
+
**generic_arguments:
|
|
90
|
+
Specifies the generic keyword arguments SQLE functions accept. Below
|
|
91
|
+
are the generic keyword arguments:
|
|
92
|
+
persist:
|
|
93
|
+
Optional Argument.
|
|
94
|
+
Specifies whether to persist the results of the
|
|
95
|
+
function in a table or not. When set to True,
|
|
96
|
+
results are persisted in a table; otherwise,
|
|
97
|
+
results are garbage collected at the end of the
|
|
98
|
+
session.
|
|
99
|
+
Default Value: False
|
|
100
|
+
Types: bool
|
|
101
|
+
|
|
102
|
+
volatile:
|
|
103
|
+
Optional Argument.
|
|
104
|
+
Specifies whether to put the results of the
|
|
105
|
+
function in a volatile table or not. When set to
|
|
106
|
+
True, results are stored in a volatile table,
|
|
107
|
+
otherwise not.
|
|
108
|
+
Default Value: False
|
|
109
|
+
Types: bool
|
|
110
|
+
|
|
111
|
+
Function allows the user to partition, hash, order or local
|
|
112
|
+
order the input data. These generic arguments are available
|
|
113
|
+
for each argument that accepts teradataml DataFrame as
|
|
114
|
+
input and can be accessed as:
|
|
115
|
+
* "<input_data_arg_name>_partition_column" accepts str or
|
|
116
|
+
list of str (Strings) or PartitionKind
|
|
117
|
+
* "<input_data_arg_name>_hash_column" accepts str or list
|
|
118
|
+
of str (Strings)
|
|
119
|
+
* "<input_data_arg_name>_order_column" accepts str or list
|
|
120
|
+
of str (Strings)
|
|
121
|
+
* "local_order_<input_data_arg_name>" accepts boolean
|
|
122
|
+
Note:
|
|
123
|
+
These generic arguments are supported by teradataml if
|
|
124
|
+
the underlying SQL Engine function supports, else an
|
|
125
|
+
exception is raised.
|
|
126
|
+
|
|
127
|
+
|
|
89
128
|
RETURNS:
|
|
90
129
|
Instance of DataikuPredict.
|
|
91
130
|
Output teradataml DataFrame can be accessed using attribute
|
|
@@ -38,7 +38,7 @@ def H2OPredict(modeldata=None, newdata=None, accumulate=None, model_output_field
|
|
|
38
38
|
Required Argument.
|
|
39
39
|
Specifies the name(s) of input teradataml DataFrame column(s)
|
|
40
40
|
to copy to the output DataFrame.
|
|
41
|
-
Types: str OR list of Strings (str)
|
|
41
|
+
Types: str OR list of Strings (str) OR Feature OR list of Features
|
|
42
42
|
|
|
43
43
|
model_output_fields:
|
|
44
44
|
Optional Argument.
|
|
@@ -147,7 +147,7 @@ def H2OPredict(modeldata=None, newdata=None, accumulate=None, model_output_field
|
|
|
147
147
|
for each argument that accepts teradataml DataFrame as
|
|
148
148
|
input and can be accessed as:
|
|
149
149
|
* "<input_data_arg_name>_partition_column" accepts str or
|
|
150
|
-
list of str (Strings)
|
|
150
|
+
list of str (Strings) or PartitionKind
|
|
151
151
|
* "<input_data_arg_name>_hash_column" accepts str or list
|
|
152
152
|
of str (Strings)
|
|
153
153
|
* "<input_data_arg_name>_order_column" accepts str or list
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
def ONNXEmbeddings(newdata=None, modeldata=None, tokenizerdata=None, accumulate=None, model_output_tensor=None,
|
|
2
|
+
encode_max_length=512, show_model_properties=False, output_column_prefix="emb_",
|
|
3
|
+
output_format="VARBYTE(3072)", overwrite_cached_models="false", is_debug=False,
|
|
4
|
+
enable_memory_check=False, **generic_arguments):
|
|
5
|
+
"""
|
|
6
|
+
DESCRIPTION:
|
|
7
|
+
The ONNXEmbeddings() function is used to calculate embeddings values in
|
|
8
|
+
Vantage with a HuggingFace model that has been created outside Vantage
|
|
9
|
+
and exported to Vantage using ONNX format.
|
|
10
|
+
|
|
11
|
+
PARAMETERS:
|
|
12
|
+
newdata:
|
|
13
|
+
Required Argument.
|
|
14
|
+
Specifies the input teradataml DataFrame that contains
|
|
15
|
+
the data to be scored.
|
|
16
|
+
Types: teradataml DataFrame
|
|
17
|
+
|
|
18
|
+
modeldata:
|
|
19
|
+
Required Argument.
|
|
20
|
+
Specifies the model teradataml DataFrame to be used for
|
|
21
|
+
scoring.
|
|
22
|
+
Note:
|
|
23
|
+
* Use `retrieve_byom()` to get the teradataml DataFrame that contains the model.
|
|
24
|
+
Types: teradataml DataFrame
|
|
25
|
+
|
|
26
|
+
tokenizerdata:
|
|
27
|
+
Required Argument.
|
|
28
|
+
Specifies the tokenizer teradataml DataFrame
|
|
29
|
+
which contains the tokenizer json file.
|
|
30
|
+
Types: teradataml DataFrame
|
|
31
|
+
|
|
32
|
+
accumulate:
|
|
33
|
+
Required Argument.
|
|
34
|
+
Specifies the name(s) of input teradataml DataFrame column(s) to
|
|
35
|
+
copy to the output. By default, the function copies all input
|
|
36
|
+
teradataml DataFrame columns to the output.
|
|
37
|
+
Types: str OR list of Strings (str) OR Feature OR list of Features
|
|
38
|
+
|
|
39
|
+
model_output_tensor:
|
|
40
|
+
Required Argument.
|
|
41
|
+
Specifies the column of the model's possible output fields
|
|
42
|
+
that the user wants to calculate and output.
|
|
43
|
+
Types: str
|
|
44
|
+
|
|
45
|
+
encode_max_length:
|
|
46
|
+
Optional Argument.
|
|
47
|
+
Specifies the maximum length of the tokenizer output token
|
|
48
|
+
encodings(only applies for models with symbolic dimensions).
|
|
49
|
+
Default Value: 512
|
|
50
|
+
Types: int
|
|
51
|
+
|
|
52
|
+
show_model_properties:
|
|
53
|
+
Optional Argument.
|
|
54
|
+
Specifies the default or expanded "model_input_fields_map" based on
|
|
55
|
+
input model for defaults or "model_input_fields_map" for expansion.
|
|
56
|
+
Default Value: False
|
|
57
|
+
Types: bool
|
|
58
|
+
|
|
59
|
+
output_column_prefix:
|
|
60
|
+
Optional Argument.
|
|
61
|
+
Specifies the column prefix for each of the output columns
|
|
62
|
+
when using float32 "output_format".
|
|
63
|
+
Default Value: "emb_"
|
|
64
|
+
Types: str
|
|
65
|
+
|
|
66
|
+
output_format:
|
|
67
|
+
Optional Argument.
|
|
68
|
+
Specifies the output format for the model embeddings output.
|
|
69
|
+
Default Value: "VARBYTE(3072)"
|
|
70
|
+
Types: str
|
|
71
|
+
|
|
72
|
+
overwrite_cached_models:
|
|
73
|
+
Optional Argument.
|
|
74
|
+
Specifies the model name that needs to be removed from the cache.
|
|
75
|
+
When a model loaded into the memory of the node fits in the cache,
|
|
76
|
+
it stays in the cache until being evicted to make space for another
|
|
77
|
+
model that needs to be loaded. Therefore, a model can remain in the
|
|
78
|
+
cache even after the completion of function execution. Other functions
|
|
79
|
+
that use the same model can use it, saving the cost of reloading it
|
|
80
|
+
into memory. User should overwrite a cached model only when it is updated,
|
|
81
|
+
to make sure that the Predict function uses the updated model instead
|
|
82
|
+
of the cached model.
|
|
83
|
+
Note:
|
|
84
|
+
Do not use the "overwrite_cached_models" argument except when user
|
|
85
|
+
is trying to replace a previously cached model. Using the argument
|
|
86
|
+
in other cases, including in concurrent queries or multiple times
|
|
87
|
+
within a short period of time lead to an OOM error.
|
|
88
|
+
Default Value: "false"
|
|
89
|
+
Permitted Values: true, t, yes, y, 1, false, f, no, n, 0, *,
|
|
90
|
+
current_cached_model
|
|
91
|
+
Types: str
|
|
92
|
+
|
|
93
|
+
is_debug:
|
|
94
|
+
Optional Argument.
|
|
95
|
+
Specifies whether debug statements are added to a trace table or not.
|
|
96
|
+
When set to True, debug statements are added to a trace table that must
|
|
97
|
+
be created beforehand.
|
|
98
|
+
Notes:
|
|
99
|
+
* Only available with BYOM version 3.00.00.02 and later.
|
|
100
|
+
* To save logs for debugging, user can create an error log by using
|
|
101
|
+
the is_debug=True parameter in the predict functions.
|
|
102
|
+
A database trace table is used to collect this information which
|
|
103
|
+
does impact performance of the function, so using small data input
|
|
104
|
+
sizes is recommended.
|
|
105
|
+
* To generate this log, user must do the following:
|
|
106
|
+
1. Create a global trace table with columns vproc_ID BYTE(2),
|
|
107
|
+
Sequence INTEGER, Trace_Output VARCHAR(31000)
|
|
108
|
+
2. Turn on session function tracing:
|
|
109
|
+
SET SESSION FUNCTION TRACE USING '' FOR TABLE <trace_table_name_created_in_step_1>;
|
|
110
|
+
3. Execute function with "is_debug" set to True.
|
|
111
|
+
4. Debug information is logged to the table created in step 1.
|
|
112
|
+
5. To turn off the logging, either disconnect from the session or
|
|
113
|
+
run following SQL:
|
|
114
|
+
SET SESSION FUNCTION TRACE OFF;
|
|
115
|
+
The trace table is temporary and the information is deleted if user
|
|
116
|
+
logs off from the session. If long term persistence is necessary,
|
|
117
|
+
user can copy the table to a permanent table before leaving the
|
|
118
|
+
session.
|
|
119
|
+
Default Value: False
|
|
120
|
+
Types: bool
|
|
121
|
+
|
|
122
|
+
enable_memory_check:
|
|
123
|
+
Optional Argument.
|
|
124
|
+
Specifies whether there is enough native memory for large models.
|
|
125
|
+
Default Value: True
|
|
126
|
+
Types: bool
|
|
127
|
+
|
|
128
|
+
**generic_arguments:
|
|
129
|
+
Specifies the generic keyword arguments SQLE functions accept. Below
|
|
130
|
+
are the generic keyword arguments:
|
|
131
|
+
persist:
|
|
132
|
+
Optional Argument.
|
|
133
|
+
Specifies whether to persist the results of the
|
|
134
|
+
function in a table or not. When set to True,
|
|
135
|
+
results are persisted in a table; otherwise,
|
|
136
|
+
results are garbage collected at the end of the
|
|
137
|
+
session.
|
|
138
|
+
Default Value: False
|
|
139
|
+
Types: bool
|
|
140
|
+
|
|
141
|
+
volatile:
|
|
142
|
+
Optional Argument.
|
|
143
|
+
Specifies whether to put the results of the
|
|
144
|
+
function in a volatile table or not. When set to
|
|
145
|
+
True, results are stored in a volatile table,
|
|
146
|
+
otherwise not.
|
|
147
|
+
Default Value: False
|
|
148
|
+
Types: bool
|
|
149
|
+
|
|
150
|
+
Function allows the user to partition, hash, order or local
|
|
151
|
+
order the input data. These generic arguments are available
|
|
152
|
+
for each argument that accepts teradataml DataFrame as
|
|
153
|
+
input and can be accessed as:
|
|
154
|
+
* "<input_data_arg_name>_partition_column" accepts str or
|
|
155
|
+
list of str (Strings) or PartitionKind
|
|
156
|
+
* "<input_data_arg_name>_hash_column" accepts str or list
|
|
157
|
+
of str (Strings)
|
|
158
|
+
* "<input_data_arg_name>_order_column" accepts str or list
|
|
159
|
+
of str (Strings)
|
|
160
|
+
* "local_order_<input_data_arg_name>" accepts boolean
|
|
161
|
+
Note:
|
|
162
|
+
These generic arguments are supported by teradataml if
|
|
163
|
+
the underlying SQL Engine function supports, else an
|
|
164
|
+
exception is raised.
|
|
165
|
+
|
|
166
|
+
RETURNS:
|
|
167
|
+
Instance of ONNXEmbeddings.
|
|
168
|
+
Output teradataml DataFrame can be accessed using attribute
|
|
169
|
+
references, such as ONNXEmbeddings.<attribute_name>.
|
|
170
|
+
Output teradataml DataFrame attribute name is:
|
|
171
|
+
result
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
RAISES:
|
|
175
|
+
TeradataMlException, TypeError, ValueError
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
EXAMPLES:
|
|
179
|
+
# Notes:
|
|
180
|
+
# 1. Get the connection to Vantage to execute the function.
|
|
181
|
+
# 2. One must import the required functions mentioned in
|
|
182
|
+
# the example from teradataml.
|
|
183
|
+
# 3. Function will raise error if not supported on the Vantage
|
|
184
|
+
# user is connected to.
|
|
185
|
+
# 4. To execute BYOM functions, set 'configure.byom_install_location' to the
|
|
186
|
+
# database name where BYOM functions are installed.
|
|
187
|
+
|
|
188
|
+
# Import required libraries / functions.
|
|
189
|
+
import os, teradataml
|
|
190
|
+
from teradataml import get_connection, DataFrame
|
|
191
|
+
from teradataml import save_byom, retrieve_byom, load_example_data
|
|
192
|
+
from teradataml import configure, display_analytic_functions, execute_sql
|
|
193
|
+
|
|
194
|
+
# Load example data.
|
|
195
|
+
load_example_data("byom", "amazon_reviews_25")
|
|
196
|
+
|
|
197
|
+
# Create teradataml DataFrame objects.
|
|
198
|
+
amazon_reviews_25 = DataFrame.from_table("amazon_reviews_25")
|
|
199
|
+
|
|
200
|
+
# Assigning txt column name to rev_txt column.
|
|
201
|
+
amazon_reviews_25 = amazon_reviews_25.assign(txt=amazon_reviews_25.rev_text)
|
|
202
|
+
|
|
203
|
+
# Set install location of BYOM functions.
|
|
204
|
+
configure.byom_install_location = "td_mldb"
|
|
205
|
+
|
|
206
|
+
# Check the list of available analytic functions.
|
|
207
|
+
display_analytic_functions(type="BYOM")
|
|
208
|
+
|
|
209
|
+
# Retrieve model.
|
|
210
|
+
modeldata = retrieve_byom("bge-small-en-v1.5", table_name="onnx_models")
|
|
211
|
+
tokenizerdata = retrieve_byom("bge-small-en-v1.5", table_name="embeddings_tokenizers")
|
|
212
|
+
|
|
213
|
+
# Assigning tokenizer_id, tokenizer to model_id, model in embeddings_tokenizers.
|
|
214
|
+
tokenizerdata_a1 = tokenizerdata.assign(tokenizer_id=tokenizerdata.model_id)
|
|
215
|
+
tokenizerdata_a2 = tokenizerdata_a1.assign(tokenizer=tokenizerdata_a1.model)
|
|
216
|
+
|
|
217
|
+
# Example 1: Calculate embedding values in Vantage with a bge-small-en-v1.5
|
|
218
|
+
# model that has been created outside the Vantage by removing all
|
|
219
|
+
# the all cached models.
|
|
220
|
+
ONNXEmbeddings_out_1 = ONNXEmbeddings(modeldata=modeldata,
|
|
221
|
+
tokenizerdata=tokenizerdata_a2.select(['tokenizer_id', 'tokenizer']),
|
|
222
|
+
newdata=amazon_reviews_25.select(["rev_id", "txt"]),
|
|
223
|
+
accumulate='rev_id',
|
|
224
|
+
model_output_tensor='sentence_embedding'
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
# Print the results.
|
|
228
|
+
print(ONNXEmbeddings_out_1.result)
|
|
229
|
+
|
|
230
|
+
# Example 2: Showcasing the model properties of bge-small-en-v1.5 model that has been
|
|
231
|
+
# created outside the Vantage by showcasing.
|
|
232
|
+
ONNXEmbeddings_out_2 = ONNXEmbeddings(modeldata=modeldata,
|
|
233
|
+
tokenizerdata=tokenizerdata_a2.select(['tokenizer_id', 'tokenizer']),
|
|
234
|
+
newdata=amazon_reviews_25.select(["rev_id", "txt"]),
|
|
235
|
+
accumulate='rev_id',
|
|
236
|
+
model_output_tensor='sentence_embedding',
|
|
237
|
+
show_model_properties=True
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
# Print the results.
|
|
241
|
+
print(ONNXEmbeddings_out_2.result)
|
|
242
|
+
"""
|
|
@@ -40,7 +40,7 @@ def ONNXPredict(newdata=None, modeldata=None, accumulate=None, model_output_fiel
|
|
|
40
40
|
Required Argument.
|
|
41
41
|
Specifies the name(s) of input teradataml DataFrame column(s) to
|
|
42
42
|
copy to the output.
|
|
43
|
-
Types: str OR list of Strings (str)
|
|
43
|
+
Types: str OR list of Strings (str) OR Feature OR list of Features
|
|
44
44
|
|
|
45
45
|
model_output_fields:
|
|
46
46
|
Optional Argument.
|
|
@@ -146,7 +146,7 @@ def ONNXPredict(newdata=None, modeldata=None, accumulate=None, model_output_fiel
|
|
|
146
146
|
for each argument that accepts teradataml DataFrame as
|
|
147
147
|
input and can be accessed as:
|
|
148
148
|
* "<input_data_arg_name>_partition_column" accepts str or
|
|
149
|
-
list of str (Strings)
|
|
149
|
+
list of str (Strings) or PartitionKind
|
|
150
150
|
* "<input_data_arg_name>_hash_column" accepts str or list
|
|
151
151
|
of str (Strings)
|
|
152
152
|
* "<input_data_arg_name>_order_column" accepts str or list
|
|
@@ -52,7 +52,7 @@ def PMMLPredict(newdata=None, modeldata=None, accumulate=None,
|
|
|
52
52
|
Required Argument.
|
|
53
53
|
Specifies the name(s) of input teradataml DataFrame column(s)
|
|
54
54
|
to copy to the output DataFrame.
|
|
55
|
-
Types: str OR list of Strings (str)
|
|
55
|
+
Types: str OR list of Strings (str) OR Feature OR list of Features
|
|
56
56
|
|
|
57
57
|
model_output_fields:
|
|
58
58
|
Optional Argument.
|
|
@@ -143,7 +143,7 @@ def PMMLPredict(newdata=None, modeldata=None, accumulate=None,
|
|
|
143
143
|
for each argument that accepts teradataml DataFrame as
|
|
144
144
|
input and can be accessed as:
|
|
145
145
|
* "<input_data_arg_name>_partition_column" accepts str or
|
|
146
|
-
list of str (Strings)
|
|
146
|
+
list of str (Strings) or PartitionKind
|
|
147
147
|
* "<input_data_arg_name>_hash_column" accepts str or list
|
|
148
148
|
of str (Strings)
|
|
149
149
|
* "<input_data_arg_name>_order_column" accepts str or list
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
def Apriori(data=None, target_column=None, id_column=None, partition_columns=None,
|
|
2
|
+
max_len=2, delimiter=",", is_dense_input=False, patterns_or_rules=None,
|
|
3
|
+
support=0.01, **generic_arguments):
|
|
4
|
+
"""
|
|
5
|
+
DESCRIPTION:
|
|
6
|
+
The Apriori() function finds patterns and calculates different statistical metrics to
|
|
7
|
+
understand the influence of the occurrence of a set of items on others.
|
|
8
|
+
|
|
9
|
+
PARAMETERS:
|
|
10
|
+
data:
|
|
11
|
+
Required Argument.
|
|
12
|
+
Specifies the input teradataml DataFrame.
|
|
13
|
+
Types: teradataml DataFrame
|
|
14
|
+
|
|
15
|
+
target_column:
|
|
16
|
+
Required Argument.
|
|
17
|
+
Specifies the input teradataml DataFrame column which contains the data to filter.
|
|
18
|
+
Types: str
|
|
19
|
+
|
|
20
|
+
id_column:
|
|
21
|
+
Optional Argument.
|
|
22
|
+
Specifies the name of the column that uniquely groups the items that are purchased together.
|
|
23
|
+
Applicable only when `is_dense_input` is False.
|
|
24
|
+
Types: str
|
|
25
|
+
|
|
26
|
+
partition_columns:
|
|
27
|
+
Optional Argument.
|
|
28
|
+
Specifies the column name(s) in the "data" to partition the input.
|
|
29
|
+
Types: str or list of str
|
|
30
|
+
|
|
31
|
+
max_len:
|
|
32
|
+
Optional Argument.
|
|
33
|
+
Specifies the maximum number of items in the item set.
|
|
34
|
+
"max_len" must be greater than or equal to 1 and less than or equal to 20.
|
|
35
|
+
Default Value: 2
|
|
36
|
+
Types: int
|
|
37
|
+
|
|
38
|
+
delimiter:
|
|
39
|
+
Optional Argument, Required when "is_dense_input" is set to True.
|
|
40
|
+
Specifies a character or string that separates words in the input text.
|
|
41
|
+
Default Value: ","
|
|
42
|
+
Types: str
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
is_dense_input:
|
|
46
|
+
Optional Argument.
|
|
47
|
+
Specifies whether input data is in dense format or not.
|
|
48
|
+
When set to True, function considers the data is in dense format.
|
|
49
|
+
Otherwise function considers data is not in dense format.
|
|
50
|
+
Default Value: False
|
|
51
|
+
Types: bool
|
|
52
|
+
|
|
53
|
+
patterns_or_rules:
|
|
54
|
+
Optional Argument.
|
|
55
|
+
Specifies whether to emit PATTERNS or RULES as output.
|
|
56
|
+
Permitted Values: "PATTERNS", "RULES"
|
|
57
|
+
Types: str
|
|
58
|
+
|
|
59
|
+
support:
|
|
60
|
+
Optional Argument.
|
|
61
|
+
Specifies the support value (minimum occurrence threshold) of the itemset.
|
|
62
|
+
Default Value: 0.01
|
|
63
|
+
Types: float
|
|
64
|
+
|
|
65
|
+
**generic_arguments:
|
|
66
|
+
Optional Argument.
|
|
67
|
+
Specifies the generic keyword arguments SQLE functions accept. Below are the generic
|
|
68
|
+
keyword arguments:
|
|
69
|
+
persist:
|
|
70
|
+
Optional Argument.
|
|
71
|
+
Specifies whether to persist the results of the function in a table or not.
|
|
72
|
+
When set to True, results are persisted in a table; otherwise, results are
|
|
73
|
+
garbage collected at the end of the session.
|
|
74
|
+
Default Value: False
|
|
75
|
+
Types: bool
|
|
76
|
+
|
|
77
|
+
volatile:
|
|
78
|
+
Optional Argument.
|
|
79
|
+
Specifies whether to put the results of the function in a volatile table or not.
|
|
80
|
+
When set to True, results are stored in a volatile table; otherwise not.
|
|
81
|
+
Default Value: False
|
|
82
|
+
Types: bool
|
|
83
|
+
|
|
84
|
+
Function allows the user to partition, hash, order or local order the input
|
|
85
|
+
data. These generic arguments are available for each argument that accepts
|
|
86
|
+
teradataml DataFrame as input and can be accessed as:
|
|
87
|
+
* "<input_data_arg_name>_partition_column" accepts str or list of str (Strings)
|
|
88
|
+
* "<input_data_arg_name>_hash_column" accepts str or list of str (Strings)
|
|
89
|
+
* "<input_data_arg_name>_order_column" accepts str or list of str (Strings)
|
|
90
|
+
* "local_order_<input_data_arg_name>" accepts boolean
|
|
91
|
+
Note:
|
|
92
|
+
These generic arguments are supported by teradataml if the underlying SQLE Engine
|
|
93
|
+
function supports, else an exception is raised.
|
|
94
|
+
|
|
95
|
+
RETURNS:
|
|
96
|
+
Instance of Apriori.
|
|
97
|
+
Output teradataml DataFrames can be accessed using attribute references, such as AprioriObj.<attribute_name>.
|
|
98
|
+
Output teradataml DataFrame attribute name is:
|
|
99
|
+
result
|
|
100
|
+
|
|
101
|
+
RAISES:
|
|
102
|
+
TeradataMlException, TypeError, ValueError
|
|
103
|
+
|
|
104
|
+
EXAMPLES:
|
|
105
|
+
# Notes:
|
|
106
|
+
# 1. Get the connection to Vantage to execute the function.
|
|
107
|
+
# 2. One must import the required functions mentioned in the example from teradataml.
|
|
108
|
+
# 3. Function will raise an error if not supported on the Vantage user is connected to.
|
|
109
|
+
|
|
110
|
+
# Load the example data.
|
|
111
|
+
load_example_data("apriori", ["trans_dense","trans_sparse"])
|
|
112
|
+
|
|
113
|
+
# Create teradataml DataFrame objects.
|
|
114
|
+
dense_table = DataFrame.from_table("trans_dense")
|
|
115
|
+
sparse_table = DataFrame.from_table("trans_sparse")
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
# Check the list of available analytic functions.
|
|
119
|
+
display_analytic_functions()
|
|
120
|
+
|
|
121
|
+
# Import function Apriori.
|
|
122
|
+
from teradataml import Apriori
|
|
123
|
+
|
|
124
|
+
# Example 1: Find patterns in the input data with DENSE DATA, PARTITION,RULES .
|
|
125
|
+
Apriori_out = Apriori(data=dense_table, target_column="item",
|
|
126
|
+
partition_columns=["location"], max_len=2,
|
|
127
|
+
patterns_or_rules="rules", support=0.01)
|
|
128
|
+
|
|
129
|
+
# Print the result DataFrame.
|
|
130
|
+
print(Apriori_out.result)
|
|
131
|
+
|
|
132
|
+
# Example 2: Find patterns in the input data with SPARSE DATA, NO PARTITIONS, PATTERNS.
|
|
133
|
+
Apriori_out = Apriori(data=sparse_table, target_column="item",
|
|
134
|
+
id_column="tranid", max_len=3)
|
|
135
|
+
|
|
136
|
+
# Print the result DataFrame.
|
|
137
|
+
print(Apriori_out.result)
|
|
138
|
+
"""
|