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

aima.core.learning.inductive.DLTestFactory Maven / Gradle / Ivy

Go to download

AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.

The newest version!
package aima.core.learning.inductive;

import java.util.ArrayList;
import java.util.List;

import aima.core.learning.framework.DataSet;

/**
 * @author Ravi Mohan
 * 
 */
public class DLTestFactory {

	public List createDLTestsWithAttributeCount(DataSet ds, int i) {
		if (i != 1) {
			throw new RuntimeException(
					"For now DLTests with only 1 attribute can be craeted , not"
							+ i);
		}
		List nonTargetAttributes = ds.getNonTargetAttributes();
		List tests = new ArrayList();
		for (String ntAttribute : nonTargetAttributes) {
			List ntaValues = ds.getPossibleAttributeValues(ntAttribute);
			for (String ntaValue : ntaValues) {

				DLTest test = new DLTest();
				test.add(ntAttribute, ntaValue);
				tests.add(test);

			}
		}
		return tests;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy