package de.hsel.spm.baudas.analysis; import org.jetbrains.annotations.Nullable; import weka.core.Instances; import weka.core.converters.CSVLoader; import java.io.File; import java.io.IOException; /** * base interface for analysis * * @author Johannes Theiner * @version 0.1 * @since 0.1 * @param Type the chosen analysis returns as a result */ public interface Analysis { /** * loads data from csv file * * @param file File to analyze * @return loaded data in weka format */ @Nullable default Instances load(File file) { CSVLoader loader = new CSVLoader(); try { loader.setSource(file); return loader.getDataSet(); } catch (IOException e) { e.printStackTrace(); } return null; } /** * result of the analysis * * @return result as T */ T getResult(); }