Case 4. MLP for nonlinear phishing risk (RubixML)

Implementation in RubixML

We solve this task with a multilayer neural network. In this case, phishing risk is estimated from two features: employee security-awareness level and current workload. The dependency can be nonlinear, so we use an MLP (Multilayer Perceptron) from RubixML: build a labeled dataset, standardize features with ZScaleStandardizer, train the model, and get a prediction for a new employee profile.

 
<?php

use Rubix\ML\Datasets\Unlabeled;

include 
'code.php';

$inputSample = [46];
$predictDataset = new Unlabeled([$inputSample]);
$predictDataset->apply($standardizer);
$prediction $model->predict($predictDataset);

echo 
'Phishing risk prediction:' PHP_EOL;
echo 
'"' $prediction[0] . '"' PHP_EOL;

Documents:

[1, 6] => risk
[5, 3] => safe
[10, 1] => risk
[3, 7] => safe

Check: [4, 6]
Result: Memory: 1.379 Mb Time running: 0.063 sec.
Phishing risk prediction:
"safe"