All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.shijingsh.ai.evaluate.AbstractEvaluator Maven / Gradle / Ivy

The newest version!
package com.shijingsh.ai.evaluate;

import com.shijingsh.core.utility.Integer2FloatKeyValue;

/**
 * 抽象评估器
 *
 * @author Birdy
 *
 */
public abstract class AbstractEvaluator implements Evaluator {

    /**
     * 统计
     *
     * @param collection
     * @param list
     * @return
     */
    protected abstract int count(L collection, R list);

    /**
     * 测量
     *
     * @param collection
     * @param list
     * @return
     */
    protected abstract float measure(L collection, R list);

    @Override
    public final Integer2FloatKeyValue evaluate(L collection, R list) {
        return new Integer2FloatKeyValue(count(collection, list), measure(collection, list));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy