Algortima Apriori Dengan PHP

ublic function apriori () {
        $associator = new Apriori($support = 0.5, $confidence = 0.5);
        $samples = [['alpha', 'beta', 'epsilon'], ['alpha', 'beta', 'theta'], ['alpha', 'beta', 'epsilon'], ['alpha', 'beta', 'theta']];
        $labels  = [];

        $associator = new Apriori($support = 0.5, $confidence = 0.5);
        $associator->train($samples, $labels);

        echo dd($associator->predict(['alpha','theta'])); ; //prediksi hasil

        echo dd($associator->getRules()) ; //melihat pola

        echo dd($associator->apriori()) ;
    
    }

https://php-ml.readthedocs.io/en/latest/machine-learning/association/apriori/

 2,503 total views

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *