A program to recognize and reward our most engaged community members
while (candidateIterator.hasNext()) { Transaction currentTransaction = candidateIterator.next(); TransactionSet currentSet = data.findTransaction(currentTransaction, t, countingInformations); if (currentSet != null) { double difference = currentSet.getEndTime() - t; if (matches.isEmpty() || difference < countingInformations.maxGap && difference > 0) { // matches // is // empty // as // indicator // for // first // run! // no // previous // to // check matchesIterator.add(currentSet); t = currentSet.getEndTime(); } else { t = currentSet.getEndTime(); break; }
min gapThis parameter specifies the minimal gap. The min gap parameter causes a customers sequence not to support a pattern, if the transactions containing this pattern are too near in time. Range: real
Min gap should exclude the transactions from patterns if they are close to each other.
<?xml version="1.0" encoding="UTF-8" standalone="no"?><process version="6.5.002"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="6.5.002" expanded="true" name="Process"> <process expanded="true"> <operator activated="true" class="read_csv" compatibility="6.5.002" expanded="true" height="60" name="Read CSV" width="90" x="45" y="75"> <parameter key="csv_file" value="/home/cjfpainter/blox.csv"/> <parameter key="column_separators" value="\s"/> <parameter key="first_row_as_names" value="false"/> <list key="annotations"> <parameter key="0" value="Name"/> </list> <parameter key="encoding" value="UTF-8"/> <list key="data_set_meta_data_information"> <parameter key="0" value="Customer.true.polynominal.attribute"/> <parameter key="1" value="att2.true.attribute_value.attribute"/> <parameter key="2" value="att3.true.attribute_value.attribute"/> <parameter key="3" value="Time.true.integer.attribute"/> <parameter key="4" value="att5.true.attribute_value.attribute"/> <parameter key="5" value="att6.true.attribute_value.attribute"/> <parameter key="6" value="Product.true.polynominal.attribute"/> </list> </operator> <operator activated="true" class="remove_useless_attributes" compatibility="6.5.002" expanded="true" height="76" name="Remove Useless Attributes" width="90" x="246" y="75"/> <operator activated="true" class="nominal_to_binominal" compatibility="6.5.002" expanded="true" height="94" name="Nominal2Binominal" width="90" x="447" y="30"> <parameter key="attribute_filter_type" value="single"/> <parameter key="attribute" value="Product"/> <parameter key="attributes" value="|a1|a2|a3|a4"/> <parameter key="include_special_attributes" value="true"/> <parameter key="transform_binominal" value="true"/> </operator> <operator activated="true" class="generalized_sequential_patterns" compatibility="6.5.002" expanded="true" height="76" name="GSP" width="90" x="380" y="165"> <parameter key="customer_id" value="Customer"/> <parameter key="time_attribute" value="Time"/> <parameter key="min_support" value="0.5"/> <parameter key="window_size" value="0.0"/> <parameter key="max_gap" value="15.0"/> <parameter key="min_gap" value="1000.0"/> <parameter key="positive_value" value="true"/> </operator> <connect from_op="Read CSV" from_port="output" to_op="Remove Useless Attributes" to_port="example set input"/> <connect from_op="Remove Useless Attributes" from_port="example set output" to_op="Nominal2Binominal" to_port="example set input"/> <connect from_op="Nominal2Binominal" from_port="example set output" to_op="GSP" to_port="example set"/> <connect from_op="GSP" from_port="example set" to_port="result 1"/> <connect from_op="GSP" from_port="patterns" to_port="result 2"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> <portSpacing port="sink_result 3" spacing="0"/> </process> </operator></process>