<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.jstacs.de/index.php?action=history&amp;feed=atom&amp;title=Train_classifiers_using_MCL_and_MSP</id>
	<title>Train classifiers using MCL and MSP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.jstacs.de/index.php?action=history&amp;feed=atom&amp;title=Train_classifiers_using_MCL_and_MSP"/>
	<link rel="alternate" type="text/html" href="https://www.jstacs.de/index.php?title=Train_classifiers_using_MCL_and_MSP&amp;action=history"/>
	<updated>2026-04-04T16:19:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://www.jstacs.de/index.php?title=Train_classifiers_using_MCL_and_MSP&amp;diff=244&amp;oldid=prev</id>
		<title>Keilwagen: New page: &lt;source lang=&quot;java5&quot;&gt; //read FastA-files Sample[] data = {          new DNASample( args[0] ),          new DNASample( args[1] ) }; AlphabetContainer container = data[0].getAlphabetContaine...</title>
		<link rel="alternate" type="text/html" href="https://www.jstacs.de/index.php?title=Train_classifiers_using_MCL_and_MSP&amp;diff=244&amp;oldid=prev"/>
		<updated>2009-12-02T16:30:47Z</updated>

		<summary type="html">&lt;p&gt;New page: &amp;lt;source lang=&amp;quot;java5&amp;quot;&amp;gt; //read FastA-files Sample[] data = {          new DNASample( args[0] ),          new DNASample( args[1] ) }; AlphabetContainer container = data[0].getAlphabetContaine...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;java5&amp;quot;&amp;gt;&lt;br /&gt;
//read FastA-files&lt;br /&gt;
Sample[] data = {&lt;br /&gt;
         new DNASample( args[0] ),&lt;br /&gt;
         new DNASample( args[1] )&lt;br /&gt;
};&lt;br /&gt;
AlphabetContainer container = data[0].getAlphabetContainer();&lt;br /&gt;
&lt;br /&gt;
//equivalent sample size =^= ESS&lt;br /&gt;
double essFg = 4, essBg = 4;&lt;br /&gt;
//create ScoringFunction, here PWM&lt;br /&gt;
NormalizableScoringFunction pwmFg = new BayesianNetworkScoringFunction( container, data[0].getElementLength(), essFg, true, new InhomogeneousMarkov(0) );&lt;br /&gt;
NormalizableScoringFunction pwmBg = new BayesianNetworkScoringFunction( container, data[1].getElementLength(), essBg, true, new InhomogeneousMarkov(0) );&lt;br /&gt;
&lt;br /&gt;
//create parameters of the classifier&lt;br /&gt;
int threads = AbstractMultiThreadedOptimizableFunction.getNumberOfAvailableProcessors();&lt;br /&gt;
GenDisMixClassifierParameterSet cps = new GenDisMixClassifierParameterSet( container, data[0].getElementLength(),&lt;br /&gt;
		//optimization parameter&lt;br /&gt;
		Optimizer.QUASI_NEWTON_BFGS, 1E-9, 1E-11, 1, false, KindOfParameter.ZEROS, true, threads&lt;br /&gt;
);&lt;br /&gt;
//create classifiers&lt;br /&gt;
MSPClassifier[] cl = {&lt;br /&gt;
         //MCL&lt;br /&gt;
         new MSPClassifier( cps, pwmFg, pwmBg ),&lt;br /&gt;
         //MSP with composite prior (here this equivalent to a transformed product-Dirichlet)&lt;br /&gt;
         new MSPClassifier( cps, new CompositeLogPrior(), pwmFg, pwmBg ),&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//do what ever you like&lt;br /&gt;
&lt;br /&gt;
//e.g., train&lt;br /&gt;
for( int i = 0; i &amp;lt; cl.length; i++ ){&lt;br /&gt;
	cl[i].train( data );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//e.g., evaluate (normally done on a test data set)&lt;br /&gt;
MeasureParameters mp = new MeasureParameters( false, 0.95, 0.999, 0.999 );&lt;br /&gt;
for( int i = 0; i &amp;lt; cl.length; i++ ){&lt;br /&gt;
	System.out.println( cl[i].evaluate( mp, true, data ) );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Keilwagen</name></author>
	</entry>
</feed>