0

I am attempting to run the Smote function in Teradata uisng the code below which is taken directly from the terdata guidance document.

SELECT * FROM TD_SMOTE (
      ON iris_enc_sample AS InputTable PARTITION BY ANY
      USING
      NumberOfNeighbors(5)
      IDColumn('id')
      MinorityClass('3')
      ResponseColumn('species')
      InputColumns('sepal_length', 'sepal_width', 'petal_length', 'petal_width')
      OversamplingFactor(2)
      SamplingStrategy('smote')
) AS dt;

but it keeps giving the error sytanx error expected something like a "," between the word td_smote and '('

CREATE MULTISET TABLE iris_enc_sample ,FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO,
     MAP = TD_MAP1
     (
      id INTEGER,
      sepal_length FLOAT,
      sepal_width FLOAT,
      petal_length FLOAT,
      petal_width FLOAT,
      species INTEGER)
PRIMARY INDEX ( id );
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (78,6.0,2.9,4.5,1.5,2);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (141,6.9,3.1,5.1,2.3,3);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (97,6.2,2.9,4.3,1.3,2);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (13,4.3,3.0,1.1,0.1,1);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (112,6.8,3.0,5.5,2.1,3);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (89,5.5,2.5,4.0,1.3,2);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (7,5.0,3.4,1.5,0.2,1);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (85,6.0,3.4,4.5,1.6,2);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (5,5.4,3.9,1.7,0.4,1);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (83,6.0,2.7,5.1,1.6,2);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (39,5.1,3.4,1.5,0.2,1);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (35,5.0,3.2,1.2,0.2,1);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (94,5.6,2.7,4.2,1.3,2);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (27,5.2,3.5,1.5,0.2,1);
INSERT INTO iris_enc_sample (id,sepal_length,sepal_width,petal_length,petal_width,species) VALUES (111,6.4,2.7,5.3,1.9,3);


SELECT * FROM TD_SMOTE (
      ON iris_enc_sample AS InputTable PARTITION BY ANY
      USING
      NumberOfNeighbors(5)
      IDColumn('id')
      MinorityClass('3')
      ResponseColumn('species')
      InputColumns('sepal_length', 'sepal_width', 'petal_length', 'petal_width')
      OversamplingFactor(2)
      SamplingStrategy('smote')
) AS dt;

expecting the function TD_SMOTE TO RUN

2
  • Most likely that function is not available on your instance. You can replace select * from TD_SMOTE ( with something silly like select * from ThisIsNotReal (..., and you'll get the same error. Commented Oct 10, 2024 at 13:33
  • I believe this function is only available in database version 20.00 and later. Commented Oct 10, 2024 at 16:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.