Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: computed #2

Open
abdurrahimi opened this issue Feb 21, 2020 · 0 comments
Open

Undefined index: computed #2

abdurrahimi opened this issue Feb 21, 2020 · 0 comments

Comments

@abdurrahimi
Copy link

abdurrahimi commented Feb 21, 2020

Muncul error kaya gini gan Undefined index: computed
Kodenya kaya gini

$data = [
    [
        'text' => 'Filmnya bagus, saya suka',
        'class' => 'positif'
    ],
    [
        'text' => 'Filmnya menarik, aktingnya bagus',
        'class' => 'positif'
    ],
    [
        'text' => 'Saya suka film ini sangat keren',
        'class' => 'positif'
    ],
    [
        'text' => 'Film jelek, aktingnya payah.',
        'class' => 'negatif'
    ],
    [
        'text' => 'Kecewa, ini adalah film terburuk yang pernah saya tonton',
        'class' => 'negatif'
    ],
];

$nb = new NaiveBayes();

// mendefinisikan class target sesuai dengan yang ada pada data training.
$nb->setClass(['positif', 'negatif']);

// proses training
$nb->training($data);

// pengujian
echo $nb->predict('makin gak beres akibat uu kpk baru tahun kasus tak selesai kpk bisa henti kasus korupsi dalam tempo kurang dari');`
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant