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

Improve Display for naive_bayes #225

Open
1 task done
Mec-iS opened this issue Nov 3, 2022 · 1 comment · May be fixed by #241
Open
1 task done

Improve Display for naive_bayes #225

Mec-iS opened this issue Nov 3, 2022 · 1 comment · May be fixed by #241
Labels
good first issue Good for newcomers
Milestone

Comments

@Mec-iS
Copy link
Collaborator

Mec-iS commented Nov 3, 2022

I'm submitting a

  • feature request.

Current Behaviour:

Currently println!("{}", &gnb) prints:

GaussianNB:
inner: BaseNaiveBayes { distribution: GaussianNBDistribution { class_labels: [0, 1, 2], class_count: [50, 50, 50], class_priors: [0.3333333333333333, 0.3333333333333333, 0.3333333333333333], var: [[0.12176398698426993, 0.1422760001411465, 0.0295040034446723, 0.01126400058841702], [0.26110400788880384, 0.09650000076294418, 0.21639999752045114, 0.03832399889564586], [0.3962559386291673, 0.10192399745559833, 0.2984959836425922, 0.07392400431251556]], theta: [[5.006000003814697, 3.41800000667572, 1.4639999961853027, 0.24400000482797624], [5.935999975204468, 2.770000009536743, 4.259999980926514, 1.3259999918937684], [6.588000001907349, 2.9739999914169313, 5.551999988555909, 2.0259999775886537]] }, _phantom_tx: PhantomData, _phantom_ty: PhantomData, _phantom_x: PhantomData, _phantom_y: PhantomData }

Expected Behaviour:

For every structure implementing BaseNaiveBayes should display:

GaussianNB:
    inner: BaseNaiveBayes {
    distribution: GaussianNBDistribution {
       class_labels: [0, 1, 2],
       class_count: [50, 50, 50],
       class_priors: [0.3333333333333333, 0.3333333333333333, 0.3333333333333333],
       var: [[0.12176398698426993, 0.1422760001411465, 0.0295040034446723, 0.01126400058841702], [0.26110400788880384, 0.09650000076294418, 0.21639999752045114, 0.03832399889564586], [0.3962559386291673, 0.10192399745559833, 0.2984959836425922, 0.07392400431251556]],
       theta: [[5.006000003814697, 3.41800000667572, 1.4639999961853027, 0.24400000482797624], [5.935999975204468, 2.770000009536743, 4.259999980926514, 1.3259999918937684], [6.588000001907349, 2.9739999914169313, 5.551999988555909, 2.0259999775886537]]
}}

Steps to reproduce:

See tests with:

let gnb = GaussianNB::fit(&x, &y, parameters).unwrap();
println!("{}", &gnb);
@Mec-iS Mec-iS added the good first issue Good for newcomers label Nov 3, 2022
@Mec-iS Mec-iS added this to the v0.5 milestone Nov 3, 2022
@m7142yosuke m7142yosuke linked a pull request Nov 16, 2022 that will close this issue
3 tasks
@Mec-iS
Copy link
Collaborator Author

Mec-iS commented Nov 16, 2022

see also #197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant