Model trained by {@link FPGrowth}, which holds frequent itemsets.
@param freqItemsets frequent itemset, which is an RDD of {@link FreqItemset}
@classdesc
 
@param {module:eclairjs.RDD} freqItemsets
@class
@memberof module:eclairjs/mllib/fpm
971633
function(freqItemsets) {
        this.logger = Logger.getLogger("FPGrowthModel_js");
        var jvmObject;
        if (freqItemsets instanceof org.apache.spark.mllib.fpm.FPGrowthModel) {
            jvmObject = freqItemsets
        } else {
            jvmObject = new org.apache.spark.mllib.fpm.FPGrowthModel(freqItemsets);
        }

         JavaWrapper.call(this, jvmObject);

    }
28182
public static FlatDataCollection mode(FlatDataCollection flatDataCollection) {
        AssociativeArray frequencies = frequencies(flatDataCollection);
        
        int maxCounter=0;
        
        FlatDataList modeList = new FlatDataList();
        
        for(Map.Entry<Object, Object> entry : frequencies.entrySet()) {
            Object key = entry.getKey();
            int count = ((Number)entry.getValue()).intValue();
            if(maxCounter==count) {
                modeList.add(key);
            }
            else if(maxCounter<count) {
                maxCounter=count;
                modeList.clear();
                modeList.add(key);
            }
        }
        
        return modeList.toFlatDataCollection();
    }
720603
public static DataQualityAnalysis analyzeQualitySequence(Schema schema, JavaRDD<List<List<Writable>>> data) {
        JavaRDD<List<Writable>> fmSeq = data.flatMap(new SequenceFlatMapFunction());
        return analyzeQuality(schema, fmSeq);
    }
117778
public TreeSet<TermFrequency> values()
    {
        TreeSet<TermFrequency> set = new TreeSet<TermFrequency>(Collections.reverseOrder());

        for (Map.Entry<String, TermFrequency> entry : entrySet())
        {
            set.add(entry.getValue());
        }

        return set;
    }
871266
public static RecurrenceIterator createRecurrenceIterator(Collection<? extends DateValue> dates) {
		DateValue[] datesArray = dates.toArray(new DateValue[0]);
		return new RDateIteratorImpl(datesArray);
	}
17653
public void toFrequencyFile(String filePath) throws IOException {
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
                new FileOutputStream(filePath), "UTF-8"));
        for (TrieNodeCnt child : root.children.values()) {
            child.writeFrequencies(writer, new char[0]);// recursive
        }
        writer.close();
    }
642001
public void setScheduledInstanceSet(java.util.Collection<ScheduledInstance> scheduledInstanceSet) {
        if (scheduledInstanceSet == null) {
            this.scheduledInstanceSet = null;
            return;
        }

        this.scheduledInstanceSet = new com.amazonaws.internal.SdkInternalList<ScheduledInstance>(scheduledInstanceSet);
    }
909165
function(sequence, n, startSymbol, endSymbol, stats) {
    var result = [];
    frequencies = {};
    nrOfNgrams = 0;
    
    if (!_(sequence).isArray()) {
        sequence = tokenizer.tokenize(sequence);
    }

    var count = _.max([0, sequence.length - n + 1]);

    // Check for left padding    
    if(typeof startSymbol !== "undefined" && startSymbol !== null) {
        // Create an array of (n) start symbols
        var blanks = [];
        for(var i = 0 ; i < n ; i++) {
            blanks.push(startSymbol);
        }

        // Create the left padding
        for(var p = n - 1 ; p > 0 ; p--) {
            // Create a tuple of (p) start symbols and (n - p) words
          var ngram = blanks.slice(0, p).concat(sequence.slice(0, n - p));
          result.push(ngram);
          if (stats) {
            countNgrams(ngram);
          }
        }
    }

    // Build the complete ngrams
    for (var i = 0; i < count; i++) {
        var ngram = sequence.slice(i, i + n);
        result.push(ngram);
        if (stats) { 
          countNgrams(ngram);
        }
    }

    // Check for right padding
    if(typeof endSymbol !== "undefined" && endSymbol !== null) {
        // Create an array of (n) end symbols
        var blanks = [];
        for(var i = 0 ; i < n ; i++) {
            blanks.push(endSymbol);
        }

        // create the right padding
        for(var p = n - 1 ; p > 0 ; p--) {
            // Create a tuple of (p) start symbols and (n - p) words
          var ngram = sequence.slice(sequence.length - p, sequence.length).concat(blanks.slice(0, n - p));
          result.push(ngram);
          if (stats) {
            countNgrams(ngram);
          }
        }
    }
    
    if (stats) {
      
      // Count frequencies
      var Nr = {};
      Object.keys(frequencies).forEach(function(key) {
        if (!Nr[frequencies[key]]) {
          Nr[frequencies[key]] = 0;
        }
        Nr[frequencies[key]]++;
      });
      
      // Return the ngrams AND statistics
      return {
        "ngrams": result,
        "frequencies": frequencies,
        "Nr": Nr,
        "numberOfNgrams": nrOfNgrams
      };
      
    }
    else { // Do not break existing API of this module 
      return result;
    }
}
143513
private int[] buildIndex(final int[] counts, int[] positions, int minsupp) {
    // Count the number of frequent items:
    int numfreq = 0;
    for(int i = 0; i < counts.length; i++) {
      if(counts[i] >= minsupp) {
        ++numfreq;
      }
    }
    // Build the index table
    int[] idx = new int[numfreq];
    for(int i = 0, j = 0; i < counts.length; i++) {
      if(counts[i] >= minsupp) {
        idx[j++] = i;
      }
    }
    IntegerArrayQuickSort.sort(idx, (x, y) -> Integer.compare(counts[y], counts[x]));
    Arrays.fill(positions, -1);
    for(int i = 0; i < idx.length; i++) {
      positions[idx[i]] = i;
    }
    return idx;
  }
1266687
public void setSqlInjectionMatchSets(java.util.Collection<SqlInjectionMatchSetSummary> sqlInjectionMatchSets) {
        if (sqlInjectionMatchSets == null) {
            this.sqlInjectionMatchSets = null;
            return;
        }

        this.sqlInjectionMatchSets = new java.util.ArrayList<SqlInjectionMatchSetSummary>(sqlInjectionMatchSets);
    }
1178441
private List iterateAndReturn(ResultSet rSet, EntityMetadata metadata) {
        MetamodelImpl metaModel =
            (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
        EntityType entityType = metaModel.entity(metadata.getEntityClazz());

        Iterator<Row> rowIter = rSet.iterator();
        List results = new ArrayList();

        Map<String, Object> relationalValues = new HashMap<String, Object>();

        while (rowIter.hasNext()) {
            Object entity = null;
            Row row = rowIter.next();
            populateObjectFromRow(metadata, metaModel, entityType, results, relationalValues, entity, row);
        }
        return results;
    }
1175732
public JavaDoubleRDD scoreExamples(JavaRDD<DataSet> data, boolean includeRegularizationTerms) {
        return scoreExamplesMultiDataSet(data.map(new DataSetToMultiDataSetFn()), includeRegularizationTerms);
    }
1292573
private long getFrequentItemsets(PrintStream out, List<ItemSet> list) {
        long n = 0;
        if (root.children != null) {
            for (int i = 0; i < root.children.length; i++) {
                Node child = root.children[i];
                if (child != null && child.support >= minSupport) {
                    int[] itemset = {child.id};
                    n += getFrequentItemsets(out, list, itemset, i, child);
                }
            }
        }
        
        return n;
    }
1243753
public void add(int[] itemset) {
        numTransactions++;
        
        int m = 0;
        int t = itemset.length;
        int[] o = new int[t];
        for (int i = 0; i < t; i++) {
            int item = itemset[i];
            o[i] = order[item];
            if (itemSupport[item] >= minSupport) {
                m++;
            }
        }

        if (m > 0) {
            // Order all items in itemset in frequency descending order
            // Note that some items may have same frequency. We have to make
            // sure that items are in the same order of header table.
            QuickSort.sort(o, itemset, t);
            
            // Note that itemset may contain duplicated items. We should keep
            // only one in case of getting incorrect support value.
            for (int i = 1; i < m; i++) {
                if (itemset[i] == itemset[i-1]) {
                    m--;
                    for (int j = i; j < m; j++) {
                        itemset[j] = itemset[j+1];
                    }
                }
            }
            
            root.add(0, m, itemset, 1);
        }
    }
451668
def freq_from_iterators(cls, iterators):
        
        return {
            set(it): f for f, it in cls.FREQUENCIES.items()}[set(iterators)]
1349892
private void createSequences(Collection<Sequence> sequences, SchemaDescriptor schemaDescriptor, Store store) {
        for (Sequence sequence : sequences) {
            SequenceDesriptor sequenceDesriptor = store.create(SequenceDesriptor.class);
            sequenceDesriptor.setName(sequence.getName());
            sequenceDesriptor.setIncrement(sequence.getIncrement());
            sequenceDesriptor.setMinimumValue(sequence.getMinimumValue().longValue());
            sequenceDesriptor.setMaximumValue(sequence.getMaximumValue().longValue());
            sequenceDesriptor.setCycle(sequence.isCycle());
            schemaDescriptor.getSequences().add(sequenceDesriptor);
        }
    }
793932
function() {
        var jvmObject;
        this.logger = Logger.getLogger("PrefixSpanModelFreqSequence_js");
        if(arguments[0] instanceof org.apache.spark.mllib.fpm.PrefixSpan.FreqSequence) {
            jvmObject = arguments[0];
        } else {
            jvmObject = new org.apache.spark.mllib.fpm.PrefixSpan.FreqSequence(Utils.unwrapObject(arguments[0]), arguments[1]);
        }


        JavaWrapper.call(this, jvmObject);

    }