Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2017-05-04 10:55:31 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
334f6d3cdd7d2f7b72ac2b70a5f0eaea37f2e260
334f6d3c
1 parent
e2c7ff0e
Passage de Set en List pour les ensembles de recommandations (suite) et piur l'e…
…nsemble des utilisateurs.
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
grog-recommendation/grog-recommendation-process/src/main/java/org/legrog/recommendation/process/ProcessingExpert.java
grog-recommendation/grog-recommendation-process/src/main/java/org/legrog/recommendation/process/ProcessingRunner.java
grog-recommendation/grog-recommendation-process/src/main/java/org/legrog/recommendation/process/ProcessingExpert.java
View file @
334f6d3
...
...
@@ -18,7 +18,7 @@ public class ProcessingExpert {
this
.
topSize
=
topSize
;
}
public
ProcessingRecommendations
getRecommendations
(
Se
t
<
Long
>
userIds
)
{
public
ProcessingRecommendations
getRecommendations
(
Lis
t
<
Long
>
userIds
)
{
ProcessingRecommendations
processingRecommendations
=
new
ProcessingRecommendations
();
List
<
ScoredId
>
recommendations
;
for
(
Long
userId
:
userIds
)
{
...
...
grog-recommendation/grog-recommendation-process/src/main/java/org/legrog/recommendation/process/ProcessingRunner.java
View file @
334f6d3
...
...
@@ -11,9 +11,7 @@ import org.springframework.boot.ApplicationRunner;
import
org.springframework.stereotype.Component
;
import
java.io.*
;
import
java.util.HashSet
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.*
;
@Component
public
class
ProcessingRunner
implements
ApplicationRunner
{
...
...
@@ -46,7 +44,7 @@ public class ProcessingRunner implements ApplicationRunner {
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
loadParameters
();
logger
.
trace
(
"Parameters loaded"
);
Se
t
<
Long
>
userIds
=
loadUserIdsFromSample
();
Lis
t
<
Long
>
userIds
=
loadUserIdsFromSample
();
RecommenderFactory
recommenderFactory
=
new
RecommenderFactory
();
recommender
=
recommenderFactory
.
build
(
algorithm
,
dataDir
+
sampleFilename
);
logger
.
trace
(
"Recommender built"
);
...
...
@@ -57,8 +55,8 @@ public class ProcessingRunner implements ApplicationRunner {
logger
.
trace
(
"Recommendations written"
);
}
private
Se
t
<
Long
>
loadUserIdsFromSample
()
throws
ProcessingException
{
Set
<
Long
>
userIds
=
new
HashSe
t
<>();
private
Lis
t
<
Long
>
loadUserIdsFromSample
()
throws
ProcessingException
{
List
<
Long
>
userIds
=
new
ArrayLis
t
<>();
Reader
in
=
null
;
try
{
...
...
@@ -81,7 +79,7 @@ public class ProcessingRunner implements ApplicationRunner {
CSVPrinter
csvPrinter
=
new
CSVPrinter
(
new
FileWriter
(
new
File
(
dataDir
,
recommandationsFilename
)),
CSVFormat
.
TDF
.
withHeader
(
"itemId"
,
"userId"
));
// TODO : finish
Se
t
<
RecommendationElement
>
recommendations
=
processingRecommendations
.
getRecommendations
();
Lis
t
<
RecommendationElement
>
recommendations
=
processingRecommendations
.
getRecommendations
();
if
(
recommendations
.
isEmpty
())
{
logger
.
trace
(
"No recommendations at all"
);
}
else
{
...
...
Please
register
or
login
to post a comment