Hauptseite   Packages   Klassenhierarchie   ?bersicht   Auflistung der Dateien   Datenstruktur-Elemente  

EM.java

gehe zur Dokumentation dieser Datei
00001 /*
00002  * $Source: /shared/cvsroot/diplom/app/src/java/de/picana/classifier/EM.java,v $
00003  * $Author: mstolpe $
00004  * $Date: 2003/04/22 09:51:27 $
00005  * $Revision: 1.5 $
00006  * $Release$ 
00007  *
00008  * Created on 31. Oktober 2002, 17:25
00009  *
00010  * Copyright 2002 by Marco Stolpe
00011  */
00012 
00013 package de.picana.classifier;
00014 
00015 import de.picana.control.*;
00016 import de.picana.math.*;
00017 
00018 import weka.core.*;
00019 import java.io.*;
00020 
00021 
00028 public class EM extends Classifier {
00029 
00030     private weka.clusterers.EM algo;
00031     
00032     
00034     public EM() {
00035     }
00036 
00037     protected void loadModel(String filename) throws TaskException {
00038         try {
00039             File model = new File(filename);
00040             FileInputStream fmis = new FileInputStream(model);
00041             ObjectInputStream in = new ObjectInputStream(fmis);
00042          
00043             num_clusters = in.readInt();
00044             algo = (weka.clusterers.EM)in.readObject();
00045             in.close();
00046             
00047         } catch (Exception e) {
00048             throw new TaskException(e.toString());    
00049         }
00050     }
00051     
00052     protected int classify(Instance i) {
00053         int cl = -1;
00054         try {
00055             cl = algo.clusterInstance(i);
00056         } catch (Exception e) {
00057         }
00058         return cl;
00059     }
00060 }

Erzeugt am Tue Apr 22 11:22:55 2003 f?r Picana von doxygen1.2.18