Skip to main content
. 2018 May 20;20(5):385. doi: 10.3390/e20050385
Algorithm 1 The MOTiFS Algorithm
Load dataset and preprocess
Initialize SCALAR, BUDGET //Scaling factor & Number of MCTS simulations (hyper parameters)
function MOTiFS (featuresList)
  create rootNode
  maxReward, bestFeatureSubset ← UCTSEARCH (rootNode)
  return (maxReward, bestFeatureSubset)
function UCTSEARCH (rootNode)
  Initialize maxReward, bestFeatureSubset
  while within computational budget do
   frontNode ← TREEPOLICY (rootNode)
   reward, featureSubset ← DEFAULTPOLICY (frontNode.state)
   BACKUP (frontNode, reward)
   if reward is greater than maxReward then
    maxRewardreward
    bestFeatureSubsetfeatureSubset
  return (maxReward, bestFeatureSubset)
function TREEPOLICY (node)
  while node is non-terminal do
   if node not fully expanded then
    return EXPAND (node)
   else
    node ← BESTCHILD (node, SCALAR)
  return node
function EXPAND (node)
  choose a untried actions from A(node.state)
  add a newChild with f(node.state, a)
  return newChild
function BESTCHILD (v, C)
  return maxv children of vmax(Qv)+C2 × ln(v.visits)v.visits
function DEFAULTPOLICY (state)
  while state is non-terminal do
   choose a A(state) uniformly at random
  state ← f(state, a)
traverse state.path
   if ai is equal to fi+1 then
    featureSubset ← INCLUDE (fi+1)
   reward ← REWARD (featureSubset)
   return (reward, featureSubset)
function BACKUP (node, reward)
  while node is not null do
   node.visitsnode.visits + 1
   if reward > node.reward then
    node.rewardreward
   nodenode.parent
  return