bigml-nodered
Version:
BigML bindings for Nodered
391 lines (352 loc) • 15.2 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('association', {
category: 'BigML',
color: '#454957',
defaults: {"default_numeric_value":{"value":"none"},"range":{"value":0},"significance_level":{"value":0.05},"min_leverage":{"value":0},"replacement":{"value":false},"tags":{"value":""},"max_k":{"value":100},"name":{"value":"association","required":true},"search_strategy":{"value":null},"min_confidence":{"value":0.0},"rhs_predicate":{"value":""},"reify":{"value":false},"seed":{"value":""},"excluded_fields":{"value":""},"complement":{"value":false},"min_lift":{"value":1.0},"fields":{"value":""},"max_lhs":{"value":4},"field_discretizations":{"value":""},"min_support":{"value":1.0},"category":{"value":0},"missing_items":{"value":false},"discretization":{"value":""},"webhook":{"value":""},"out_of_bag":{"value":false},"description":{"value":""},"sample_rate":{"value":1.0},"input_fields":{"value":""}},
inputs:1,
outputs:1,
inputLabels: 'dataset',
outputLabels: 'association',
icon: 'icon_association.png',
label: function() {
return this.name || 'Association';
},
labelStyle: function() {
return this.name?"bigml_node_label":"";
},
});
</script>
<script type="text/x-red" data-template-name="association">
<div class="form-row">
<label for="node-input-name">
<i class="icon-tag"></i> Name
</label>
<input type=text id=node-input-name value='association'>
</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-complement">
<i class="icon-tag"></i> Complement
</label>
<input type=checkbox id=node-input-complement value='false'>
</div>
<div class="form-row">
<label for="node-input-default_numeric_value">
<i class="icon-tag"></i> Default numeric value
</label>
<select id=node-input-default_numeric_value value='none'><option value=none>None</option> <option value=mean>Mean</option> <option value=median>Median</option> <option value=minimum>Minimum</option> <option value=maximum>Maximum</option> <option value=zero>Zero</option></select>
</div>
<div class="form-row">
<label for="node-input-discretization">
<i class="icon-tag"></i> Discretization
</label>
<input type=text id=node-input-discretization >
</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-field_discretizations">
<i class="icon-tag"></i> Field discretizations
</label>
<input type=text id=node-input-field_discretizations >
</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_k">
<i class="icon-tag"></i> Max K
</label>
<input type=number id=node-input-max_k value='100'>
</div>
<div class="form-row">
<label for="node-input-max_lhs">
<i class="icon-tag"></i> Max LHS
</label>
<input type=number id=node-input-max_lhs value='4'>
</div>
<div class="form-row">
<label for="node-input-min_confidence">
<i class="icon-tag"></i> Min confidence
</label>
<input type=number step=any id=node-input-min_confidence value='0.0'>
</div>
<div class="form-row">
<label for="node-input-min_leverage">
<i class="icon-tag"></i> Min leverage
</label>
<input type=number step=any id=node-input-min_leverage value='0'>
</div>
<div class="form-row">
<label for="node-input-min_lift">
<i class="icon-tag"></i> Min lift
</label>
<input type=number step=any id=node-input-min_lift value='1.0'>
</div>
<div class="form-row">
<label for="node-input-min_support">
<i class="icon-tag"></i> Min support
</label>
<input type=number step=any id=node-input-min_support value='1.0'>
</div>
<div class="form-row">
<label for="node-input-missing_items">
<i class="icon-tag"></i> Missing items
</label>
<input type=checkbox id=node-input-missing_items value='false'>
</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-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-rhs_predicate">
<i class="icon-tag"></i> RHS predicate
</label>
<input type=text id=node-input-rhs_predicate placeholder='[{
"field": "petal width",
"operator": "in",
"value": [1.0, 2.0]
}, {
"field": "species"}]' >
</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-search_strategy">
<i class="icon-tag"></i> Search strategy
</label>
<select id=node-input-search_strategy ><option value=confidence>Confidence</option> <option value=lhs_cover>Lhs cover</option> <option value=leverage>Leverage</option> <option value=lift>Lift</option> <option value=support>Support</option></select>
</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-significance_level">
<i class="icon-tag"></i> Significance level
</label>
<input type=number step=any id=node-input-significance_level value='0.05'>
</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="association">
<p>Create BigML Association.</p>
<h3>Details</h3>
<p>This node support all inputs defined in
<a href='https://bigml.com/api/associations' 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>association</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>Complement
<span class="property-type">:boolean</span>
</dt>
<dd>If complement is true, complementary items are also taken into account.</dd>
<dt>Default numeric value
<span class="property-type">:select</span>
</dt>
<dd>Substitute missing numeric values across all the numeric fields in the dataset.</dd>
<dt>Discretization
<span class="property-type">:json</span>
</dt>
<dd>Global numeric field transformation parameters. See the discretization table below.</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>Field discretizations
<span class="property-type">:json</span>
</dt>
<dd>Per-field numeric field transformation parameters, taking precedence over discretization.</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 K
<span class="property-type">:number</span>
</dt>
<dd>The maximum number of associations to be discovered.</dd>
<dt>Max LHS
<span class="property-type">:number</span>
</dt>
<dd>The maximum number of items to be considered within the left-hand-side itemset.</dd>
<dt>Min confidence
<span class="property-type">:float</span>
</dt>
<dd>A real number between 0 and 1 specifying the minimum confidence for the rules discovered.</dd>
<dt>Min leverage
<span class="property-type">:float</span>
</dt>
<dd>A real number between -1 and 1 specifying the minimum leverage for the rules discovered.</dd>
<dt>Min lift
<span class="property-type">:float</span>
</dt>
<dd>A non-negative real number specifying the minimum lift for the rules discovered.</dd>
<dt>Min support
<span class="property-type">:float</span>
</dt>
<dd>A non-negative real number specifying the minimum support for the rules discovered, i.e., the number of instances matching both the left-hand and right-hand sides.</dd>
<dt>Missing items
<span class="property-type">:boolean</span>
</dt>
<dd>Whether to create items corresponding to missing field values.</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>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>RHS predicate
<span class="property-type">:json</span>
</dt>
<dd>Restriction for the search to rules with certain right-hand side values.</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>Search strategy
<span class="property-type">:select</span>
</dt>
<dd>The strategy for prioritizing the rules in the search.</dd>
<dt>Seed
<span class="property-type">:text</span>
</dt>
<dd>A string to be hashed to generate deterministic samples.</dd>
<dt>Significance level
<span class="property-type">:float</span>
</dt>
<dd>The significance level between 0 and 1 used for statistical significance of the results.</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>association</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>