|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.biojava.stats.svm.tools.ClassifierExample.PointClassifier
public static class ClassifierExample.PointClassifier
An extention of JComponent that contains the points & encapsulates the classifier.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static SVMKernel |
polyKernel
|
static SVMKernel |
rbfKernel
|
static SMOTrainer |
trainer
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ClassifierExample.PointClassifier()
Make a new PointClassifier. |
Method Summary | |
---|---|
void |
classify()
Learn a model from the current points. |
void |
clear()
Remove all points from the canvas, and discard any model. |
boolean |
getAddPos()
Retrieve the current value of addPos. |
SVMKernel |
getKernel()
Retrieve the currently used kernel |
Shape |
getNegShape()
Retrieve the shape used to represent negative points. |
Shape |
getPosShape()
Retrieve the shape used to represent positive points. |
void |
paintComponent(Graphics g)
Renders this component to display the points, and if present, the support vector machine. |
void |
setAddPos(boolean addPos)
Set a flag so that newly added points will be in the positive class or negative class, depending on wether addPos is true or false respectively. |
void |
setKernel(SVMKernel kernel)
Set the kernel used for classification. |
void |
setNegShape(Shape negShape)
Set the Shape to represent the negative points. |
void |
setPosShape(Shape posShape)
Set the Shape to represent the positive points. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static SVMKernel polyKernel
public static SVMKernel rbfKernel
public static SMOTrainer trainer
Constructor Detail |
---|
public ClassifierExample.PointClassifier()
Hooks up the mouse listener & cursor. Chooses default colors & Shapes.
Method Detail |
---|
public void setKernel(SVMKernel kernel)
kernel
- the SVMKernel to usepublic SVMKernel getKernel()
public void setAddPos(boolean addPos)
addPos
- boolean to flag which class to add new points topublic boolean getAddPos()
public void setPosShape(Shape posShape)
The shape should be positioned so that 0, 0 is the center or focus.
posShape
- the Shape to usepublic Shape getPosShape()
public void setNegShape(Shape negShape)
The shape should be positioned so that 0, 0 is the center or focus.
negShape
- the Shape to usepublic Shape getNegShape()
public void clear()
public void classify()
This may take some time for complicated models.
public void paintComponent(Graphics g)
paintComponent
in class JComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |