|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rapidminer.operator.learner.functions.kernel.jmysvm.examples.SVMExamples
public class SVMExamples
Implementation of a sparse example set which can be used for learning. This data structure is also used as SVM model.
Nested Class Summary | |
---|---|
static class |
SVMExamples.MeanVariance
This class holds information aboud the means and variances of an attribute. |
Field Summary | |
---|---|
double[][] |
atts
The known attribute values for each example. |
java.lang.String[] |
ids
The ids of all examples. |
int[][] |
index
The corresponding indices for the known attribute values for each example. |
Constructor Summary | |
---|---|
SVMExamples(ExampleSet exampleSet,
Attribute labelAttribute,
boolean scale)
|
|
SVMExamples(ExampleSet exampleSet,
Attribute labelAttribute,
java.util.Map<java.lang.Integer,SVMExamples.MeanVariance> meanVariances)
Creates a fresh example set of the given size from the RapidMiner example reader. |
|
SVMExamples(int size,
double b)
Creates an empty example set of the given size. |
|
SVMExamples(java.io.ObjectInputStream in)
Reads an example set from the given input stream. |
Method Summary | |
---|---|
void |
clearAlphas()
|
int |
count_examples()
Counts the training examples. |
int |
count_pos_examples()
Counts the positive training examples |
double |
get_alpha(int pos)
Gets an alpha-value. |
double[] |
get_alphas()
Gets the alpha array. |
double |
get_b()
get b |
int |
get_dim()
Gets the dimension of the examples |
SVMExample |
get_example(int pos)
Gets an example. |
double |
get_y(int pos)
Gets an y-value. |
double[] |
get_ys()
Gets the y array |
double |
getB()
|
java.lang.String |
getId(int index)
|
java.util.Map<java.lang.Integer,SVMExamples.MeanVariance> |
getMeanVariances()
|
int |
getNumberOfSupportVectors()
|
int |
getTrain_size()
|
double[] |
getYs()
|
void |
set_alpha(int pos,
double alpha)
sets an alpha value. |
void |
set_b(double new_b)
set b |
void |
set_dim(int d)
|
void |
set_y(int pos,
double y)
Sets the label value for the specified example. |
void |
setB(double b)
|
void |
setMeanVarianceMap(java.util.Map<java.lang.Integer,SVMExamples.MeanVariance> meanVarianceMap)
|
void |
setTrain_size(int train_size)
|
void |
setYs(double[] ys)
|
void |
swap(int pos1,
int pos2)
swap two training examples |
java.lang.String |
toString()
|
java.lang.String |
toString(boolean onlySV)
|
java.lang.String |
toString(int numberOfExamples,
boolean onlySV)
|
void |
writeSupportVectors(java.io.ObjectOutputStream out)
Writes the example set into the given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double[][] atts
public int[][] index
public java.lang.String[] ids
Constructor Detail |
---|
public SVMExamples(int size, double b)
public SVMExamples(ExampleSet exampleSet, Attribute labelAttribute, boolean scale)
public SVMExamples(ExampleSet exampleSet, Attribute labelAttribute, java.util.Map<java.lang.Integer,SVMExamples.MeanVariance> meanVariances)
public SVMExamples(java.io.ObjectInputStream in) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public java.util.Map<java.lang.Integer,SVMExamples.MeanVariance> getMeanVariances()
public int getNumberOfSupportVectors()
public void writeSupportVectors(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public int count_examples()
public int count_pos_examples()
public int get_dim()
public void set_dim(int d)
public SVMExample get_example(int pos)
pos
- Number of example
public double get_y(int pos)
pos
- Number of example
public void set_y(int pos, double y)
public double[] get_ys()
public double get_alpha(int pos)
pos
- Number of example
public double[] get_alphas()
public void swap(int pos1, int pos2)
pos1
- pos2
- public double get_b()
public void set_b(double new_b)
new_b
- public void set_alpha(int pos, double alpha)
pos
- Number of examplealpha
- New valuepublic void clearAlphas()
public void setMeanVarianceMap(java.util.Map<java.lang.Integer,SVMExamples.MeanVariance> meanVarianceMap)
public double[] getYs()
public void setYs(double[] ys)
public int getTrain_size()
public void setTrain_size(int train_size)
public double getB()
public void setB(double b)
public java.lang.String getId(int index)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean onlySV)
public java.lang.String toString(int numberOfExamples, boolean onlySV)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |