public class sonn
extends java.lang.Object
Class for the algorithm sonn
Constructor and Description |
---|
sonn(SetupParameters global,
Data data)
Constructor
|
Modifier and Type | Method and Description |
---|---|
double |
GenerateOutput(double[] input)
Obtains the fitness of the sonn
|
void |
NewBasicNode()
Adds a new node
|
void |
NewRandomNode(SetupParameters global,
Data data)
Creates a new random node
|
void |
SaveNetwork(java.lang.String file_name,
long seed,
boolean append)
Saves the network to a file, including the seed
|
void |
SaveOutputFile(java.lang.String file_name,
double[][] data,
int n,
SetupParameters global)
Saves the output to a file
|
double |
TestSONNInClassification(SetupParameters global,
double[][] data,
int npatterns)
Obtains fitness for a classification problem
|
double |
TestSONNInRegression(SetupParameters global,
double[][] data,
int npatterns)
Test the SONN algorithm in a regression problem
|
public sonn(SetupParameters global, Data data)
Constructor
global
- Global parametersdata
- Input datapublic void NewBasicNode()
Adds a new node
public void NewRandomNode(SetupParameters global, Data data)
Creates a new random node
global
- Global parametersdata
- Input datapublic void SaveNetwork(java.lang.String file_name, long seed, boolean append) throws java.io.IOException
Saves the network to a file, including the seed
file_name
- The name of the fileseed
- Random seedappend
- Boolean for appending or replacing the filejava.io.IOException
public double GenerateOutput(double[] input)
Obtains the fitness of the sonn
input
- Input valuepublic double TestSONNInRegression(SetupParameters global, double[][] data, int npatterns)
global
- setup parametersdata
- regression data.npatterns
- number of patterns in the problem.public double TestSONNInClassification(SetupParameters global, double[][] data, int npatterns)
Obtains fitness for a classification problem
global
- Global parametersdata
- Input datanpatterns
- Number of patternspublic void SaveOutputFile(java.lang.String file_name, double[][] data, int n, SetupParameters global) throws java.io.IOException
Saves the output to a file
file_name
- Name of the filedata
- Input datan
- Number of patternsglobal
- Global parametersjava.io.IOException