Bases: object
Represents an expression that can be applied to Numpy arrays in Python and included in a PFA scoring engine.
Create a Transformation either from an ordered list of Python expressions or by keywords.
Although it’s possible to mix the ordered list method and the keyword method, doing so could be confusing.
Expressions loaded as positional arguments are given keyword names “_0”, “_1”, “_2”, etc., and all methods proceed as though they were loaded as keywords.
Parameters: |
|
---|
Construct a PFA expression for one of the expressions in this Transformation.
Parameters: |
|
---|---|
Return type: | Pythonized JSON |
Returns: | PFA “let” expression |
Find the symbols (variables) referenced in a PFA expression.
Parameters: | x (Pythonized JSON) – the PFA expression |
---|---|
Return type: | list of strings |
Returns: | all symbols found |
Interpret expression from a PFA abstract syntax tree or PrettyPFA string.
Parameters: | x (titus.datatype.Ast, PrettyPFA string) – input PFA |
---|---|
Return type: | Pythonized JSON |
Returns: | the PFA as Pythonized JSON |
Construct a PFA “let” expression for this transformation.
Parameters: |
|
---|---|
Return type: | Pythonized JSON |
Returns: | PFA “let” expression |
Construct a PFA “new” expression for this transformation.
Parameters: |
|
---|---|
Return type: | Pythonized JSON |
Returns: | PFA “new” expression |
Apply replacements to a PFA expression.
Parameters: |
|
---|---|
Return type: | Pythonized JSON |
Returns: | the PFA with replacements |
Convert a PFA abstract syntax tree into a Numpy expression.
Parameters: | ast (titus.pfaast.Ast) – the PFA to convert |
---|---|
Return type: | string |
Returns: | executable Python code in a string |
Return a transformed Numpy dataset (leaving the original intact).
Parameters: | dataset (Numpy record array, dict of 1-D Numpy arrays, or Numpy 2-d table) – input dataset to be transformed; the Numpy record names or dict keys must correspond to the keywords of the arguments used to construct this Transformation, or the column indexes of the 2-d table must correspond to the positions of the arguments used to construct this Transformation. |
---|---|
Return type: | same as dataset |
Returns: | transformed dataset (operations are not performed in-place) |