com.insightml.data.features.stats.AbstractFeatureStatsTest.java Source code

Java tutorial

Introduction

Here is the source code for com.insightml.data.features.stats.AbstractFeatureStatsTest.java

Source

/*
 * Copyright (C) 2016 Stefan Hen
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.insightml.data.features.stats;

import org.apache.commons.math3.util.Pair;
import org.junit.Ignore;
import org.junit.Test;

import com.insightml.TestDatasets;
import com.insightml.data.IDataset;
import com.insightml.data.samples.ISamples;
import com.insightml.data.samples.Sample;
import com.insightml.evaluation.functions.ObjectiveFunction;

public abstract class AbstractFeatureStatsTest {

    @Test
    @Ignore
    public final void test() {
        for (final Pair<IDataset<?, ?, ?>, ObjectiveFunction[]> dataset : TestDatasets.createInstances()) {
            final Iterable<? extends Sample> inst = dataset.getFirst().loadAll();
            if (!(inst.iterator().next().getExpected(0) instanceof String)) {
                test(((IDataset) dataset.getFirst()).pipeline().run(inst, true));
            }
        }
    }

    public abstract void test(ISamples<?, Double> instances);

}