attributes: Model Attributes

Description Usage Arguments Details Note Author(s) See Also Examples

Description

Attributes are specified using literal symbols.

Usage

1
2
3
inputs = c(...)
outputs = expr
inputs = AUTO

Arguments

...

A list expressions to be used as inputs for the current action. See expressions for more information.

expr

An expression in the same manner as above.

AUTO

A special keyword in the R-grokit system. It is interpreted differently in individual contexts; in general, it acts much like the SQL * construct for inputs.

Details

Model formulae for GLAs are specified in an atypical manner in the Grokit system. Rather than using the built-in formula operator, ~, formulae are specified using the combine function c whenever expressions are processed independently and concurrently by the GLA. For example, in the GLA Sum, operating on two columns at once produces the same result as if you had executed a separate GLA for each column.

Additionally, the call to c can be omitted for a single expression, e.g. inputs = c(att) and inputs = att are equivalent.

In general, inputs is the argument in the GLA that specifies which columns of the data that the GLA will operate on and outputs is list of names for the columns in the result.

AUTO is a reserved word in the Grokit system that is used to infer inputs or outputs. Although the exact interpretation depends on the GLA, inputs = AUTO typically selects all attributes in the relation and outputs = AUTO names the result in the same manner as read.csv, i.e. "V0", "V1", ...

For most actions that take inputs and outputs, there will be a section in the help describing precisely how AUTO behaves.

It should be note that these constructs are only valid in the specification of arguments to an appropiate GLA. See ‘Examples’ for more information.

Note

The expressions for inputs and outputs are never evaluated. Instead, they are parsed and the resulting abstract syntax tree is deconstructed.

Author(s)

Jon Claus, <jonterainsights@gmail.com>, Tera Insights LLC

See Also

expression for information on how to specify expressions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Proper specification of inputs and outputs
data <- Read(lineitem100g)
result <- Sum(data, inputs = c(l_discount, l_tax), outputs =
c(sum_discout, sum), force.frame = TRUE)
print(result)

## Usage of AUTO for both inputs and outputs
data <- Read(lineitem100g)
result <- Sum(data, force.frame = TRUE)
result

## Improper assignment
data <- Read(lineitem100g)
inputs <- c(l_discount, l_tax) ## error thrown here
result <- Sum(data, inputs = inputs, outputs = c(sum_discout, sum),
force.frame = TRUE)

tera-insights/gtBase documentation built on May 31, 2019, 8:35 a.m.