The Balance node corrects imbalances in a dataset, so it conforms to a specified condition. The balancing directive adjusts the proportion of records where a condition is true by the factor specified.
node = stream.create("balance", "My node") node.setPropertyValue("training_data_only", True) node.setPropertyValue("directives", [[1.3, "Age > 60"], [1.5, "Na > 0.5"]])
||Data type||Property description|
||Structured property to balance proportion of field values based on number specified (see example below).|
||flag||Specifies that only training data should be balanced. If no partition field is present in the stream, then this option is ignored.|
This node property uses the format:
[[ number, string ] \ [ number, string] \ ... [number, string ]].
" \ ". The
" \ "character is also the line continuation character, which you can use to align the arguments for clarity.