Skip to content

Commit

Permalink
Adjust tuned knn params
Browse files Browse the repository at this point in the history
  • Loading branch information
st3iny committed Oct 17, 2024
1 parent a0a4663 commit fb2475f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Service/Classification/ImportanceClassifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use Rubix\ML\Datasets\Unlabeled;
use Rubix\ML\Estimator;
use Rubix\ML\Kernels\Distance\Manhattan;
use Rubix\ML\Kernels\Distance\Jaccard;
use Rubix\ML\Learner;
use Rubix\ML\Persistable;
use Rubix\ML\Transformers\TfIdfTransformer;
Expand Down Expand Up @@ -133,10 +134,8 @@ public function __construct(MailboxMapper $mailboxMapper,
private static function createDefaultEstimator(): KNearestNeighbors {
// A meta estimator was trained on the same data multiple times to average out the
// variance of the trained model.
// Parameters were chosen from the best configuration across 100 runs.
// Both variance (spread) and f1 score were considered.
// Note: Lower k values yield slightly higher f1 scores but show higher variances.
return new KNearestNeighbors(15, true, new Manhattan());
// Parameters were chosen from the best configuration across 20 runs.
return new KNearestNeighbors(35, true, new Jaccard());
}

private function filterMessageHasSenderEmail(Message $message): bool {
Expand Down

0 comments on commit fb2475f

Please sign in to comment.