🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

KSQuery SQL command with String Variable in KnowledgeStudio

User: "John Yang_22222"
Altair Community Member
Updated by John Yang_22222

Dear Sir,

   I am looking for some automation scripts execution in KnowledgeStudio. The way I do in the first stage is to open KSQuery log view and run model(Ex: DeepLearning Model). The log has be captured successfully in KSQuery log view. The next step I want to do is to change some model parameters, such as hidden layer no and node in each layer in the log scripts I recorded. The original hidden layer parameters is '40/40/40'. I try to declare SQL variable and set this variable like below codes

DECLARE @HiddenVar AS VARCHAR(10)

SET @HiddenVar='40/40/40'

however, when I run these two line by using KSQuery.exe in command line. I always bring me error. can't parse the DECLARE...

If I want to replace '40/40/40' in the KSQuery script by variable, Ex: HiddenVar, what should I do?

 

Find more posts tagged with

Sort by:
1 - 3 of 31
    User: "Mahshid"
    Altair Employee
    Updated by Mahshid

    Hi John,

    Go back to the DeepLearning Model node in your Knowledge Studio workflow. Modify the input parameters az you wish, and then retrain (rerun) the model. Then you have an updated KSquery log.  

    User: "John Yang_22222"
    Altair Community Member
    OP
    Updated by John Yang_22222

    Hi John,

    Go back to the DeepLearning Model node in your Knowledge Studio workflow. Modify the input parameters az you wish, and then retrain (rerun) the model. Then you have an updated KSquery log.  

    Hi Mahshid,

       Thanks for your comment. I know the way you suggest becuase I did this before. I know I can directly change the parameter value in the recorded script by string compared and replaced. But, that is not I want and that is time-consuming for full context search and replace.

    What I want to is find a way to replace the parameters value by variables defined external without open KS GUI. Then, I just need to change the variable value and rerun the script again. I don't know if this way is possible because I don't know what script language is adopted in KSQuery. When I look the recorded script, I think that looks like SQL and guess maybe support the string variable declaration and assignment. If that is not possible, I will go back to search and replace way to implement.

    User: "dmitri_1"
    Altair Employee
    Updated by dmitri_1

    Hi John, 

    The language used by the Knowledge Studio engine is SQL DMX (SQL with Data Mining eXtensions). I asked Knowledge Studio developers how the use of variables is supported, and what's the right syntax for that. Will get back to you hopefully by the end of this week.

    Regards,

    Dmitri