Changeset 135 for trunk/CrossPare/src/de/ugoe/cs/cpdp/loader
- Timestamp:
- 07/18/16 12:26:03 (8 years ago)
- Location:
- trunk/CrossPare/src/de/ugoe/cs/cpdp/loader
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/AUDIChangeFolderLoader.java
r86 r135 15 15 package de.ugoe.cs.cpdp.loader; 16 16 17 /** 18 * <p> 19 * Loads data from the automative defect data set from Audi Electronic Ventures donated by Altinger 20 * et al. at the MSR 2015. This loader contains the changes per commit, i.e., it is for JIT defect 21 * prediction. 22 * </p> 23 * 24 * @author Steffen Herbold 25 */ 17 26 public class AUDIChangeFolderLoader extends AbstractFolderLoader { 18 27 -
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/AUDIChangeLoader.java
r86 r135 28 28 29 29 /** 30 * TODO 30 * <p> 31 * Loads data from the automative defect data set from Audi Electronic Ventures donated by Altinger 32 * et al. at the MSR 2015. This loader contains the changes per commit, i.e., it is for JIT defect 33 * prediction. 34 * </p> 31 35 * 32 * @author sherbold 33 * 36 * @author Steffen Herbold 34 37 */ 35 38 class AUDIChangeLoader implements SingleVersionLoader { 36 39 40 /** 41 * <p> 42 * Internal helper class. 43 * </p> 44 * 45 * @author Steffen Herbold 46 */ 37 47 private class EntityRevisionPair implements Comparable<EntityRevisionPair> { 48 49 /** 50 * string that defines an entity 51 */ 38 52 private final String entity; 53 54 /** 55 * revision number of the entity 56 */ 39 57 private final int revision; 40 58 59 /** 60 * <p> 61 * Constructor. Creates a new EntityRevisionPair. 62 * </p> 63 * 64 * @param entity 65 * the entity 66 * @param revision 67 * the revision 68 */ 41 69 public EntityRevisionPair(String entity, int revision) { 42 70 this.entity = entity; … … 44 72 } 45 73 74 /* 75 * (non-Javadoc) 76 * 77 * @see java.lang.Object#equals(java.lang.Object) 78 */ 46 79 @Override 47 80 public boolean equals(Object other) { … … 54 87 } 55 88 89 /* 90 * (non-Javadoc) 91 * 92 * @see java.lang.Object#hashCode() 93 */ 56 94 @Override 57 95 public int hashCode() { … … 59 97 } 60 98 99 /* 100 * (non-Javadoc) 101 * 102 * @see java.lang.Comparable#compareTo(java.lang.Object) 103 */ 61 104 @Override 62 105 public int compareTo(EntityRevisionPair other) { … … 68 111 } 69 112 113 /* 114 * (non-Javadoc) 115 * 116 * @see java.lang.Object#toString() 117 */ 70 118 @Override 71 119 public String toString() { … … 74 122 } 75 123 124 /* 125 * (non-Javadoc) 126 * 127 * @see de.ugoe.cs.cpdp.loader.SingleVersionLoader#load(java.io.File) 128 */ 76 129 @Override 77 130 public Instances load(File file) { … … 139 192 for (int i = 1; i < linesBug.length; i++) { 140 193 lineSplitBug = linesBug[i].split(";"); 141 entityRevisionPairs.put(new EntityRevisionPair(lineSplitBug[0], Integer 142 .parseInt(lineSplitBug[revisionIndex])), i); 194 entityRevisionPairs.put( 195 new EntityRevisionPair(lineSplitBug[0], 196 Integer 197 .parseInt(lineSplitBug[revisionIndex])), 198 i); 143 199 } 144 200 -
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/AUDIDataLoader.java
r86 r135 25 25 26 26 /** 27 * TODO 27 * Loads data from the automative defect data set from Audi Electronic Ventures donated by Altinger 28 * et al. at the MSR 2015. This loader creates overall defect labels, for the final revision. 28 29 * 29 * @author sherbold30 * @author Steffen Herbold 30 31 * 31 32 */ -
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/AUDIFolderLoader.java
r86 r135 15 15 package de.ugoe.cs.cpdp.loader; 16 16 17 /** 18 * 19 * <p> 20 * Loads data from the automative defect data set from Audi Electronic Ventures donated by Altinger 21 * et al. at the MSR 2015. This loader creates overall defect labels, for the final revision. 22 * </p> 23 * 24 * @author Steffen Herbold 25 */ 17 26 public class AUDIFolderLoader extends AbstractFolderLoader { 18 27 -
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/AbstractFolderLoader.java
r132 r135 46 46 } 47 47 48 /* *48 /* 49 49 * @see de.ugoe.cs.cpdp.loader.IVersionLoader#load() 50 50 */ … … 68 68 Instances data = instancesLoader.load(versionFile); 69 69 String versionName = data.relationName(); 70 List<Double> efforts = getEfforts(data); 71 versions.add(new SoftwareVersion(projectName, versionName, data, efforts)); 70 List<Double> efforts = getEfforts(data); 71 versions 72 .add(new SoftwareVersion(projectName, versionName, data, efforts)); 72 73 } 73 74 } … … 77 78 return versions; 78 79 } 79 80 81 /** 82 * <p> 83 * Sets the efforts for the instances 84 * </p> 85 * 86 * @param data 87 * the data 88 * @return 89 */ 80 90 private List<Double> getEfforts(Instances data) { 81 91 // attribute in the JURECZKO data and default … … 93 103 effortAtt = data.attribute("CountLineCodeExe"); 94 104 } 95 if ( effortAtt == null) {105 if (effortAtt == null) { 96 106 return null; 97 107 } 98 108 List<Double> efforts = new ArrayList<>(data.size()); 99 for ( int i=0; i<data.size(); i++) {109 for (int i = 0; i < data.size(); i++) { 100 110 efforts.add(data.get(i).value(effortAtt)); 101 111 } … … 106 116 * Returns the concrete {@link SingleVersionLoader} to be used with this folder loader. 107 117 * 108 * @return 118 * @return the version loader 109 119 */ 110 120 abstract protected SingleVersionLoader getSingleLoader(); -
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/CSVMockusDataLoader.java
r86 r135 24 24 import de.ugoe.cs.util.FileTools; 25 25 26 /** 27 * <p> 28 * Reads data from the data set provided by Mockus (and Zhang) for universal defect prediction. 29 * </p> 30 * 31 * @author Steffen Herbold 32 */ 26 33 class CSVMockusDataLoader implements SingleVersionLoader { 27 34 -
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/CSVMockusFolderLoader.java
r86 r135 15 15 package de.ugoe.cs.cpdp.loader; 16 16 17 /** 18 * <p> 19 * Reads data from the data set provided by Mockus (and Zhang) for universal defect prediction. 20 * </p> 21 * 22 * @author Steffen Herbold 23 */ 17 24 public class CSVMockusFolderLoader extends AbstractFolderLoader { 18 25 -
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/DecentDataLoader.java
r86 r135 237 237 for (String key : EPackage.Registry.INSTANCE.keySet()) { 238 238 metaModelCache.put(key, EPackage.Registry.INSTANCE.get(key)); 239 } ;239 } ; 240 240 241 241 for (String key : metaModelCache.keySet()) { 242 242 EPackage.Registry.INSTANCE.remove(key); 243 } ;243 } ; 244 244 245 245 // Workaround to gernerate a usable URI. Absolute path is not … … 445 445 } 446 446 else { 447 Console.printerrln("Could not determine model type, file should end with either .etl or .eol"); 447 Console 448 .printerrln("Could not determine model type, file should end with either .etl or .eol"); 448 449 return null; 449 450 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/IDecentVersionLoader.java
r86 r135 19 19 import de.ugoe.cs.cpdp.versions.SoftwareVersion; 20 20 21 /** 22 * <p> 23 * Extends the version load for the loading of DECENT models 24 * </p> 25 * 26 * @author Fabian Trautsch 27 */ 21 28 public interface IDecentVersionLoader extends IVersionLoader { 22 29 30 /** 31 * <p> 32 * loads the versions and defines the DECENT attributes to be used 33 * </p> 34 * 35 * @param decentAttributes the attributes 36 * @return the versions 37 */ 23 38 public List<SoftwareVersion> load(List<String> decentAttributes); 24 39 -
trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/RelinkLoader.java
r119 r135 1 1 2 package de.ugoe.cs.cpdp.loader; 2 3 … … 10 11 import weka.core.Instances; 11 12 13 /** 14 * <p> 15 * Loads data from the RELINK data set. 16 * </p> 17 * 18 * @author Steffen Herbold 19 */ 12 20 public class RelinkLoader implements SingleVersionLoader { 13 21 … … 67 75 attrNames.add("SumEssential"); 68 76 attrNames.add("isDefective"); 69 70 for ( int j=tmpData.numAttributes()-1; j>=0 ; j--) {71 if ( !attrNames.contains(tmpData.attribute(j).name())) {77 78 for (int j = tmpData.numAttributes() - 1; j >= 0; j--) { 79 if (!attrNames.contains(tmpData.attribute(j).name())) { 72 80 tmpData.deleteAttributeAt(j); 73 81 } 74 82 } 75 83 76 84 // setting class attribute 77 85 tmpData.setClassIndex(tmpData.numAttributes() - 1);
Note: See TracChangeset
for help on using the changeset viewer.