In [1]:
import monk.core.api as monkapi
In [2]:
from monk.roles.configuration import get_config
In [4]:
config = get_config('monk_config.yml', 'console', '')
In [8]:
from monk.roles.administrator import AdminBroker as AB
In [9]:
from monk.roles.worker import WorkerBroker as WB
In [10]:
from monk.roles.monitor import MonitorBroker as MB
In [11]:
ab = AB(config.kafkaConnectionString, config.administratorGroup, config.administratorTopic, producerType=AB.FIXED_PRODUCER, producerPartitions=[0])
In [13]:
wb = WB(config.kafkaConnectionString, config.workerGroup, config.workerTopic, producerType=WB.USER_PRODUCER)
In [15]:
wb.reconnect()
In [16]:
mb = MB(config.kafkaConnectionString, config.monitorGroup, config.monitorTopic, producerType=MB.FIXED_PRODUCER, producerPartitions=[0])
In [17]:
ls
In [18]:
import exper
In [20]:
userFactors, itemFactors = exper.readModel("ml1m-bmf-80.model")
In [21]:
userFactors.shape
Out[21]:
In [22]:
itemFactors.shape
Out[22]:
In [23]:
monkapi.initialize(config)
Out[23]:
In [25]:
users = monkapi.crane.userStore.load_all({},['partition','name'])
In [ ]: