patjdixon Posted October 7, 2023 Share Posted October 7, 2023 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: If I create a formula to remove data, the code below: produces the desired results, an item (TestRunning_pred) in WorkBench that I can edit. However, the code below to use a regression formula: 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: 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 More sharing options...
Seeq Team Mark Derbecker Posted October 8, 2023 Seeq Team Share Posted October 8, 2023 > 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). 1 Link to comment Share on other sites More sharing options...
patjdixon Posted October 8, 2023 Author Share Posted October 8, 2023 I am on a Mac, not sure how to do Ctrl+Shift+I and where to do it (worksheet, datalab script, etc)? Link to comment Share on other sites More sharing options...
patjdixon Posted October 8, 2023 Author Share Posted October 8, 2023 Is this what you mean? You get to it in advanced mode, Commands, New Console. When I select the item properties in workbench and get a crash, nothing shows up here. Link to comment Share on other sites More sharing options...
patjdixon Posted October 8, 2023 Author Share Posted October 8, 2023 I think I now understand, you were talking about developer tools in Chrome, not Seeq. When I open the worksheet and go to Console I see: When I select item properties on NewTest_PRED I get: Link to comment Share on other sites More sharing options...
Seeq Team Mark Derbecker Posted October 8, 2023 Seeq Team Share Posted October 8, 2023 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? 1 Link to comment Share on other sites More sharing options...
patjdixon Posted October 8, 2023 Author Share Posted October 8, 2023 { "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 More sharing options...
patjdixon Posted October 8, 2023 Author Share Posted October 8, 2023 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 More sharing options...
Seeq Team Mark Derbecker Posted October 8, 2023 Seeq Team Share Posted October 8, 2023 The problem is that `FALSE` is capitalized, which is invalid JSON. It needs to be `false`. I plugged it into JSON Pretty Print: 1 Link to comment Share on other sites More sharing options...
Seeq Team Mark Derbecker Posted October 8, 2023 Seeq Team Share Posted October 8, 2023 Once you fix that, it's valid JSON: Link to comment Share on other sites More sharing options...
patjdixon Posted October 8, 2023 Author Share Posted October 8, 2023 I don't understand. The formula string is: '$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)' Link to comment Share on other sites More sharing options...
patjdixon Posted October 8, 2023 Author Share Posted October 8, 2023 If you look at the image I originally posted, you see the code with 'true'. How does that end up being 'FALSE'? Link to comment Share on other sites More sharing options...
patjdixon Posted October 8, 2023 Author Share Posted October 8, 2023 Is it possible that a prior script set UIConfig and that item is stuck with a bad UIConfig until I archive it in the API? Link to comment Share on other sites More sharing options...
Seeq Team Solution Mark Derbecker Posted October 8, 2023 Seeq Team Solution Share Posted October 8, 2023 Correct: The problem is not related to the formula, the problem is that an invalid UIConfig property was somehow posted. You can fix it by posting the valid UIConfig with the capitalization fixed. 1 Link to comment Share on other sites More sharing options...
patjdixon Posted October 8, 2023 Author Share Posted October 8, 2023 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 More sharing options...
Seeq Team Mark Derbecker Posted October 8, 2023 Seeq Team Share Posted October 8, 2023 > It looks like something gets stuck anytime you write to UIConfig for any item that carries over to all items? I wouldn't expect so-- otherwise we'd have a lot of problems created by writing UIConfigs. Link to comment Share on other sites More sharing options...
patjdixon Posted October 9, 2023 Author Share Posted October 9, 2023 Then how is it the metadata for NewTest_PRED shows 'true', the item is deleted each time the script is run, and UIConfig is not used in the script, but UIConfig shows 'FALSE'? Link to comment Share on other sites More sharing options...
Seeq Team Mark Derbecker Posted October 9, 2023 Seeq Team Share Posted October 9, 2023 I'm not sure-- you'll have to step through the script and try to discern where that value is being written. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now