Jump to content

Frustrating problem with regression formula in DataLab


patjdixon
Go to solution Solved by Mark Derbecker,

Recommended Posts

I have a DataLab script that creates a regression formula and pushes the item.  The problem is that when I see the item in Workbench, it has no user interface (there is no edit capability, no UIConfig).  When I try to open the item properties, the worksheet seems to crash and reverts to the home folder.  I am sure I used to have this working about a month ago, but now I can't get it to work.

For an example, the item "Prediction 1" that was created in the Workbench user interface (Tools, Model & Predict, Prediction), shows what a regression formula should look like:

image.thumb.jpeg.4676643d5dcc345b87bbdde370be4059.jpeg

If I create a formula to remove data, the code below:

image.thumb.jpeg.88da95d287797d89a2e778e228664ac9.jpeg

 

produces the desired results, an item (TestRunning_pred) in WorkBench that I can edit.  However, the code below to use a regression formula:

image.thumb.jpeg.070f238a8f8bff42b4d527e47ccf78ad.jpeg

produces an item (NewTest_PRED) that I can add to a worksheet but I cannot edit and if I select the item properties the worksheet disappears, as if it crashes:

image.thumb.jpeg.dfecd70869ae068208bd66dc14898508.jpeg

I don't see any difference between the formula created from the Tools (Prediction 1) and the item I create in DataLab (NewTest_PRED).  I also don't see any difference in the way I create the metadata between "TestRunning_Pred" and "NewTest_PRED".  However, it looks like a regression formula does not work when pushed from DataLab.

I am on R61.1.3-v202307120420

Any ideas to fix this?

Link to comment
Share on other sites

  • Seeq Team

When I try to open the item properties, the worksheet seems to crash and reverts to the home folder. 

This is the clue we'll need to drill down on. Pat if you're using Chrome, open up the Developer Tools with Ctrl+Shift+I. Then click on the Console tab, which will allow us to see any JavaScript errors. Now recreate this problem (where it crashes & reverts to the home folder), and I'm guessing there will be some errors that show in red in the Console. Please copy & paste them into a reply to this thread (be generous with how much you copy/paste, the more info we have the better).

  • Like 1
Link to comment
Share on other sites

  • Seeq Team

OK as I suspected, I think there's a JSON syntax error in the UIConfig property for the problematic item. Go into the API Reference, then go to `GET /items/{id}` and copy/paste the item's ID there. You should get back a bunch of JSON that includes the UIConfig property. Can you copy/paste that into this thread?

  • Like 1
Link to comment
Share on other sites

{ "id": "0EE6557D-882B-F970-9854-502353F5A143", "name": "NewTest_PRED", "type": "CalculatedSignal", "description": "Prediction tag", "effectivePermissions": { "read": true, "write": true, "manage": true }, "properties": [ { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Archived", "name": "Archived", "value": "false" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Cache+Enabled", "name": "Cache Enabled", "value": "true" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Cache+ID", "name": "Cache ID", "value": "0ee66176-8ce5-ee20-b559-9dcc6c36eb73", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Data+ID", "name": "Data ID", "value": "[0EE473B9-95A2-FB50-9DE6-29EBF1F67009] {Signal} NewTest_PRED", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Datasource+Class", "name": "Datasource Class", "value": "Seeq Data Lab", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Datasource+ID", "name": "Datasource ID", "value": "Seeq Data Lab", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Datasource+Name", "name": "Datasource Name", "value": "Seeq Data Lab", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Description", "name": "Description", "value": "Prediction tag", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Enabled", "name": "Enabled", "value": "true" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Formula", "name": "Formula", "value": "$target.regressionModelOLS(group(capsule(\"2021-01-03T02:12:48.021Z\",\"2021-03-04T22:12:48.021Z\")), true,$a, $a^2).variableSelection(0.05).predict($a, $a^2)", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/ID", "name": "ID", "value": "0EE6557D-882B-F970-9854-502353F5A143", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Interpolation+Method", "name": "Interpolation Method", "value": "Linear", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Key+Unit+Of+Measure", "name": "Key Unit Of Measure", "value": "ns", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Maximum+Interpolation", "name": "Maximum Interpolation", "value": "40", "unitOfMeasure": "h" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Scoped+To", "name": "Scoped To", "value": "0EE473B9-95A2-FB50-9DE6-29EBF1F67009", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Sync+Token", "name": "Sync Token", "value": "2023-10-08T20:16:06.907564", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/UIConfig", "name": "UIConfig", "value": "{\"type\":\"prediction\",\"option\":\"linear\",\"polynomialValue\":2,\"mustGoThroughZero\":FALSE,\"variableSelectionEnabled\":FALSE,\"variableSelection\":0.05,\"windowStart\":1609365600000,\"windowEnd\":1616306430000,\"regressionMethod\":\"OLS\"}", "unitOfMeasure": "string" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Unsearchable", "name": "Unsearchable", "value": "false" }, { "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/Value+Unit+Of+Measure", "name": "Value Unit Of Measure", "value": "", "unitOfMeasure": "string" } ], "cached": true, "scopedTo": "0EE473B9-95A2-FB50-9DE6-29EBF1F67009", "datasource": { "id": "1E25E639-5FFF-450A-BEC7-C91ED0080D01", "name": "Seeq Data Lab", "type": "Datasource", "datasourceClass": "Seeq Data Lab", "datasourceId": "Seeq Data Lab", "isArchived": false, "isRedacted": false }, "fingerprint": "0e798e88-9fdd-4e48-acd1-5bc073641a55", "isArchived": false, "isRedacted": false }

Link to comment
Share on other sites

For UIConfig alone:

   {
      "href": "/items/0EE6557D-882B-F970-9854-502353F5A143/properties/UIConfig",
      "name": "UIConfig",
      "value": "{\"type\":\"prediction\",\"option\":\"linear\",\"polynomialValue\":2,\"mustGoThroughZero\":FALSE,\"variableSelectionEnabled\":FALSE,\"variableSelection\":0.05,\"windowStart\":1609365600000,\"windowEnd\":1616306430000,\"regressionMethod\":\"OLS\"}",
      "unitOfMeasure": "string"
    },

Link to comment
Share on other sites

Mark YUDAMAN!!! That fixed it.  What I really don't understand is the original code did not set UIConfig, it only set a formula.  It looks like something gets stuck anytime you write to UIConfig for any item that carries over to all items?  I don't get it, but this fixes the problem and I can get this working.  This took a couple of weeks for me to figure out.

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...