Repository /Marcin/SolubilityModel.jar:onsc.SolubilityModel


Back

No file description

Source code

package onsc;

import weka.classifiers.Classifier;
import weka.core.Instance;
import weka.core.Instances;

/**
 * Solubility model published by Jean-Claude Bradley and Andrew Lang at
 * <a href="http://onschallenge.wikispaces.com/SolubilityModel003">http://onschallenge.wikispaces.com/SolubilityModel003</a>
 * on 09-30-2009, in relation to Open Notebook Science Challenge
 */
public class SolubilityModel extends Classifier {

	/** Does nothing, because the model is hard-wired - no need for training. */
	public void buildClassifier(Instances instances) throws Exception {}

	/** Returns prediction for a given solute/solvent described by 'instance' */
	public double classifyInstance(Instance instance) throws Exception 
	{
		// attributes are counted from zero! 2 means the 3rd attribute, solute_amr
		double AMR = instance.value(2);                // solute_amr
		double Kier1 = instance.value(19);             // solute_kier1
		double XLogP = instance.value(23);             // solute_xlogp
		double BCUTc1 = instance.value(5);             // solute_bcutcl
		double ATSc1 = instance.value(11);             // solute_atsc1
		double apol = instance.value(9);               // solute_apol
		double bpol = instance.value(16);              // solute_bpol
		double Solvent_DC = instance.value(25);        // solvent_dielectricconstant
		double Solvent_BCUTw1 = instance.value(29);    // solvent_bcutwl
		double Solvent_TopoPSA = instance.value(48);   // solvent_topopsa
		
		double prediction =
			                              (-133.454 ) 
			+ 1/AMR                     * ( -31.4476)
			+ 1/Kier1                   * (  36.6713)
			+ XLogP                     * (   1.1049)
			+ BCUTc1                    * (  -7.4035)
			+ ATSc1                     * (   6.0309)
			+ apol                      * (  -0.1731)
			+ apol * Solvent_DC         * (  -0.0053)
			+ bpol * Solvent_DC         * (   0.0065)
			+ Solvent_BCUTw1            * (  11.6778)
			+ Solvent_TopoPSA           * (   0.1071)
			;
		return prediction;
	}

}

Copyright © 2008-2011 by TunedIT
Design by luksite