Changeset 38 for trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing
- Timestamp:
- 06/11/15 11:27:33 (9 years ago)
- Location:
- trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing/ZScoreNormalization.java
r37 r38 44 44 45 45 private void normalize(Instances instances) { 46 instances.toString(); 46 47 final Attribute classAttribute = instances.classAttribute(); 47 48 … … 56 57 } 57 58 } 58 59 59 for( int i=0 ; i<instances.numAttributes(); i++) { 60 60 if( !instances.attribute(i).equals(classAttribute) ) { 61 for( int j=0 ; j<instances.num Attributes() ; j++ ) {61 for( int j=0 ; j<instances.numInstances() ; j++ ) { 62 62 Instance inst = instances.get(i); 63 double newValue = (inst.value(j)-means[j])/stddevs[j]; 64 inst.setValue(j, newValue); 63 double newValue = (inst.value(i)-means[i])/stddevs[i]; 64 if( newValue==Double.NaN ) { 65 System.out.println("foooooo"); 66 } 67 inst.setValue(i, newValue); 65 68 } 66 69 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing/ZScoreTargetNormalization.java
r37 r38 44 44 for( int i=0 ; i<testdata.numInstances() ; i++ ) { 45 45 Instance instance = testdata.instance(i); 46 for( int j=0 ; j<testdata.num Instances() ; j++ ) {46 for( int j=0 ; j<testdata.numAttributes() ; j++ ) { 47 47 if( testdata.attribute(j)!=classAttribute ) { 48 48 instance.setValue(j, instance.value(j)-meanTest[j]/stddevTest[j]); … … 85 85 for( int i=0 ; i<testdata.numInstances() ; i++ ) { 86 86 Instance instance = testdata.instance(i); 87 for( int j=0 ; j<testdata.num Instances() ; j++ ) {87 for( int j=0 ; j<testdata.numAttributes() ; j++ ) { 88 88 if( testdata.attribute(j)!=classAttribute ) { 89 89 instance.setValue(j, instance.value(j)-meanTest[j]/stddevTest[j]);
Note: See TracChangeset
for help on using the changeset viewer.