Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/10/2021 in all areas

  1. While building an asset tree using spy.assets, the display items of a worksheet can be defined under @Asset.Display(). The list below shows the options that can be set for each parameter of the display pane: Color: str = any valid color hex for example #4055a3, #068c45, #9d248f. Line Style: str = {'Solid', 'Short Dash', 'Short Dash-Dot', 'Short Dash-Dot-Dot', 'Dot', 'Long Dash', 'Dash-Dot', 'Long Dash-Dot', 'Long Dash-Dot-Dot'} Line Width: float = {1, 1.5, 2, 2.5, ...9.5, 10} Lane: int = {1, 2, ...} Samples Display: str = {'Line', 'Line and Sample', 'Samples', 'Bars'} Axis Auto Scale: bool Axis Align: str = {'Left', 'Right'} Axis Group: str = {'A', 'B', ...} Axis Max: float Axis Min: float One example of display items set using @Asset.Display(): @Asset.Display() def Bar_Graph (self, metadata, analysis): worksheet = analysis.worksheet('BarGraph') workstep = worksheet.workstep('BarGraph') workstep.display_items = [{ "Item": self.Signal_1(), "Axis Group": "A", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Solid", "Line Width": 10, "Samples Display": "Bars", "Color": "#4055A3" }, { "Item": self.self.Signal_2(), "Axis Group": "B", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Short Dash", "Line Width": 1, "Samples Display": "Line", "Color": "#9D248F" }, { "Item": self.self.Signal_3(), "Axis Group": "B", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Solid", "Line Width": 1, "Samples Display": "Line and Sample", "Color": "#CE561B" }, { "Item": self.self.Signal_4(), "Axis Group": "C", "Axis Auto Scale": False, "Axis Align": "Right", "Axis Max": 100.5, "Axis Min": 10, "Lane": 1, "Line Style": "Solid", "Line Width": 1, "Samples Display": "Samples", "Color": "#00A2DD" }] workstep.display_range = {'Start': '2020-06-11T00:00:00', 'End': '2020-07-12T00:00:00'} workstep.view = 'Trend' return workstep
    1 point
  2. The following steps will create a prediction model for every capsule in a condition. Step 1. pick a condition with capsules that isolate the desired area of regression. Any condition with non-overlapping capsules will work as long as there are enough sample points within its duration. For this example, an increasing temperature condition will be used. However, periodic conditions and value search conditions will work as well. Step 2. Create a time counter for each capsule in the condition. This can be done with the new timesince() function in the formula tool. The timesince() function will have samples spaced depending on the selected period so it is important to select a period that has enough points to build a model with. See below for details on the timesince() formula setup. Step 3. In this step a condition with capsule properties that hold the regression constants will be made. This will be done in the formula tool with one formula. The concept behind the formula below is to split the condition from step one into individual capsules and use each of the capsules as the training window for a regression model. Once the regression model is done for one capsule the coefficients of the model are assigned as properties to the capsule used for the training window. The formula syntax for a linear model-based condition can be seen below. An example of a polynomial regression model can be found in the post below. $Condtition.removeLongerThan(24h).transform($cap-> { $model=$SignalToModel.validValues().regressionModelOLS( group($cap),false,$Time) $cap.setProperty('Slope',$model.get('coefficient1')) .setProperty('Intercept',$model.get('intercept'))}) Below is a screenshot of how the formula looks in Seeq. Note: The regression constants can be added to the capsule pane by clicking on the black stats button and selecting add column. Below is a screen shot of the results. Step 4. Once a condition with the regression coefficients has been created the information will need to be extracted to a signal form. The following formula syntax will extract the information. This will need to be repeated for every constant from your regression model. e.g.(So for a linear model this must be done for both the slope and for the intercept.) The formula syntax for extracting the regression coefficients can be seen below. $signal=$Condition.transformToSamples( $cap -> sample($cap.getmiddle(), $cap.getProperty('Intercept').toNumber()), 1min) $signal.aggregate(average(),$Condition,durationKey()) Below is a screenshot of the formula in Seeq. Below is a screenshot of the display window of how the signals should look. Step 5. Use the formula tool to plot the equation. See screenshot below for details. Final Result
    1 point
This leaderboard is set to Los Angeles/GMT-07:00
×
×
  • Create New...