- Timestamp:
- 07/18/16 12:26:03 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing/TransferComponentAnalysis.java
r86 r135 37 37 * </p> 38 38 * 39 * TODO comment class40 39 * @author Steffen Herbold 41 40 */ 42 41 public class TransferComponentAnalysis implements IProcessesingStrategy { 43 42 43 /** 44 * Dimension of the reduced data. 45 */ 44 46 int reducedDimension = 5; 45 47 48 /* 49 * (non-Javadoc) 50 * 51 * @see de.ugoe.cs.cpdp.IParameterizable#setParameter(java.lang.String) 52 */ 46 53 @Override 47 54 public void setParameter(String parameters) { 48 49 } 50 55 // dummy, paramters ignored 56 } 57 58 /* 59 * (non-Javadoc) 60 * 61 * @see de.ugoe.cs.cpdp.dataprocessing.IProcessesingStrategy#apply(weka.core.Instances, 62 * weka.core.Instances) 63 */ 51 64 @Override 52 65 public void apply(Instances testdata, Instances traindata) { … … 54 67 } 55 68 69 /** 70 * <p> 71 * calculates the linear kernel function between two instances 72 * </p> 73 * 74 * @param x1 75 * first instance 76 * @param x2 77 * second instance 78 * @return kernel value 79 */ 56 80 private double linearKernel(Instance x1, Instance x2) { 57 81 double value = 0.0d; … … 64 88 } 65 89 90 /** 91 * <p> 92 * Applies TCA to the test and training data. 93 * </p> 94 * 95 * @param testdata 96 * the test data 97 * @param traindata 98 * the training data 99 */ 66 100 private void applyTCA(Instances testdata, Instances traindata) { 67 101 final int sizeTest = testdata.numInstances(); … … 125 159 } 126 160 161 /** 162 * <p> 163 * Creates the kernel matrix of the test and training data 164 * </p> 165 * 166 * @param testdata 167 * the test data 168 * @param traindata 169 * the training data 170 * @return kernel matrix 171 */ 127 172 private PrimitiveMatrix buildKernel(Instances testdata, Instances traindata) { 128 173 final int kernelDim = traindata.numInstances() + testdata.numInstances(); … … 162 207 } 163 208 209 /** 210 * <p> 211 * Calculates the kernel norm matrix, i.e., the matrix which is used for matrix multiplication 212 * to calculate the kernel norm. 213 * </p> 214 * 215 * @param dimTest 216 * dimension of the test data 217 * @param sizeTrain 218 * number of instances of the training data 219 * @return kernel norm matrix 220 */ 164 221 private PrimitiveMatrix buildKernelNormMatrix(final int dimTest, final int sizeTrain) { 165 222 final double trainSquared = 1.0 / (sizeTrain * (double) sizeTrain); … … 199 256 } 200 257 258 /** 259 * <p> 260 * Creates the center matrix 261 * </p> 262 * 263 * @param sizeTest 264 * number of instances of the test data 265 * @param sizeTrain 266 * number of instances of the training data 267 * @return center matrix 268 */ 201 269 private PrimitiveMatrix buildCenterMatrix(final int sizeTest, final int sizeTrain) { 202 270 Builder<PrimitiveMatrix> centerMatrix = … … 208 276 } 209 277 278 /** 279 * <p> 280 * Builds the mu-Matrix for offsetting values. 281 * </p> 282 * 283 * @param sizeTest 284 * number of instances of the test data 285 * @param sizeTrain 286 * number of instances of the training data 287 * @param mu 288 * mu parameter 289 * @return mu-Matrix 290 */ 210 291 private PrimitiveMatrix buildMuMatrix(final int sizeTest, 211 292 final int sizeTrain,
Note: See TracChangeset
for help on using the changeset viewer.