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

Initial TD-IDF work #14

Closed
wants to merge 13 commits into from
Closed

Initial TD-IDF work #14

wants to merge 13 commits into from

Conversation

rawoke083
Copy link
Contributor

Added in TD-IDF support to use instead of plain word counts ! Works very well ! Lots of extra accuracy.
See updated README for usage.

@rawoke083
Copy link
Contributor Author

Bump ?

@jbrukh
Copy link
Owner

jbrukh commented Aug 20, 2016

Thanks, will review in the next days. Please run gofmt on the source.

@rawoke083
Copy link
Contributor Author

Oh ofcourse ! Will run and update pull request !

On 20 Aug 2016 09:30, "Jake Brukhman" notifications@github.com wrote:

Thanks, will review in the next days. Please run gofmt on the source.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#14 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AFRfpKDxlgm5jS47jyh9ChbZZdj9h7Eoks5qhq0VgaJpZM4JOnEo
.

seen int // docs seen
datas map[Class]*classData
tfIdf bool
didConvertTDIDF bool //we can't classify a TD-IDF classifier if we haven't yet
Copy link
Owner

Choose a reason for hiding this comment

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

Change to didConvertTfIdf; fix comment, should read: TF-IDF.

Copy link
Owner

Choose a reason for hiding this comment

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

Please add space after //.

@jbrukh
Copy link
Owner

jbrukh commented Aug 22, 2016

Thanks for your patch. Added some comments.

Please add some tests.

@rawoke083
Copy link
Contributor Author

rawoke083 commented Aug 22, 2016

@jbrukh No problem. Will add in the next few days !

@@ -37,7 +43,7 @@ See the GoPkgDoc documentation [here](https://godoc.org/github.com/jbrukh/bayesi
- Statistics.

------------
### Example
### Example 1 (plain no td-idf)
Copy link
Owner

Choose a reason for hiding this comment

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

Change to "tf-idf".

@@ -142,7 +149,7 @@ func (d *classData) getWordsProb(words []string) (prob float64) {
// NewClassifier returns a new classifier. The classes provided
Copy link
Owner

Choose a reason for hiding this comment

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

Update docs.

func (c *Classifier) ConvertTermsFreqToTFIDF() {

if c.didConvertTfIdf {
panic("Error:TfIdf-Mode:Cumulative counts - can only call this once. Reset and relearn.")
Copy link
Owner

Choose a reason for hiding this comment

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

Change message to "Cannot call ConvertTermsFreqToTfIdf more than once. Reset and relearn to reconvert."

@jbrukh
Copy link
Owner

jbrukh commented Aug 24, 2016

Thanks for the work. Mostly looks good. Please resolve conflicts with master and we can almost merge. :)

Thank you!

@rawoke083
Copy link
Contributor Author

Cool did resolve some on local branch. Having some difficulties ! Going to
cancel pull request and create new p.r (without conflicts)

On 24 Aug 2016 21:31, "Jake Brukhman" notifications@github.com wrote:

Thanks for the work. Mostly looks good. Please resolve conflicts with
master and we can almost merge. :)

Thank you!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#14 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AFRfpMORetlsfv55COIni-NUFxvi9pS8ks5qjJv_gaJpZM4JOnEo
.

@rawoke083 rawoke083 closed this Aug 24, 2016
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

Successfully merging this pull request may close these issues.

2 participants