Jump to content

Krista Novstrup

Seeq Team
  • Content Count

  • Joined

  • Last visited

  • Days Won

  • Points

    106 [ Donate ]

Krista Novstrup last won the day on May 19

Krista Novstrup had the most liked content!

Community Reputation

6 Neutral

1 Follower

Personal Information

  • Company
  • Title
    Principal Analytics Engineer
  • Level of Seeq User
    Seeq Super-User

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Question: How do I normalize a signal in Seeq? Sometimes it can be helpful to view data on a normalized scale or used normalized inputs in a model. Solution: This solution is posted using R22.0.47 but is applicable to earlier versions. Slight modifications of the formula may be required for earlier versions. 1. Let's start by loading our signal... 2. Next we'll use Formula to create a normalized signal. In Formula we do the following steps Define the time period over which we will do the normalization Calculate the min and max values which occur during that time period Calculate the delta between the min and max Finally, calculate the normalized signal Here is the code snippet if you'd like to copy and paste... $timePeriod = capsule('2019-01-01T00:00-05:00', '2020-01-01T00:00-05:00') $max = $signal.maxValue($timePeriod) $min = $signal.minValue($timePeriod) $delta = $max - $min ($signal - $min) / $delta 3. View the results in Seeq. Note that I optionally created scalar boundaries at 0 and 1 to highlight the normalization of my signal...
  2. This Use Case became simpler in R21.0.41 with the addition of the now() function in formula. You no longer need to do the first two steps of defining a search window for now and then using a signal to identify the last measured time stamp. Instead you just need to use the now() function to define the capsules and create your condition... //Create conditions representing the last 7, 14, and 365 days $Last7DayCapsule = capsule($now()-7d, $now()).setProperty("Time","Last 7d") $Last14DayCapsule = capsule($now()-14d, $now()).setProperty("Time","Last 14d") $Last365DayCapsule = capsule($now()-365d, $now()).setProperty("Time","Last 365d") condition(370d,$Last7DayCapsule,$Last14DayCapsule,$Last365DayCapsule)
  3. Seeq Version: R21.0.43.03 but the solution is applicable to previous versions as well. The Profile Search Tool is great for specifying a profile in Signal A and then looking for occurrences of that profile throughout time. In the screenshot below I've used Profile Search to identify when the Compressor Power Area A resembles the shape of a chair. For basics about how to use the tool check out the Seeq KB article Profile Search. However, what if I want to look for that same profile on another signal? In the screenshot below, I've added a second signal, Compressor Power Area G. I'd like to identify when the "chair" profile I previously specified for Compressor Power Area A is present in Compressor Power Area G. I can do this by using the profileSearch() function in Seeq Formula. Here is how... 1. Start with the Chair in Area A condition I previously made and use Duplicate to Formula. The duplicated formula looks like (note that $cpA refers to Compressor Power Area A): profileSearch($cpA, toTime("2019-09-02T15:43:30.135Z"), toTime("2019-09-03T06:28:09.629Z"), 98, 0.5, 0.3, 0.3) 2. Modify the formula to add $cpG (Compressor Power Area G) to the start of the function. This is an optional argument in Profile Search which allows us to use the profile identified on signal $cpA and look for when it occurs on signal $cpG. For more information on the Profile Search function, check out the documentation available in the Formula Tool. $cpG.profileSearch($cpA, toTime("2019-09-02T15:43:30.135Z"), toTime("2019-09-03T06:28:09.629Z"), 98, 0.5, 0.3, 0.3) Here is a screenshot of what it looks like in the Formula Tool: 3. View the final result. In this example two "chairs" where identified in Area G.
  4. In the course of building an analysis and experimenting you may create multiple signals and conditions you don't need. Clicking the 'x' in the Details pane will only remove them from the list but not from Seeq. As a result, when you go to create a new signal/condition and give it the same name you'll see the message 'An item with this name already exists.' This inevitably leads to the following two questions... How do I find the item? All signals and conditions can be searched for from the Data tab. Here are a few helpful hints to remember... Make sure to hit the Reset button to clear all filters and make sure you are searching from the top level and not within an asset tree. With the help of regex you can return only exact matches.... /^TAG NAME$/ For more information check out the Seeq Knowledge Base article Basic Searching and Filtering. How do I delete the item? One you find the item, add it to the Display. You can then select Item Properties and the red trash can. For more information on Item Trash check out the Seeq Knowledge Base article Item Trash.
  5. Jitesh, Seeq offers a number of functions for cleansing data before it is used in a regression model. This can be an important step because bad data has a negative impact on regression quality as you are observing. Without seeing the raw data it's hard for me to assume what type of cleansing is most appropriate. There are a couple posts already on Seeq.org you might find interesting: Delaying or Shifting the Time of a Signal - This helps if the various meters are located at different points in the process Signal Smoothing - This gives an example of the removeOutliers function To see a full list of Signal Cleansing options checkout the Formula documentation in Seeq by selecting Signal Cleansing as seen in the screenshot below. In addition, my screenshot shows an example of agileFilter(). This is one of my go-to functions for smoothing data before subsequent use in other analysis. If you feel comfortable sharing what your raw data looks like (either a description or screenshot), then I can give you more specific advice. Cheers, Krista
  6. One limitation to the method mentioned above is if one of the signals doesn't have any values, then no answer is returned. If you still want the value even if one signal is missing than you can try the alternative formula described below. This method works for versions prior to R21.0.40.05. Here is the formula for 2 signals as shown above: $signal1.zipWith($signal2, ($s1, $s2) -> max($s1.getValue(), $s2.getValue())) If you have more than 2 signals, then add additional zipWith() statements: $signal1.zipWith($signal2, ($s1, $s2) -> max($s1.getValue(), $s2.getValue())) .zipWith($signal3, ($s1, $s3) -> max($s1.getValue(), $s3.getValue())) .zipWith($signal4, ($s1, $s4) -> max($s1.getValue(), $s4.getValue()))
  7. Alternative Solution If you already have conditions with capsules that start (or end) at the peak max then you can use a Composite Condition followed by Signal from Condition. Here is how... 1. Use Composite Condition to join the two capsules. In this example the capsules start at the peak max so the join will be inclusive of A but not inclusive of B. 2. Use Signal from Condition to calculate the duration of the Peak-to-Peak capsules.
  8. Use Case Background Batch operations may be characterized by two conditions. The first condition represents the start of the batch and the second condition contains the end of the batch. Each capsule has the batch ID as a capsule property. The goal is to make a single condition that represents the duration of the batch by joining the start and end conditions. Solution 1 - Simple Join If the batches are orderly and the end of one batch does not overlap with the start of the next batch, then using the Join logic in the Composite Condition tool is the easiest option. However, if the end of one batch overlaps with the start of another, then some batches may not be joined. In the screenshot below the third batch on June 6 is not joined. Solution 2 - Use Formula to join based on matching the batch ID capsule property By using a transform in Formula all the batches in this scenario can be joined. In addition the batch ID property is assigned to the new capsules. Here is the Formula used to do this... Variables Name Item Type $startCond Start Condition Condition $endCond End Condition Condition Formula //Define the max time into the future to look for the end capsule $lookAheadTime = 2d //Resize the starting capsule to extend for the druation of the look ahead time $startCond.move(0s,$lookAheadTime) //Use a transfrom to take each start capsule and look for a matching end capsule and join by making a new capsule .transform( $startCap -> capsule($startCap.getStart(), //Get the start key for the capsule //Filter the end condition based on BatchID //Find the specific capsule by in the filtered condition using toGroup($startCap).first() //We can look for the first capsule because we only expect to find one capsule in the condition //Get the end key for the capsule using .getEnd() $endCond.filter($endCap -> $endCap.getProperty('BatchID') == $startCap.getProperty('BatchID')).toGroup($startCap).first().getEnd()) //Assign the property of the starting capsule to the new capsule .setProperty('BatchID', $startCap.getProperty('BatchID')) , $lookAheadTime)
  • Create New...