Stream properties

A variety of stream properties can be controlled by scripting. To reference stream properties, you must set the execution method to use scripts:

stream = modeler.script.stream()
stream.setPropertyValue("execute_method", "Script")

Example

The node property is used to refer to the nodes in the current stream. The following stream script provides an example:

stream = modeler.script.stream()
annotation = stream.getPropertyValue("annotation")

annotation = annotation + "\n\nThis stream is called \"" + stream.getLabel() + "\" and
 contains the following nodes:\n"

for node in stream.iterator():
    annotation = annotation + "\n" + node.getTypeName() + " node called \"" + node.getLabel()
 + "\""

stream.setPropertyValue("annotation", annotation)

The above example uses the node property to create a list of all nodes in the stream and write that list in the stream annotations. The annotation produced looks like this:

This stream is called "druglearn" and contains the following nodes:

type node called "Define Types"
derive node called "Na_to_K"
variablefile node called "DRUG1n"
neuralnetwork node called "Drug"
c50 node called "Drug"
filter node called "Discard Fields"

Stream properties are described in the following table.

Table 1. Stream properties
Property name Data type Property description
execute_method Normal Script  
date_format
"DDMMYY"
"MMDDYY"
"YYMMDD"
"YYYYMMDD"
"YYYYDDD"
DAY
MONTH
"DD-MM-YY"
"DD-MM-YYYY"
"MM-DD-YY"
"MM-DD-YYYY"
"DD-MON-YY"
"DD-MON-YYYY"
"YYYY-MM-DD"
"DD.MM.YY"
"DD.MM.YYYY"
"MM.DD.YYYY"
"DD.MON.YY"
"DD.MON.YYYY"
"DD/MM/YY"
"DD/MM/YYYY"
"MM/DD/YY"
"MM/DD/YYYY"
"DD/MON/YY"
"DD/MON/YYYY"
MON YYYY
q Q YYYY
ww WK YYYY
 
date_baseline number  
date_2digit_baseline number  
time_format
"HHMMSS"
"HHMM"
"MMSS"
"HH:MM:SS"
"HH:MM"
"MM:SS"
"(H)H:(M)M:(S)S"
"(H)H:(M)M"
"(M)M:(S)S"
"HH.MM.SS"
"HH.MM"
"MM.SS"
"(H)H.(M)M.(S)S"
"(H)H.(M)M"
"(M)M.(S)S"
 
time_rollover flag  
import_datetime_as_string flag  
decimal_places number  
decimal_symbol Default Period Comma  
angles_in_radians flag  
use_max_set_size flag  
max_set_size number  
ruleset_evaluation Voting FirstHit  
refresh_source_nodes flag Use to refresh source nodes automatically upon stream execution.
script string  
annotation string  
name string
Note: This property is read-only. If you want to change the name of a stream, you should save it with a different name.
parameters   Use this property to update stream parameters from within a stand- alone script.
nodes   See detailed information below.
encoding SystemDefault "UTF-8"  
stream_rewriting boolean  
stream_rewriting_maximise_sql boolean  
stream_rewriting_optimise_clem_
execution
boolean  
stream_rewriting_optimise_syntax_
execution
boolean  
enable_parallelism boolean  
sql_generation boolean  
database_caching boolean  
sql_logging boolean  
sql_generation_logging boolean  
sql_log_native boolean  
sql_log_prettyprint boolean  
record_count_suppress_input boolean  
record_count_feedback_interval integer  
use_stream_auto_create_node_
settings
boolean If true, then stream-specific settings are used, otherwise user preferences are used.
create_model_applier_for_new_
models
boolean If true, when a model builder creates a new model, and it has no active update links, a new model applier is added.
Note: If you are using IBM® SPSS® Modeler Batch version 15 you must explicitly add the model applier within your script.
create_model_applier_update_links
createEnabled
createDisabled
doNotCreate
Defines the type of link created when a model applier node is added automatically.
create_source_node_from_builders boolean If true, when a source builder creates a new source output, and it has no active update links, a new source node is added.
create_source_node_update_links
createEnabled
createDisabled
doNotCreate
Defines the type of link created when a source node is added automatically.
has_coordinate_system boolean If true, applies a coordinate system to the entire stream.
coordinate_system string The name of the selected projected coordinate system.
deployment_area
ModelRefresh
Scoring 
None
Choose how you want to deploy the stream. If this value is set to None, no other deployment entries are used.
scoring_terminal_node_id string Choose the scoring branch in the stream. It can be any terminal node in the stream.
scoring_node_id string Choose the nugget in the scoring branch.
model_build_node_id string Choose the modeling node in the stream.