Jean-Francois Leveque

Annotation en pourcentage float et plus de contrôle d'annotation sur les solitaires.

......@@ -50,7 +50,7 @@ public class PreprocessingRunner implements ApplicationRunner {
private Boolean ratings;
private int annotatePercent;
private float annotatePercent;
@Override
public void run(ApplicationArguments applicationArguments) throws Exception {
......@@ -161,8 +161,6 @@ public class PreprocessingRunner implements ApplicationRunner {
logger.debug("Remaining AssociationElement count {}", associationElements.size());
logger.debug("Remover item or user {}", removedUser || removedItem);
return associationElements;
}
......@@ -180,6 +178,7 @@ public class PreprocessingRunner implements ApplicationRunner {
randomInteger = new Integer(random.nextInt(size));
if (!annotatedChosen.contains(randomInteger)) {
/* Annotation sans contrôle
randomAssociationElement = annotableElements.get(randomInteger);
final Long itemId = randomAssociationElement.getItemId();
final Long userId = randomAssociationElement.getUserId();
......@@ -199,10 +198,10 @@ public class PreprocessingRunner implements ApplicationRunner {
}
}
if (userCount > userSize && itemCount > itemSize) {
if (userCount > userSize && itemCount > itemSize) {*/
annotatedChosen.add(randomInteger);
logger.debug("Adding new AssociationElement to annotated, total is {}", annotatedChosen.size());
}
// logger.debug("Adding new AssociationElement to annotated, total is {}", annotatedChosen.size());
// }
}
}
......@@ -309,10 +308,10 @@ public class PreprocessingRunner implements ApplicationRunner {
}
if (properties.containsKey("annotatePercent")) {
annotatePercent = Integer.parseInt(properties.getProperty("annotatePercent"));
annotatePercent = Float.parseFloat(properties.getProperty("annotatePercent"));
} else {
// default top size is 10
annotatePercent = 1;
// default annotate percent is 1
annotatePercent = 1.0f;
}
} catch (IOException e) {
......
......@@ -46,7 +46,7 @@ public class ProcessingRunner implements ApplicationRunner {
private Recommender recommender;
private int topSize;
private int annotatePercent;
private float annotatePercent;
@Override
public void run(ApplicationArguments args) throws Exception {
......@@ -151,7 +151,7 @@ public class ProcessingRunner implements ApplicationRunner {
Properties properties = new Properties();
properties.load(in);
if (properties.containsKey("annotatePercent")) {
annotatePercent = Integer.parseInt(properties.getProperty("annotatePercent"));
annotatePercent = Float.parseFloat(properties.getProperty("annotatePercent"));
} else {
// default annotate percent is 0
......