Class DotProductEuclidean
java.lang.Object
weka.classifiers.functions.explicitboundaries.gemoetry.DotProductEuclidean
- All Implemented Interfaces:
Serializable
,DotProduct
,IInstanceNormCalc
,weka.core.Debuggable
public class DotProductEuclidean
extends Object
implements DotProduct, Serializable, weka.core.Debuggable
- Since:
- 0.1.0
- Version:
- 2.1.0
- Author:
- pawel trajdos
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
dotProduct
(weka.core.Instance inst1, weka.core.Instance inst2) Calculate dot product between instances (vecttors)boolean
isDebug()
double
norm
(weka.core.Instance vec) Calculates the dot-product-induced norm of the vectorweka.core.Instance
normalize
(weka.core.Instance inst) Returns normalized instance.weka.core.Instance
projection
(weka.core.Instance inst1, weka.core.Instance inst2) Calculates the projection of instance 1 (inst1) on instance 2 (inst2).void
setDebug
(boolean debug)
-
Constructor Details
-
DotProductEuclidean
public DotProductEuclidean()
-
-
Method Details
-
dotProduct
Description copied from interface:DotProduct
Calculate dot product between instances (vecttors)- Specified by:
dotProduct
in interfaceDotProduct
- Parameters:
inst1
- -- Instance 1inst2
- -- Instance 2- Returns:
- Dot product
- Throws:
Exception
- -- when instances or dataset are incompatible with each other
-
norm
Description copied from interface:DotProduct
Calculates the dot-product-induced norm of the vector- Specified by:
norm
in interfaceDotProduct
- Specified by:
norm
in interfaceIInstanceNormCalc
- Returns:
- vector/instance norm
- Throws:
Exception
- -- when instances or dataset are incompatible with each other
-
projection
public weka.core.Instance projection(weka.core.Instance inst1, weka.core.Instance inst2) throws Exception Description copied from interface:DotProduct
Calculates the projection of instance 1 (inst1) on instance 2 (inst2). The projection uses the above-defined dot product and norm.- Specified by:
projection
in interfaceDotProduct
- Parameters:
inst1
- -- Instance 1inst2
- -- Instance 2- Returns:
- Projection of inst1 on inst2
- Throws:
Exception
- -- when instances or dataset are incompatible with each other
-
normalize
Description copied from interface:IInstanceNormCalc
Returns normalized instance. Only numeric attributes are normalized. If the norm of the vector is 0, then the vector is not normalized.- Specified by:
normalize
in interfaceIInstanceNormCalc
- Parameters:
inst
- -- instance to normalize- Returns:
- Throws:
Exception
-
isDebug
public boolean isDebug()- Specified by:
isDebug
in interfaceweka.core.Debuggable
- Returns:
- the debug
-
setDebug
public void setDebug(boolean debug) - Specified by:
setDebug
in interfaceweka.core.Debuggable
- Parameters:
debug
- the debug to set
-