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

io.gitlab.chaver.mining.patterns.measure.attribute.Mean Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
/*
 * This file is part of io.gitlab.chaver:data-mining (https://gitlab.com/chaver/data-mining)
 *
 * Copyright (c) 2022, IMT Atlantique
 *
 * Licensed under the MIT license.
 *
 * See LICENSE file in the project root for full license information.
 */
package io.gitlab.chaver.mining.patterns.measure.attribute;

import io.gitlab.chaver.mining.patterns.measure.Measure;
import io.gitlab.chaver.mining.patterns.measure.operand.MeasureOperand;

import java.util.Set;

import static io.gitlab.chaver.mining.patterns.measure.MeasureFactory.*;
import static io.gitlab.chaver.mining.patterns.measure.operand.OperandFactory.*;

public class Mean extends AttributeMeasure {

    private final MeasureOperand op = div(add(min(getNum()), max(getNum())), constant());

    public Mean(int num) {
        super(num);
    }

    @Override
    public Set maxConvert() {
        return op.maxConvert();
    }

    @Override
    public Set minConvert() {
        return op.minConvert();
    }

    @Override
    public String getId() {
        return "mean" + getNum();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy