|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.yale.operator.AbstractIOObject
edu.udo.cs.yale.operator.ResultObjectAdapter
edu.udo.cs.yale.operator.AbstractModel
edu.udo.cs.yale.operator.IOModel
edu.udo.cs.yale.operator.features.transformation.PCAModel
public class PCAModel
This is the transformation model of the principal components analysis. The
number of components is initially specified by the PCA
.
Additionally you can specify the number of components in the
ModelApplier
. You can add two prediction parameter:
PCA
Field Summary | |
---|---|
private int[] |
att_index
|
private java.lang.String[] |
attname
|
private double[] |
cumvariance
|
(package private) javax.swing.JRadioButton |
cumvariance_plot
|
(package private) javax.swing.JRadioButton |
eigenvalue_table
|
private double[] |
eigenvalues
|
(package private) javax.swing.JRadioButton |
eigenvector_table
|
private double[][] |
eigenvectors
|
private boolean |
keep_attributes
|
private int |
last_selected_index
|
private boolean |
manual_number
|
private double[] |
mean
|
private int |
nr_components
|
private double[][] |
sorted_eigenvectors
|
private int |
sortindex
|
private double |
variance_threshold
|
private java.awt.Component[] |
viscomp
|
private javax.swing.JPanel |
vispanel
|
Constructor Summary | |
---|---|
PCAModel()
|
|
PCAModel(ExampleSet eSet,
double[] eigenvalues,
double[][] eigenvectors)
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent arg0)
|
void |
apply(ExampleSet eSet)
Applies the model on the given example set. |
private void |
calculateCumulativeVariance()
Calculates the cumulative variance. |
java.lang.String[] |
getAttributeNames()
|
double[] |
getEigenvalues()
|
private java.awt.Component |
getEigenvalueTable()
|
double[][] |
getEigenvectors()
|
private java.awt.Component |
getEigenvectorTable()
|
double[] |
getMean()
|
double |
getNrOfComponents()
|
private javax.swing.JComponent |
getVariancePlot()
|
double |
getVarianceThreshold()
|
java.awt.Component |
getVisualisationComponent(IOContainer container)
Returns a label that displays the ResultObjectAdapter.toResultString() result
encoded as html. |
AttributeWeights |
getWeightsOfComponent(int component)
|
private void |
initSortedEigenvectors()
|
void |
itemStateChanged(java.awt.event.ItemEvent event)
|
private void |
quickSort(double[] array,
int links,
int rechts)
Order the subarry from index anfang to index ende with QuickSort |
private void |
quickSort2(double[][] array,
int index,
int links,
int rechts)
Order the subarry from index anfang to index ende with QuickSort |
void |
readData(java.io.ObjectInputStream in)
Reads the model data from the stream. |
void |
setNrOfComponents(int nr_components)
|
void |
setParameter(java.lang.String name,
java.lang.Object object)
Throws a UserError since most models should not allow additional parameters during application. |
void |
setVarianceThreshold(double threshold)
|
void |
writeData(java.io.ObjectOutputStream out)
Writes the model to a stream. |
Methods inherited from class edu.udo.cs.yale.operator.AbstractModel |
---|
equals, getExtension, getFileDescription, readModel, readModel, save, writeModel, writeModel |
Methods inherited from class edu.udo.cs.yale.operator.ResultObjectAdapter |
---|
addAction, getActions, getName, toHTML, toResultString |
Methods inherited from class edu.udo.cs.yale.operator.AbstractIOObject |
---|
copy, read, read, read, write, write |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.udo.cs.yale.operator.ResultObject |
---|
getActions, getName, toResultString |
Methods inherited from interface edu.udo.cs.yale.operator.IOObject |
---|
copy, write, write |
Field Detail |
---|
private double[] mean
private java.lang.String[] attname
private double[] eigenvalues
private double[][] eigenvectors
private boolean manual_number
private int nr_components
private double variance_threshold
private double[] cumvariance
private java.awt.Component[] viscomp
private javax.swing.JPanel vispanel
javax.swing.JRadioButton eigenvalue_table
javax.swing.JRadioButton eigenvector_table
javax.swing.JRadioButton cumvariance_plot
private int last_selected_index
private int[] att_index
private double[][] sorted_eigenvectors
private int sortindex
private boolean keep_attributes
Constructor Detail |
---|
public PCAModel()
public PCAModel(ExampleSet eSet, double[] eigenvalues, double[][] eigenvectors)
Method Detail |
---|
public java.lang.String[] getAttributeNames()
public double[] getMean()
public double[] getEigenvalues()
public double[][] getEigenvectors()
public double getVarianceThreshold()
public double getNrOfComponents()
public void setVarianceThreshold(double threshold)
public void setNrOfComponents(int nr_components)
public void apply(ExampleSet eSet) throws OperatorException
Model
apply
in interface Model
OperatorException
private void calculateCumulativeVariance()
private void quickSort(double[] array, int links, int rechts)
array
- links
- rechts
- public void writeData(java.io.ObjectOutputStream out) throws java.io.IOException
AbstractModel
writeData
in class AbstractModel
java.io.IOException
public void readData(java.io.ObjectInputStream in) throws java.io.IOException
IOModel
readData
in class IOModel
java.io.IOException
public void setParameter(java.lang.String name, java.lang.Object object) throws OperatorException
AbstractModel
setParameter
in interface Model
setParameter
in class AbstractModel
OperatorException
private java.awt.Component getEigenvalueTable()
private java.awt.Component getEigenvectorTable()
private javax.swing.JComponent getVariancePlot()
public java.awt.Component getVisualisationComponent(IOContainer container)
ResultObjectAdapter
ResultObjectAdapter.toResultString()
result
encoded as html. Please note that the returned label is already enclosed
by a scroll pane. If you overwrite this method you should again ensure that
the returned component is scrollable. The given container is totally ignored.
getVisualisationComponent
in interface ResultObject
getVisualisationComponent
in class ResultObjectAdapter
public void actionPerformed(java.awt.event.ActionEvent arg0)
actionPerformed
in interface java.awt.event.ActionListener
public void itemStateChanged(java.awt.event.ItemEvent event)
itemStateChanged
in interface java.awt.event.ItemListener
private void quickSort2(double[][] array, int index, int links, int rechts)
array
- links
- rechts
- private void initSortedEigenvectors()
public AttributeWeights getWeightsOfComponent(int component) throws OperatorException
getWeightsOfComponent
in interface ComponentWeightsCreatable
OperatorException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |