Logo name
Personal tools

Expression filter

From Piki

  • Currently0.00/5
Jump to: navigation, search

The expression filter adds new features to a data unit based on an algebraic expression.


Expression
Image:Expression filter icon.png
NameExpression
DeployableYes
StaticYes/No
Sample modifierNo
Feature modifierYes

Contents

Usage

The expression filter creates one or more new features from a set of algebraic expressions. Each expression is evaluated for each sample in the data unit. The expression filter can, among other things, be used to delay a feature, split a feature up or create compound features from other features.

An expression consists of numbers referenced features and operators.

Operators

The available operators are the following:

+, -, *, /, %, ^, <, >, >=, <=, !=, ==, &, |, <<, >>, 'int', 'sqrt'

Boolean expressions evaluate to 1 for True and 0 for False. The special numbers Pi, e and eps (epsilon) can also be used.

Referencing data

The source feature can be accessed through the letter ā€˜d’. Other features are accessed in one of three ways:

  • By name within brackets.
  • By relative position within curled brackets.
  • By absolute position (counted from one) preceded by @.

Internally the two last methods are converted to the first one automatically.

To reference other samples than the current use a ':' followed by + or - an offset. Not using + or - is treated as an absolute sample number.

'int' is used to cast to integers. (2.7)int -> 2 '>>' is used as much greater than, a >> b is true if a is 100 times greater than b

Examples

Task Expression
Divide the selected column by 2 d/2
Delay the selected column samples one step (t-1) {0:-1}
Advance the second column samples three steps (t+3) @2:+3
Divide the column Price and the column Area [Price]/[Area]
Set all values > 100 to 10 in the selected column. 10*(d>100)
Add the column Price1 and Price2 when Price3 equals 100. ([Price1] + [Price2]) * ([Price3] == 100])
Extract the second lowest digit of an integer number. (d/10)int%10
Calculate a hypotenuse using Pythagoras' theorem ( ([A)^2) + ([B]^2) )sqrt

Settings

The settings can be modified using the settings browser.


Expression filter settings


  • (Source)
  • Name: The source feature. The current sample of this feature can be accessed by the letter 'd'.
  • Missing values: The value that missing values are replaced with.


  • (New Expression)
  • Name: The name of the new features created by the expression.
  • Expression: The expression that is to be evaluated to create the new feature.
  • Add: Add the expression to the list of expressions.
  • Help: Displays a window with information on syntax and usage.


  • (Remove Expression)
  • Feature: A drop down list of expressions used for removal. Select the feature you want to remove and click Remove.
  • Remove: Remove the feature selected in the Feature drop down.


  • (Expression <*>)- A new category is created for each new expression added.
  • Column: The name of the feature created by the expression.
  • Expression: The expression used to create the new feature.


See also

This page was last modified 09:23, 26 November 2008.  This page has been accessed 2,629 times.  Disclaimers