cylab / mark-php-client
A PHP client for the MARK framework
    1.8.0
    2021-09-16 12:02 UTC
Requires
- cylab-be/php-roc: ^1.1
 - fguillot/json-rpc: ^1.2
 - nesbot/carbon: ^2.41.3
 - symfony/console: ^5.3
 
Requires (Dev)
- phpstan/phpstan: ^0.12.48
 - phpunit/phpunit: ^8.5
 - slevomat/coding-standard: ^6.4
 - squizlabs/php_codesniffer: ^3.5
 
README
A PHP client for the MARK framework
Local testing
docker-compose up
The docker-compose will also start a web interface at http://127.0.0.1:8000
- Username: 
`mark-admin@cylab.be` - Password: 
`change-me!` 
You can now
- run unit tests: 
`./vendor/bin/phpunit` - use the CLI (see below)
 - write your own scripts (see examples below)
 
CLI
The MARk PHP client is also a small command line tool that allows to query a MARk server
Ranking
php src/Main.php ranking detection.example
will produce:
Score      | Subject                                 
------------------------------------
0.83987058 | Georgi                                  
0.56913326 | Wim                                     
0.45586617 | Paloma                                  
0.42554451 | Fred                                    
0.37306698 | Alex                                    
0.24606320 | Zac                                     
0.19540481 | Tibo  
ROC
Examples
Detector parameters
To change the parameters of a detector:
require __DIR__ . "/../vendor/autoload.php";
use Cylab\Mark\Client;
$label = "detection.max.1h";
$client = new Client();
$detector = $client->getDetector($label);
// modify the parameters of this detector
$detector->parameters["window"] = random_int(123, 123123);
$client->setDetector($detector);
Each time you run this script, the `window` parameter of the detector will be replaced by a random value:
