Here you can find the source of saveHeatmapTableCsv(PrintWriter wr, double[][] coefficients, String[] labelNames)
Parameter | Description |
---|---|
wr | PrintWriter |
coefficients | Coefficients |
labelNames | Label names |
public static void saveHeatmapTableCsv(PrintWriter wr, double[][] coefficients, String[] labelNames)
//package com.java2s; /*/* ww w . j av a2 s . c o m*/ * This file is part of the MLDA. * * (c) Jose Maria Moyano Murillo * Eva Lucrecia Gibaja Galindo * Sebastian Ventura Soto <sventura@uco.es> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import java.io.PrintWriter; public class Main { /** * Save heatmap table as .csv file * * @param wr PrintWriter * @param coefficients Coefficients * @param labelNames Label names */ public static void saveHeatmapTableCsv(PrintWriter wr, double[][] coefficients, String[] labelNames) { //Save label names row String line = new String(); line += " ;"; for (String labelName : labelNames) { line += labelName + ";"; } wr.write(line); wr.write(System.getProperty("line.separator")); for (int i = 0; i < labelNames.length; i++) { line = ""; line += labelNames[i] + ";"; for (int j = 0; j < coefficients[i].length; j++) { if (coefficients[j][i] == -1) { line += "" + ";"; } else { line += coefficients[j][i] + ";"; } } wr.write(line); wr.write(System.getProperty("line.separator")); } } }