config = $config; $this->dataSet = $dataSet; $this->strategy = $strategy; } public function run(Environment $environment) { // TODO: only works if the app is placed into a sub-sub directory of Nextcloud require_once __DIR__ . '/../../../../lib/base.php'; // Prevent getting killed by a timeout if (strpos(ini_get('disable_functions'), 'set_time_limit') === false) { set_time_limit(0); } /** @var DataLoader $loader */ $loader = \OCP\Server::get(DataLoader::class); $data = $loader->generateRandomShuffledData($this->dataSet, $this->config, $this->strategy); /** @var Trainer $trainer */ $trainer = \OCP\Server::get(Trainer::class); return $trainer->train( $this->config, $data, $this->strategy ); } }