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

[FLINK-24817] Add Estimator and Transformer for Naive Bayes #32

Closed
wants to merge 1 commit into from

Conversation

yunfengzhou-hub
Copy link
Contributor

@yunfengzhou-hub yunfengzhou-hub commented Nov 11, 2021

What is the purpose of the change

This PR adds the implementation of Naive Bayes algorithm to Flink ML. This algorithm is implemented in reference to that implemented in Alibaba Alink and Apache Spark, but it uses Flink ML's framework and Flink Datastream.

Brief change log

This PR adds public classes NaiveBayes. Users can use NaiveBayes to do training and inference according to the algorithm with the same name. Users can also use MultiStringIndexer to convert strings into indices.

Verifying this change

The changes are tested by unit tests in NaiveBayesTest.

Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): (yes)
The public API, i.e., is any changed class annotated with @public(Evolving): (yes)

Documentation

Does this pull request introduce a new feature? (yes)
If yes, how is the feature documented? (Java doc)

Copy link
Contributor

@zhipeng93 zhipeng93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, Yunfeng!

Overall it looks good to me. I left some minor comments here.

By the way, could you also reformat the code by mvn spotless:apply?

Copy link
Member

@lindong28 lindong28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Left some comments below.

Copy link
Member

@lindong28 lindong28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Left some comments below.

It looks like mvn package fails due to stylecheck error. Could you make sure mvn package works?

Copy link
Member

@lindong28 lindong28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Left some comments below.

Copy link
Member

@lindong28 lindong28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @yunfengzhou-hub. I left some minor comments regarding the code readability.

Copy link
Member

@lindong28 lindong28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @yunfengzhou-hub. Left only some minor comments below.

@lindong28
Copy link
Member

Thanks for the update! LGTM. @gaoyunhaii could you help review this PR?

@yunfengzhou-hub yunfengzhou-hub changed the title [FLINK-24817] Add Naive Bayes implementation [FLINK-24817] Add Estimator and Transformer for Naive Bayes Dec 9, 2021
Copy link
Contributor

@gaoyunhaii gaoyunhaii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very thanks @yunfengzhou-hub for the updates! LGTM and +1 to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants