Jump to content

patjdixon

Super Seeqer
  • Posts

    94
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by patjdixon

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

    seeq_formparams_2023-05-18 at 9.45.10 PM.jpg

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

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

     

     

    seeq_formparams_2023-05-16 at 1.52.28 PM.jpg

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

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

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

    image.thumb.jpeg.677bfbeaae2ba33f9a8ccdaf9127edbc.jpeg

    2. The engineer puts a condition into Excel to show the quality good when it is greater than 80

    image.thumb.jpeg.997b4f35fd4d58439422c76ce5f998dc.jpeg

    3. We filter for all good values

    image.thumb.jpeg.d4fd569be9408abaaeffc6f32f1c9fe7.jpeg

    4. We create the average and standard deviation for the good values

    image.thumb.jpeg.75a1c6b1679ea1e2f5833c83db7578ac.jpeg

    5. We put these values in columns, with a 2-standard deviation limit high and low

    image.thumb.jpeg.9b7a2987fdd8e72be4ce1d124204564c.jpeg

    6. Now we can create a chart showing the quality is bad when temperature is outside limits

    image.thumb.jpeg.8f6604a6301e6078f8d20bc7bfe517b3.jpeg

    ********

    Now I want to do this in Seeq

    1. I create condition for good quality

    image.thumb.jpeg.d8c8c9fab617acffd2f76084c42dac83.jpeg

    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

    image.thumb.jpeg.215b982777aa1ab6e4386d120167230f.jpeg

    3. Using a metric has the same problem

    image.thumb.jpeg.3c4784f16a7dd6d749fcff71bdf392cd.jpeg

    4. I can use "within()" to create a signal that only has temperature during good quality

    image.thumb.jpeg.725c82ecd8bd1171364f43521c11269a.jpeg

    5. I can then use a metric to calculate the average for good condition

    image.thumb.jpeg.1a6dfa1d7beb8dd158389191fbf94792.jpeg

    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

    image.thumb.jpeg.feb4e1532dd7cade2040b1fdc0a8b972.jpeg

    *********

    Does anyone know how this can be done in Seeq?

    image.jpeg

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

    image.jpeg.b2cf5bf65ca2501250d1a66263e5e84a.jpeg

    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?

     

     

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

    seeq_formulaidnotfound_2022-11-27 at 1.31.44 PM.jpg

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

  10. I have DataLab code that generates a plot:

    image.thumb.jpeg.b00a26329452311c2861d1bc08a0fd8b.jpeg

    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:

    image.thumb.jpeg.c69dc10943b6c9d17c2b861a594caa1f.jpeg

    Is there a way to do this, or do I have to export an image from DataLab and then manually import it into Organizer?

  11. I am having trouble removing signals from DataLab.  I tried this, and it looks like it set all signals to ARCHIVE:

    image.thumb.jpeg.e2d6dafb83b2c71cce9d69add5322682.jpeg

    Notice the ID 18B29A83-783F-475D-B2BB-7ACF2BFB8362 for QCS_BasisWeight_RampCond says it is Archived:

    image.thumb.jpeg.6a20e05c314374b4875affb81d97cf69.jpeg

    However, in WorkBench the same ID shows it is not archived:

    image.thumb.jpeg.012210dfae3187f9c1049f1bd9208c63.jpeg

    How can I use DataLab to remove/delete/archive signals?

×
×
  • Create New...