Database Reference
In-Depth Information
// FIRST SESSION:
// Step 1 (product 1 clicked):
State state ¼ recoEnv.getState("1");
int[] recs ¼ recos(state, 1);
showRecs(state, recs);
learn(state, recs, 1.0);
// Step 2 (product 5 clicked and added to basket):
state ¼ recoEnv.getState("5");
recs ¼ recos(state, -1);
showRecs(state, recs);
learn(state, recs, 1.0 + 15.0);
// Step 3 (product 4 clicked):
state ¼ recoEnv.getState("4");
recs ¼ recos(state, -1);
showRecs(state, recs);
learn(state, recs, 1.0);
// ...further steps ...//
// Step 12 (product 6 clicked and added to basket):
state ¼ recoEnv.getState("6");
recs ¼ recos(state, -1);
showRecs(state, recs);
learn(state, recs, 1.0 + 4.5);
// Move to absorbing node in order to terminate first
session:
state ¼ recoEnv.getState("_a_");
learn(state, recs, 0.0);
// SECOND SESSION:
// Step 1 (product 6 clicked):
state ¼ recoEnv.getState("6");
recs ¼ recos(state, 1);
showRecs(state, recs);
learn(state, recs, 1.0);
// ...further steps and sessions ...//
}
The method recos calculates the recommendations using an
ε
-greedy policy:
/**
* Return recommendations for specified state.
*
* @param state the state
Search WWH ::




Custom Search