Java Code Examples for it.unimi.dsi.fastutil.ints.Int2FloatMap#int2FloatEntrySet()

The following examples show how to use it.unimi.dsi.fastutil.ints.Int2FloatMap#int2FloatEntrySet() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogarithmTermFrequencyTestCase.java    From jstarcraft-ai with Apache License 2.0 5 votes vote down vote up
@Override
protected Int2FloatMap calculateTermFrequency(Int2FloatMap keyValues) {
    for (Int2FloatMap.Entry term : keyValues.int2FloatEntrySet()) {
        term.setValue((float) FastMath.log(1F + term.getFloatValue()));
    }
    return keyValues;
}
 
Example 2
Source File: BinaryTermFrequencyTestCase.java    From jstarcraft-ai with Apache License 2.0 5 votes vote down vote up
@Override
protected Int2FloatMap calculateTermFrequency(Int2FloatMap keyValues) {
    for (Int2FloatMap.Entry term : keyValues.int2FloatEntrySet()) {
        term.setValue(1F);
    }
    return keyValues;
}
 
Example 3
Source File: MaximumInverseDocumentFrequencyTestCase.java    From jstarcraft-ai with Apache License 2.0 5 votes vote down vote up
@Override
protected Int2FloatMap calculateInverseDocumentFrequency(Int2FloatMap keyValues) {
    for (Int2FloatMap.Entry term : keyValues.int2FloatEntrySet()) {
        term.setValue((float) FastMath.log(2F / (1F + term.getFloatValue())));
    }
    return keyValues;
}
 
Example 4
Source File: SmoothInverseDocumentFrequencyTestCase.java    From jstarcraft-ai with Apache License 2.0 5 votes vote down vote up
@Override
protected Int2FloatMap calculateInverseDocumentFrequency(Int2FloatMap keyValues) {
    for (Int2FloatMap.Entry term : keyValues.int2FloatEntrySet()) {
        term.setValue((float) FastMath.log(1F + 2F / term.getFloatValue()));
    }
    return keyValues;
}
 
Example 5
Source File: UnaryInverseDocumentFrequencyTestCase.java    From jstarcraft-ai with Apache License 2.0 5 votes vote down vote up
@Override
protected Int2FloatMap calculateInverseDocumentFrequency(Int2FloatMap keyValues) {
    for (Int2FloatMap.Entry term : keyValues.int2FloatEntrySet()) {
        term.setValue(1F);
    }
    return keyValues;
}
 
Example 6
Source File: NaturalInverseDocumentFrequencyTestCase.java    From jstarcraft-ai with Apache License 2.0 5 votes vote down vote up
@Override
protected Int2FloatMap calculateInverseDocumentFrequency(Int2FloatMap keyValues) {
    for (Int2FloatMap.Entry term : keyValues.int2FloatEntrySet()) {
        term.setValue((float) FastMath.log(2F / term.getFloatValue()));
    }
    return keyValues;
}
 
Example 7
Source File: ProbabilisticInverseDocumentFrequencyTestCase.java    From jstarcraft-ai with Apache License 2.0 5 votes vote down vote up
@Override
protected Int2FloatMap calculateInverseDocumentFrequency(Int2FloatMap keyValues) {
    for (Int2FloatMap.Entry term : keyValues.int2FloatEntrySet()) {
        term.setValue((float) FastMath.log((2F - term.getFloatValue()) / term.getFloatValue()));
    }
    return keyValues;
}
 
Example 8
Source File: Fastutil.java    From incubator-hivemall with Apache License 2.0 5 votes vote down vote up
@Nonnull
public static ObjectIterable<Int2FloatMap.Entry> fastIterable(@Nonnull final Int2FloatMap map) {
    final ObjectSet<Int2FloatMap.Entry> entries = map.int2FloatEntrySet();
    return entries instanceof Int2FloatMap.FastEntrySet
            ? new ObjectIterable<Int2FloatMap.Entry>() {
                public ObjectIterator<Int2FloatMap.Entry> iterator() {
                    return ((Int2FloatMap.FastEntrySet) entries).fastIterator();
                }
            }
            : entries;
}