Jump to content

Convert a a condition written with a tool to formula (so it can be improved)


Recommended Posts

Hello,

i defined some conditions, using identify->value search, etc, which is very convenient and easy to get started

but i'd like to update this definition or add other criteria. this could be easily done using formula.

i see we can duplicate to formula, is it also possible to convert to formula?

 

thank you

 

Link to comment
Share on other sites

  • Seeq Team

Hi Margarida, 

The only way to convert it in Workbench is by duplicating it to a formula. After that, update all calculations with this variable by substituting the old condition created with Workbench's tool with the new duplicate. 

Regards, 
Kin How

Link to comment
Share on other sites

  • Seeq Team

To add what Kin How mentioned above, I would encourage you to submit a feature request for this capability as I could see this being very helpful when iterating analyses over time. 

To do so, go to support.seeq.com, click on "Support Portal" in the lower right, and submit an "Analytics Help" request referencing this post.  A one-liner will be sufficient.  We will make sure it gets linked to a developer feature request.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi Margarida,

as a workaround you can use the REST API to convert an element to a formula. Each item has a property called "UIConfig" that stores the information which user interface should be used when editing the element. You can use the endpoint /items/{id}/properties/{propertyName} to update (POST) or remove (DELETE) it. However you should be careful using the API, as you may break things.
image.thumb.png.0e57accc8fccad13e11cc657790b6c2a.png

Both removing and updating the property had the effect that Seeq is opening the formula editor instead of the UI tool.

image.thumb.png.c42829d787ac1b93327cd966b8904f92.png

 

image.thumb.png.fb12dc42404df0a364afe338587fd1cb.png

 

image.thumb.png.af69f367e18635be46475320fa310b06.png

Regards,

Thorsten

Link to comment
Share on other sites

Hello Thorsten,

thanks for your suggestion. i was going to try it but could not really find it, the "You can use the endpoint /items/{id}/properties/{propertyName} to update (POST) or remove (DELETE) it", i mean i can't see your second screenshot. not sure anything to do with my version (R60.1.2)?

 

thanks

Link to comment
Share on other sites

Good morning Thorsten, 

i do see a different screen (i see"property information" instead of "body".

I was testing with a different condition, with the respective ID and i thought i would need to use the original text in the UIConfig field and update it? highlighted is the text in my UIConfig? or how exactly should i proceed?

image.thumb.png.ca7c63614bde5516fcd5c00d8cef958c.png

 

Link to comment
Share on other sites

Hi Margarida,

you can use the following settings in the request body:

{
  "unitOfMeasure": "string",
  "value": "{\"type\":\"formula\",\"advancedParametersCollapsed\":true,\"helpShown\":false}"
}

image.thumb.png.ca79557b3e22b8a037f95b9ce0c3b117.png

If you want to switch back to the UI tool you should save your previous value somewhere, so you could reuse this in the POST request. 

Regards,

Thorsten

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

This is very helpful.  I found that you can convert a formula to a tool interface this way.  In my case I had prediction models built in DataLab using formulas, but formulas do not show model coefficients.  This technique allows me to specify UIConfig as:

{"value": "{\"type\":\"prediction\"}”}

This converts the formula to a tool interface

It should be noted that if you do a "Get" on the property UIConfig for an item created in DataLab, it won't find UIConfig:

image.thumb.jpeg.606f02f8e244a12906e8bdeb26c63f4b.jpeg

However, you can still use the API to create UIConfig and it works.  When using:

{"value": "{\"type\":\"prediction\"}”}

it produces to Tool user interface:

image.thumb.jpeg.4b4906bfc1653c6be50afe8c9675059e.jpeg

When using:

{"value": "{\"type\":\"formula\"}”}

it produces:

image.thumb.jpeg.ceb3713f88d1154e6d62b2fe8356a6ca.jpeg

image.jpeg

Link to comment
Share on other sites

Hi Pat,

that is interesting. When writing the posts above I had tested changing the UIConfig property back and forth with a Value Search and ran into problems:

image.png.612926f95940227a4aefbfa34bf7cd2a.png
UIConfig is set to "value-search":
image.thumb.png.828af7fd714d3a644169aa29082bf3a8.png

After changing to "formula" Seeq displays the formula editor when editing the tool:

image.png.2b3b70c000d7fc6b3f43aef4eebfc600.png

When changing the property back to "value-search" the Value Search tool has no configuration:

image.png.fbcfd5ff0dd5b60f3c37be824f632f36.png

I just tested this with a daily periodic condition with specific days selected which gave the same results. A prediction that does not have the default values set behaves the same:

image.thumb.png.5cc6dc521f86c4c22d087bb9221b570a.png

After changing "UIConfig" to "formula" and back to "prediction" the regression method in the UI has changed to OLS instead of Ridge Regression. although in formula it still uses the regressionModelRidge() function:

image.thumb.png.1549864f9567ce4c992469ec638c7b75.png

Executing the tool changes the formula to use regressionModelOLS(). 

My conclusion: I would not rely on converting a formula back to a tool as long as you do not know the exact parameters for the tool and therefore have the complete UIConfig string. Seeq seems not be able to extract these from the formula.

Regards,

Thorsten

 

 

Link to comment
Share on other sites

  • 4 weeks later...

Thorsten, unfortunately your right.  When I convert to "prediction\" I always get the default configuration of the model, which is linear.  My formula has a 3rd order polynomial model, but the conversion makes it linear.  That does not work for me.  I guess I am really stuck.

Link to comment
Share on other sites

Is there any documentation on the property names or parameters?  Perhaps if I knew them I could use the API to set the type as well as the scale, order, regression method, etc so that I could get what I need?  Does anyone know where to find such documentation?

Link to comment
Share on other sites

  • 2 weeks later...

I notice the UIConfig does not show the advanced setting "Limit to condition within training window".  In the user interface you can select a condition for limiting the training window.  This is different from the hard coded training window dates.

image.thumb.jpeg.dd8d42ea43f0f089b845dd5f3363c3ea.jpeg

If I look for this parameter in UIConfig it does now show up.  

image.jpeg.8453435d0e2a913eeedbd90329fcd1ea.jpeg

The WindowStart and WindowEnd are the hard coded dates for Training Window, not related to the condition configured for "Limit to condition ..."

image.thumb.jpeg.b7a487bfcf44ec6f064558937c267d83.jpeg

The limit to condition does not appear in the formula parameter either:

image.thumb.jpeg.0c0d03213c1005cf58b7a53a7c75e064.jpeg

Is there any way to access this parameter from DataLab?

 

 

image.jpeg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...