Package stallone.api.cluster

Source Code of stallone.api.cluster.TestKMeans

package stallone.api.cluster;

import java.io.IOException;

import org.junit.Before;
import org.junit.Test;

import stallone.api.API;
import stallone.api.datasequence.IDataReader;
import stallone.api.datasequence.IDataSequence;
import stallone.api.doubles.IMetric;

public class TestKMeans
{
    IClustering algo;
   
    @Before
    public void setUp() throws IOException {
        String files = "/home/marscher/md_simulation_data/trajall_500K.xtc";
        IDataReader loader = API.dataNew.reader(files);
        IDataSequence data = loader.load();
       
        IMetric metric = API.clusterNew.metric(0, 0);
       
        this.algo = API.clusterNew.kmeans(data, metric, 10, 100);
    }
    @Test
    public void test()
    {
        algo.perform();
        System.out.println(algo.getClusterCenters());
    }

}
TOP

Related Classes of stallone.api.cluster.TestKMeans

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.