Jump to content

patjdixon

Super Seeqer
  • Posts

    94
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by patjdixon

  1. How would I apply this to the creation of the formula parameters argument in the following line? FormVarList = FormVarList + '"$' + InputName + '":"' + InputVar + '_ID["ID"].iloc[0]", '
  2. PM_SIM_SetModels_230416.ipynb is attached PM_SIM_SetModels_230416.ipynb
  3. I tried ChatGPT, but it didn't understand what Seeq does with Formula Paramaters so its recommendations didn't format it correctly. The core issue is that I am trying to dynamically create the Formula Parameters string, but the issue I think is that the argument cannot be a string, it needs to be an ID. In other words, if I have "$parameter":argument, the argument needs to be something like Training_ID["ID"].iloc[0], not "Training_ID["ID"].iloc[0]". I am not sure how to do that. Any ideas?
  4. Got a single positioner indexer out of bounds error
  5. for ModelConfig_Column in range(1,ModelConfig_NumColumns): TargetTag = ModelConfig_CSV[0][ModelConfig_Column] #print(TargetTag_Running) # Set the type of regression formula if ModelConfig_CSV[2][ModelConfig_Column] == "OLS": RegressFormula = "$target.regressionModelOLS(" elif ModelConfig_CSV[2][ModelConfig_Column] == "Ridge": RegressFormula = "$target.regressionModelRidge(" elif ModelConfig_CSV[2][ModelConfig_Column] == "PCR": RegressFormula = "$target.regressionModelPCA(" else: RegressFormula = "" #print(RegressFormula) RegressFormula = RegressFormula+"$condition.toGroup(capsule("+DataRange+"), CapsuleBoundary.Intersect)" #print(RegressFormula) if ModelConfig_CSV[6][ModelConfig_Column]: RegressFormula =RegressFormula + ", true," else: RegressFormula =RegressFormula + ", false," #print(RegressFormula) InputList = "" FormVarList = "" for ModelConfig_Row in range (7,27): # When a cell is empty, it is false InputVar = ModelConfig_CSV[ModelConfig_Row][ModelConfig_Column] if ModelConfig_CSV[ModelConfig_Row][ModelConfig_Column]: InputName = ModelConfig_CSV[ModelConfig_Row][0] Scale = ModelConfig_CSV[1][ModelConfig_Column] locals()[InputVar + '_ID'] = spy.search({ 'Name': InputVar + '_ID', 'Scoped To':scopedtoid }) #print(Scale) if "Linear" in Scale: InputList = InputList + " $" + InputName + "," elif "Log" in Scale: InputList = InputList + " $" + InputName + ", ln($" + InputName + ").validValues()," elif "Polynomial" in Scale: Poly_Exponent = re.findall(r'\d', Scale ) #print(Poly_Exponent[0]) for ExpNum in range(1,int(Poly_Exponent[0])+1): InputList = InputList + " $" + InputName + "^"+ str(ExpNum) +"," elif "Expanded" in Scale: # not fully implemented yet, its rather complex InputList = InputList + " $" + InputName + "," else: InputList ="" # Set the list of inputs for formula variables FormVarList = FormVarList + "'$" + InputName + "':" + InputVar + "_ID['ID'].iloc[0], " #print(ModelConfig_CSV[ModelConfig_Row][ModelConfig_Column]) # remove final ',' #FormVarList = FormVarList[:-1] InputList = InputList[:-1] RegressFormula = RegressFormula + InputList + ")" VarSelectFlag = ModelConfig_CSV[5][ModelConfig_Column] print(VarSelectFlag) if VarSelectFlag == "TRUE": RegressFormula = RegressFormula + ".variableSelection(" + ModelConfig_CSV[6][ModelConfig_Column]+ ")" RegressFormula = RegressFormula + ".predict(" + InputList + ")" FormVarList = FormVarList + "'$target':" + TargetTag + "_ID['ID'].iloc[0], '$condition':Training_ID['ID'].iloc[0]" #print(RegressFormula) print(FormVarList) print() metadata = list() metadata.append({ 'Name': TargetTag +'_PRED', 'Type': 'Signal', 'Description': 'Prediction tag', 'Formula': RegressFormula, 'Formula Parameters': {str(FormVarList)} }) PRED_metadata = pandas_obj.DataFrame(metadata) spy.push(metadata = PRED_metadata, workbook=scopedtoid)
  6. What I am not seeing is how to create a dynamic Formula Parameters list. I have done a bunch of DataLab formula signals, but I need a way to dynamically construct the formula parameter list. Are there any examples?
  7. Thanks for the very timely response, I will take a look
  8. I am trying to create formulas in which the formula parameters are dynamically created (see the attached image). I print the resulting string for the formula parameters and it looks correct. However, I get an error on the push stating that the format is incorrect. Is there a way to fix this?
  9. Thanks Selmane, I made that correction and it works. I really wish there was a cleaner way to do this. I would like to just do calculations on conditions instead of being restricted to capsules.
  10. This helps, but it is really clunky. I hate having to type in specific dates in DataLab to create capsules. What I really want is to create conditions in WorkBench that I can use in calculations in DataLab. It looks like the best way to do that is within() in formulas. Most of the calculations cannot use conditions, they need capsules.
  11. This helps, but it is really clunky. I hate having to type in specific dates in DataLab to create capsules. What I really want is to create conditions in WorkBench that I can use in calculations in DataLab. It looks like the best way to do that is within() in formulas. Most of the calculations cannot use conditions, they need capsules.
  12. This doesn't quite work. As you can see, the average calculated this way differs from the Metric (Temp when good Avg Metric). This is really clunky, even if it worked. I am going to submit a feature request
  13. I am finding it difficult to create an SQC chart in Seeq If I show this in Excel, it is pretty easy 1. I start with a Temperature that effects a Quality measurement. The process engineer suspects there is a relationship between Temperature and Quality 2. The engineer puts a condition into Excel to show the quality good when it is greater than 80 3. We filter for all good values 4. We create the average and standard deviation for the good values 5. We put these values in columns, with a 2-standard deviation limit high and low 6. Now we can create a chart showing the quality is bad when temperature is outside limits ******** Now I want to do this in Seeq 1. I create condition for good quality 2. I use the condition to calculate the average when quality is good. THIS IS THE PROBLEM; it calculates an average for every capsule, not for the aggregate condition. Using aggregate in a formula doesn't work either. I find no way to calculate the average for the whole condition 3. Using a metric has the same problem 4. I can use "within()" to create a signal that only has temperature during good quality 5. I can then use a metric to calculate the average for good condition 6. However, I cannot use it in a formula. Therefore, the average and standard deviation from a metric cannot be used in a formula for SQC limits like I have in Excel ********* Does anyone know how this can be done in Seeq?
  14. What is the best way to copy a DataLab script from one project to another? In my case I have folders with the Workbench, Organizer, and DataLab that I need for a particular project. I can duplicate the folder, which copies the Workbench and Organizer, but does not create a DataLab project in that folder. When I create the DataLab project, I want to copy DataLab script from the prior project. If go to the prior project, make duplicates of the scripts, and try to use Move from the prior project, it asks for the directory path. I don't know what to enter. I can always open each script, save it to a local disk, then go to the new DataLab project and upload. I assumed Move would be a better way to do it. Anyone know how to make this work?
  15. Thanks James, that is the answer. I duplicated the workbook and got the Error Report. I assume this always happens when you have a CSV import?
  16. I have items imported from a CSV, and they show up in Workbench and I can create signals from Value Search. However, if I try to use any of the item in a formula it says The item with ID 00000000-0000-0000-0000-000000000276 could not be found
  17. This is great, but in my case I already have a topic and worksheets created. What I would like to do is append the end of each Organizer worksheet with the appropriate plot. For example, my worksheets could be 'Tensile' , 'Burst', 'Tear', and 'Fold'. On each one, I want to append the plot of the property to the worksheet, so 'Tensile' would have a plot of Tensile, 'Burst' a plot of Burst, etc. I cannot figure out a way to do pull/push to make this work. Any ideas?
  18. I have DataLab code that generates a plot: I thought there was a way in DataLab to push "ax" to an Organizer topic/sheet, but I can't find any information on how to do this. The result I am looking for would be like: Is there a way to do this, or do I have to export an image from DataLab and then manually import it into Organizer?
  19. The problem was: RampCond_Tags['Archived']='True' This should not be set to a string, it needs to be set to a boolean: RampCond_Tags['Archived']=True
  20. I am having trouble removing signals from DataLab. I tried this, and it looks like it set all signals to ARCHIVE: Notice the ID 18B29A83-783F-475D-B2BB-7ACF2BFB8362 for QCS_BasisWeight_RampCond says it is Archived: However, in WorkBench the same ID shows it is not archived: How can I use DataLab to remove/delete/archive signals?
×
×
  • Create New...