bigml-nodered
Version:
BigML bindings for Nodered
441 lines (397 loc) • 17.4 kB
HTML
<style>
.bigml_node_label { fill: white; }
#palette-BigML .palette_node { color: white; }
#red-ui-palette-BigML .red-ui-palette-label { color: white; }
</style>
<script type="text/javascript">
RED.nodes.registerType('ensemble', {
category: 'BigML',
color: '#454957',
defaults: {"objective_field":{"value":""},"weight_field":{"value":""},"range":{"value":0},"random_candidates":{"value":0},"boosting":{"value":""},"random_candidate_ratio":{"value":0},"replacement":{"value":false},"tags":{"value":""},"ordering":{"value":0},"optimize":{"value":false},"name":{"value":"ensemble","required":true},"reify":{"value":false},"seed":{"value":""},"randomize":{"value":false},"excluded_fields":{"value":""},"missing_splits":{"value":false},"balance_objective":{"value":false},"stat_pruning":{"value":true},"fields":{"value":""},"split_candidates":{"value":32},"depth_threshold":{"value":512},"category":{"value":0},"webhook":{"value":""},"number_of_models":{"value":10},"node_threshold":{"value":512},"max_training_time":{"value":1800},"model_candidates":{"value":128},"objective_weights":{"value":""},"out_of_bag":{"value":false},"description":{"value":""},"sample_rate":{"value":1.0},"support_threshold":{"value":0},"input_fields":{"value":""}},
inputs:1,
outputs:1,
inputLabels: 'dataset',
outputLabels: 'ensemble',
icon: 'icon_ensemble.png',
label: function() {
return this.name || 'Ensemble';
},
labelStyle: function() {
return this.name?"bigml_node_label":"";
},
});
</script>
<script type="text/x-red" data-template-name="ensemble">
<div class="form-row">
<label for="node-input-name">
<i class="icon-tag"></i> Name
</label>
<input type=text id=node-input-name value='ensemble'>
</div>
<div class="form-row">
<label for="node-input-description">
<i class="icon-tag"></i> Description
</label>
<input type=text id=node-input-description >
</div>
<div class="form-row">
<label for="node-input-balance_objective">
<i class="icon-tag"></i> Balance objective
</label>
<input type=checkbox id=node-input-balance_objective value='false'>
</div>
<div class="form-row">
<label for="node-input-boosting">
<i class="icon-tag"></i> Boosting
</label>
<input type=text id=node-input-boosting placeholder='{ "iterations": 5, "learning_rate": 0.75 }' >
</div>
<div class="form-row">
<label for="node-input-depth_threshold">
<i class="icon-tag"></i> Depth threshold
</label>
<input type=number id=node-input-depth_threshold value='512'>
</div>
<div class="form-row">
<label for="node-input-excluded_fields">
<i class="icon-tag"></i> Excluded fields
</label>
<input type=text id=node-input-excluded_fields placeholder='["000000", "000002"]' >
</div>
<div class="form-row">
<label for="node-input-fields">
<i class="icon-tag"></i> Fields
</label>
<input type=text id=node-input-fields placeholder='{ "000000": { "name": "length_1", "label": "Length 1", "description": "Length 1 is sepal length"}, "000002": {"name": "length_2"}}' >
</div>
<div class="form-row">
<label for="node-input-input_fields">
<i class="icon-tag"></i> Input fields
</label>
<input type=text id=node-input-input_fields placeholder='["000000", "000003"]' >
</div>
<div class="form-row">
<label for="node-input-max_training_time">
<i class="icon-tag"></i> Max training time
</label>
<input type=number id=node-input-max_training_time value='1800'>
</div>
<div class="form-row">
<label for="node-input-missing_splits">
<i class="icon-tag"></i> Missing splits
</label>
<input type=checkbox id=node-input-missing_splits value='false'>
</div>
<div class="form-row">
<label for="node-input-node_threshold">
<i class="icon-tag"></i> Node threshold
</label>
<input type=number id=node-input-node_threshold value='512'>
</div>
<div class="form-row">
<label for="node-input-model_candidates">
<i class="icon-tag"></i> Model candidates
</label>
<input type=number id=node-input-model_candidates value='128'>
</div>
<div class="form-row">
<label for="node-input-number_of_models">
<i class="icon-tag"></i> Number of models
</label>
<input type=number id=node-input-number_of_models value='10'>
</div>
<div class="form-row">
<label for="node-input-objective_field">
<i class="icon-tag"></i> Objective field
</label>
<input type=text id=node-input-objective_field placeholder='{"id": "000003"}' >
</div>
<div class="form-row">
<label for="node-input-objective_weights">
<i class="icon-tag"></i> Objective weights
</label>
<input type=text id=node-input-objective_weights placeholder='[["Iris-versicolor", 2], ["Iris-virginica", 1], ["Iris-setosa", 1]]]' >
</div>
<div class="form-row">
<label for="node-input-optimize">
<i class="icon-tag"></i> Optimize
</label>
<input type=checkbox id=node-input-optimize value='false'>
</div>
<div class="form-row">
<label for="node-input-ordering">
<i class="icon-tag"></i> Ordering
</label>
<select id=node-input-ordering value='0'><option value=0>Deterministic</option> <option value=1>Linear</option> <option value=2>Random</option></select>
</div>
<div class="form-row">
<label for="node-input-out_of_bag">
<i class="icon-tag"></i> Out of bag
</label>
<input type=checkbox id=node-input-out_of_bag value='false'>
</div>
<div class="form-row">
<label for="node-input-random_candidate_ratio">
<i class="icon-tag"></i> Random candidate ratio
</label>
<input type=number step=any id=node-input-random_candidate_ratio value='0'>
</div>
<div class="form-row">
<label for="node-input-random_candidates">
<i class="icon-tag"></i> Random candidates
</label>
<input type=number id=node-input-random_candidates value='0'>
</div>
<div class="form-row">
<label for="node-input-randomize">
<i class="icon-tag"></i> Randomize
</label>
<input type=checkbox id=node-input-randomize value='false'>
</div>
<div class="form-row">
<label for="node-input-range">
<i class="icon-tag"></i> Range
</label>
<input type=number id=node-input-range value='0'>
</div>
<div class="form-row">
<label for="node-input-replacement">
<i class="icon-tag"></i> Replacement
</label>
<input type=checkbox id=node-input-replacement value='false'>
</div>
<div class="form-row">
<label for="node-input-sample_rate">
<i class="icon-tag"></i> Sample rate
</label>
<input type=number step=any id=node-input-sample_rate value='1.0'>
</div>
<div class="form-row">
<label for="node-input-seed">
<i class="icon-tag"></i> Seed
</label>
<input type=text id=node-input-seed >
</div>
<div class="form-row">
<label for="node-input-split_candidates">
<i class="icon-tag"></i> Split candidates
</label>
<input type=number id=node-input-split_candidates value='32'>
</div>
<div class="form-row">
<label for="node-input-stat_pruning">
<i class="icon-tag"></i> Stat pruning
</label>
<input type=checkbox id=node-input-stat_pruning value='true'>
</div>
<div class="form-row">
<label for="node-input-support_threshold">
<i class="icon-tag"></i> Support threshold
</label>
<input type=number step=any id=node-input-support_threshold value='0'>
</div>
<div class="form-row">
<label for="node-input-weight_field">
<i class="icon-tag"></i> Weight field
</label>
<input type=text id=node-input-weight_field >
</div>
<div class="form-row">
<label for="node-input-tags">
<i class="icon-tag"></i> Tags
</label>
<input type=text id=node-input-tags placeholder='["A tag", "Another Tag"]' >
</div>
<div class="form-row">
<label for="node-input-category">
<i class="icon-tag"></i> Category
</label>
<select id=node-input-category value='0'><option value=5>5</option> <option value=Healthcare>Healthcare</option></select>
</div>
<div class="form-row">
<label for="node-input-webhook">
<i class="icon-tag"></i> Webhook
</label>
<input type=text id=node-input-webhook >
</div>
<div class="form-row">
<label for="node-input-reify">
<i class="icon-tag"></i> Reify
</label>
<input type=checkbox id=node-input-reify value='false'>
</div>
</script>
<script type="text/html" data-help-name="ensemble">
<p>Create BigML Ensemble.</p>
<h3>Details</h3>
<p>This node support all inputs defined in
<a href='https://bigml.com/api/ensembles' target=blank>BigML REST
API</a>. By default, it expects to receive
a <code>dataset</code> input (see below for more details) and
it will output the <code>ensemble</code> field of the created
resource.
</p>
<p>However, you can override default inputs and outputs by defining
the node port label so they match the desired input or output as
specified below.</p>
<p>Only when the node is used with the <code>reify</code> option
enabled, it will actually hit BigML and do its work there. This
generally means some resources will be created and sent through as
node outputs.</p>
<p>When the node is used with the <code>reify</code>option disabled,
it will generate WhizzML code and send it through to the next node
in the flow without hitting BigML. All WhizzML code created by this
node (and others) when not in <code>reify</code> mode is accumulated
and executed as a single WhizzML script by the first
downstream <code>reified</code> node.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>Name
<span class="property-type">:text</span>
</dt>
<dd>A name for this node.</dd>
<dt>Description
<span class="property-type">:text</span>
</dt>
<dd></dd>
<dt>Balance objective
<span class="property-type">:boolean</span>
</dt>
<dd>Whether to balance classes proportionally to their category counts or not.</dd>
<dt>Boosting
<span class="property-type">:text</span>
</dt>
<dd>Gradient boosting options for the ensemble. Required to created an ensemble with boosted trees.</dd>
<dt>Depth threshold
<span class="property-type">:number</span>
</dt>
<dd>When the depth in the tree exceeds this value, the tree stops growing. It has no effect if it's bigger than the node_threshold.</dd>
<dt>Excluded fields
<span class="property-type">:text</span>
</dt>
<dd>Specifies the fields that won't be included in the dataset.</dd>
<dt>Fields
<span class="property-type">:text</span>
</dt>
<dd>Updates the names, labels, and descriptions of the fields in the dataset.</dd>
<dt>Input fields
<span class="property-type">:text</span>
</dt>
<dd>Specifies the fields to be included in the dataset.</dd>
<dt>Max training time
<span class="property-type">:number</span>
</dt>
<dd>The maximum training time allowed for the optimization, in seconds, as a strictly positive integer. Applicable only when optimize is set to true.</dd>
<dt>Missing splits
<span class="property-type">:boolean</span>
</dt>
<dd>Defines whether to explicitly include missing field values when choosing a split.</dd>
<dt>Node threshold
<span class="property-type">:number</span>
</dt>
<dd>When the number of nodes in the tree exceeds this value, the tree stops growing.</dd>
<dt>Model candidates
<span class="property-type">:number</span>
</dt>
<dd>The number of model candidates evaluated over the course of the optimization. Applicable only when optimize is set to true. Maximum 200 candidates.</dd>
<dt>Number of models
<span class="property-type">:number</span>
</dt>
<dd>The number of models to build the ensemble.</dd>
<dt>Objective field
<span class="property-type">:text</span>
</dt>
<dd>Specifies the default objective field.</dd>
<dt>Objective weights
<span class="property-type">:text</span>
</dt>
<dd>A list of category and weight pairs. One per objective class.</dd>
<dt>Optimize
<span class="property-type">:boolean</span>
</dt>
<dd>Whether the model should be built with the automatic optimization.</dd>
<dt>Ordering
<span class="property-type">:select</span>
</dt>
<dd>Specifies the type of ordering followed to build the model.</dd>
<dt>Out of bag
<span class="property-type">:boolean</span>
</dt>
<dd>Setting this parameter to true will return a sequence of the out-of-bag instances instead of the sampled instances.</dd>
<dt>Random candidate ratio
<span class="property-type">:float</span>
</dt>
<dd>Setting this parameter to true will return a sequence of the out-of-bag instances instead of the sampled instances.</dd>
<dt>Random candidates
<span class="property-type">:number</span>
</dt>
<dd>Sets the number of random fields considered when randomize is true.</dd>
<dt>Randomize
<span class="property-type">:boolean</span>
</dt>
<dd>Setting this parameter to true will consider only a subset of the possible fields when choosing a split.</dd>
<dt>Range
<span class="property-type">:number</span>
</dt>
<dd>The range of successive instances to build the model.</dd>
<dt>Replacement
<span class="property-type">:boolean</span>
</dt>
<dd>Whether sampling should be performed with or without replacement.</dd>
<dt>Sample rate
<span class="property-type">:float</span>
</dt>
<dd>A real number between 0 and 1 specifying the sample rate.</dd>
<dt>Seed
<span class="property-type">:text</span>
</dt>
<dd>A string to be hashed to generate deterministic samples.</dd>
<dt>Split candidates
<span class="property-type">:number</span>
</dt>
<dd>The number of split points that are considered whenever the tree evaluates a numeric field.</dd>
<dt>Stat pruning
<span class="property-type">:boolean</span>
</dt>
<dd>Activates statistical pruning on your decision tree model.</dd>
<dt>Support threshold
<span class="property-type">:float</span>
</dt>
<dd>The parameter controls the minimum amount of support each child node must contain to be valid as a possible split.</dd>
<dt>Weight field
<span class="property-type">:text</span>
</dt>
<dd>Any numeric field with no negative or missing values is valid as a weight field. Each instance will be weighted individually according to the weight field's value.</dd>
<dt>Tags
<span class="property-type">:text</span>
</dt>
<dd>A list of tags to identify the resource.</dd>
<dt>Category
<span class="property-type">:select</span>
</dt>
<dd></dd>
<dt>Webhook
<span class="property-type">:text</span>
</dt>
<dd>A webhook url and an optional secret phrase.</dd>
<dt>Reify
<span class="property-type">:boolean</span>
</dt>
<dd>Execute the WhizzML code generated at this (and upstream) node(s). You need to enable this option if you want to get a result from your flow that you can pass to a non-BigML node.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<dl class="message-properties">
<dt>payload <span class="property-type">string or
JSON</span></dt>
<dd>the <code>ensemble</code> of the created
BigML entity.</dd>
<dt>whizzml <span class="property-type">string</dt>
<dd>(only for <code>reified</code> nodes) the
generated WhizzML code which is fed into the next
node.
<dt>wzStack <span class="property-type">object</dt>
<dd>(only for <code>reified</code> nodes) private.
</dl>
</ol>
</script>