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

com.actelion.research.calc.VectorSOM Maven / Gradle / Ivy

There is a newer version: 2024.12.1
Show newest version
/*
 * Copyright 2017 Idorsia Pharmaceuticals Ltd., Hegenheimermattweg 91, CH-4123 Allschwil, Switzerland
 *
 * This file is part of DataWarrior.
 * 
 * DataWarrior is free software: you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 * 
 * DataWarrior is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with DataWarrior.
 * If not, see http://www.gnu.org/licenses/.
 *
 * @author Thomas Sander
 */

package com.actelion.research.calc;

import com.actelion.research.util.DoubleFormat;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.Random;

public class VectorSOM extends SelfOrganizedMap {
	private double[]	mMeanParameter,mStandardDeviation;
	private int			mParameterCount;

	public VectorSOM() {}
			// constructor to be used if SOM interna are read from a SOM file with read()

	public VectorSOM(int nx, int ny, int mode) {
		super(nx, ny, mode);
		}

	public void setParameterCount(int parameterCount) {
	    	// needs to be called before organize()
		mParameterCount = parameterCount;
		}

	@Override
	protected void initializeNormalization() {
			// must be overridden if input vectors aren't double arrays
		startProgress("Calculating mean parameters...", 0, mController.getInputVectorCount());

			// don't normalize input vectors if they are random vectors
		if (mController.getInputVectorCount() == -1) {
			mMeanParameter = new double[mParameterCount];
			mStandardDeviation = new double[mParameterCount];
			for (int i=0; i");
		writer.newLine();

		writer.write("");
		writer.newLine();
		}

	@Override
	public void read(BufferedReader reader) throws Exception {
		super.read(reader);

		String theLine = reader.readLine();
		boolean error = !theLine.startsWith("




© 2015 - 2025 Weber Informatics LLC | Privacy Policy