Annotation en pourcentage float et plus de contrôle d'annotation sur les solitaires.
Showing
2 changed files
with
10 additions
and
11 deletions
... | @@ -50,7 +50,7 @@ public class PreprocessingRunner implements ApplicationRunner { | ... | @@ -50,7 +50,7 @@ public class PreprocessingRunner implements ApplicationRunner { |
50 | 50 | ||
51 | private Boolean ratings; | 51 | private Boolean ratings; |
52 | 52 | ||
53 | - private int annotatePercent; | 53 | + private float annotatePercent; |
54 | 54 | ||
55 | @Override | 55 | @Override |
56 | public void run(ApplicationArguments applicationArguments) throws Exception { | 56 | public void run(ApplicationArguments applicationArguments) throws Exception { |
... | @@ -161,8 +161,6 @@ public class PreprocessingRunner implements ApplicationRunner { | ... | @@ -161,8 +161,6 @@ public class PreprocessingRunner implements ApplicationRunner { |
161 | 161 | ||
162 | logger.debug("Remaining AssociationElement count {}", associationElements.size()); | 162 | logger.debug("Remaining AssociationElement count {}", associationElements.size()); |
163 | 163 | ||
164 | - logger.debug("Remover item or user {}", removedUser || removedItem); | ||
165 | - | ||
166 | return associationElements; | 164 | return associationElements; |
167 | } | 165 | } |
168 | 166 | ||
... | @@ -180,6 +178,7 @@ public class PreprocessingRunner implements ApplicationRunner { | ... | @@ -180,6 +178,7 @@ public class PreprocessingRunner implements ApplicationRunner { |
180 | randomInteger = new Integer(random.nextInt(size)); | 178 | randomInteger = new Integer(random.nextInt(size)); |
181 | 179 | ||
182 | if (!annotatedChosen.contains(randomInteger)) { | 180 | if (!annotatedChosen.contains(randomInteger)) { |
181 | + /* Annotation sans contrôle | ||
183 | randomAssociationElement = annotableElements.get(randomInteger); | 182 | randomAssociationElement = annotableElements.get(randomInteger); |
184 | final Long itemId = randomAssociationElement.getItemId(); | 183 | final Long itemId = randomAssociationElement.getItemId(); |
185 | final Long userId = randomAssociationElement.getUserId(); | 184 | final Long userId = randomAssociationElement.getUserId(); |
... | @@ -199,10 +198,10 @@ public class PreprocessingRunner implements ApplicationRunner { | ... | @@ -199,10 +198,10 @@ public class PreprocessingRunner implements ApplicationRunner { |
199 | } | 198 | } |
200 | } | 199 | } |
201 | 200 | ||
202 | - if (userCount > userSize && itemCount > itemSize) { | 201 | + if (userCount > userSize && itemCount > itemSize) {*/ |
203 | annotatedChosen.add(randomInteger); | 202 | annotatedChosen.add(randomInteger); |
204 | - logger.debug("Adding new AssociationElement to annotated, total is {}", annotatedChosen.size()); | 203 | +// logger.debug("Adding new AssociationElement to annotated, total is {}", annotatedChosen.size()); |
205 | - } | 204 | +// } |
206 | } | 205 | } |
207 | } | 206 | } |
208 | 207 | ||
... | @@ -309,10 +308,10 @@ public class PreprocessingRunner implements ApplicationRunner { | ... | @@ -309,10 +308,10 @@ public class PreprocessingRunner implements ApplicationRunner { |
309 | } | 308 | } |
310 | 309 | ||
311 | if (properties.containsKey("annotatePercent")) { | 310 | if (properties.containsKey("annotatePercent")) { |
312 | - annotatePercent = Integer.parseInt(properties.getProperty("annotatePercent")); | 311 | + annotatePercent = Float.parseFloat(properties.getProperty("annotatePercent")); |
313 | } else { | 312 | } else { |
314 | - // default top size is 10 | 313 | + // default annotate percent is 1 |
315 | - annotatePercent = 1; | 314 | + annotatePercent = 1.0f; |
316 | } | 315 | } |
317 | 316 | ||
318 | } catch (IOException e) { | 317 | } catch (IOException e) { | ... | ... |
... | @@ -46,7 +46,7 @@ public class ProcessingRunner implements ApplicationRunner { | ... | @@ -46,7 +46,7 @@ public class ProcessingRunner implements ApplicationRunner { |
46 | private Recommender recommender; | 46 | private Recommender recommender; |
47 | 47 | ||
48 | private int topSize; | 48 | private int topSize; |
49 | - private int annotatePercent; | 49 | + private float annotatePercent; |
50 | 50 | ||
51 | @Override | 51 | @Override |
52 | public void run(ApplicationArguments args) throws Exception { | 52 | public void run(ApplicationArguments args) throws Exception { |
... | @@ -151,7 +151,7 @@ public class ProcessingRunner implements ApplicationRunner { | ... | @@ -151,7 +151,7 @@ public class ProcessingRunner implements ApplicationRunner { |
151 | Properties properties = new Properties(); | 151 | Properties properties = new Properties(); |
152 | properties.load(in); | 152 | properties.load(in); |
153 | if (properties.containsKey("annotatePercent")) { | 153 | if (properties.containsKey("annotatePercent")) { |
154 | - annotatePercent = Integer.parseInt(properties.getProperty("annotatePercent")); | 154 | + annotatePercent = Float.parseFloat(properties.getProperty("annotatePercent")); |
155 | 155 | ||
156 | } else { | 156 | } else { |
157 | // default annotate percent is 0 | 157 | // default annotate percent is 0 | ... | ... |
-
Please register or login to post a comment