public void stepStarted( final IterativeAlgorithm algorithm) { final ProbabilisticLatentSemanticAnalysis plsa = (ProbabilisticLatentSemanticAnalysis) algorithm; NumberFormat format = new DecimalFormat("0.00"); out.println("Iteration " + plsa.getIteration()); for (ProbabilisticLatentSemanticAnalysis.LatentData latent : plsa.result.latents) { out.println(" Latent " + latent.index); out.println(" p(z) = " + format.format(latent.pLatent)); out.println(" p(t|z) = " + latent.pTermGivenLatent.toString(format)); out.println(" p(d|z) = " + latent.pDocumentGivenLatent.toString(format)); } }
public void stepStarted( final IterativeAlgorithm algorithm) { final ProbabilisticLatentSemanticAnalysis plsa = (ProbabilisticLatentSemanticAnalysis) algorithm; NumberFormat format = new DecimalFormat("0.00"); out.println("Iteration " + plsa.getIteration()); for (ProbabilisticLatentSemanticAnalysis.LatentData latent : plsa.result.latents) { out.println(" Latent " + latent.index); out.println(" p(z) = " + format.format(latent.pLatent)); out.println(" p(t|z) = " + latent.pTermGivenLatent.toString(format)); out.println(" p(d|z) = " + latent.pDocumentGivenLatent.toString(format)); } }
public void stepStarted( final IterativeAlgorithm algorithm) { final ProbabilisticLatentSemanticAnalysis plsa = (ProbabilisticLatentSemanticAnalysis) algorithm; NumberFormat format = new DecimalFormat("0.00"); out.println("Iteration " + plsa.getIteration()); for (ProbabilisticLatentSemanticAnalysis.LatentData latent : plsa.result.latents) { out.println(" Latent " + latent.index); out.println(" p(z) = " + format.format(latent.pLatent)); out.println(" p(t|z) = " + latent.pTermGivenLatent.toString(format)); out.println(" p(d|z) = " + latent.pDocumentGivenLatent.toString(format)); } }
/** * Writes the given vector to the Java-based writer * @param vector Vector to write to the Java-based writer * @throws java.io.IOException on bad write */ public void write( Vector vector ) throws IOException { this.getWriter().write( vector.toString() ); this.getWriter().write( "\n" ); this.getWriter().flush(); }
/** * Writes the given vector to the Java-based writer * @param vector Vector to write to the Java-based writer * @throws java.io.IOException on bad write */ public void write( Vector vector ) throws IOException { this.getWriter().write( vector.toString() ); this.getWriter().write( "\n" ); this.getWriter().flush(); }
/** * Writes the given vector to the Java-based writer * @param vector Vector to write to the Java-based writer * @throws java.io.IOException on bad write */ public void write( Vector vector ) throws IOException { this.getWriter().write( vector.toString() ); this.getWriter().write( "\n" ); this.getWriter().flush(); }