Comments (5)
MostLikelyClass() seems like a good compromise..
from bayesian.
Fair point, all. Will look into it.
from bayesian.
func (c *Classifier) GetClass(intx int) string { return string(c.Classes[intx]) }
from bayesian.
@mycalf I don't see that in the API.
func (c *Classifier) GetClass(intx int) Class { return c.Classes[intx] }
Returning the actual Class would be more useful than string, but to me it would still make far more sense for the API to return the class rather than the class index throughout.
from bayesian.
After reviewing:
I'm recalling that the reason I am returning the scores and an index is because different applications may wish to examine the actual scores across all potential classes. If I return a Class and not an index, then I also have no (ready) way of determining what the actual score was for the most likely class. So, some solutions:
- Return the index and the class. (Starting to overly crowd in the return prototype, IMO.)
- Add an auxiliary
GetClass
function as @mycalf suggests. (Clunky.) - Return a map which maps classes to scores. (More memory intensive.)
- Add helper methods like
MostLikelyClass()
to encapsulate the complexity of looking up the class if the scores are not being considered. (My recommendation.)
Thoughts?
from bayesian.
Related Issues (11)
- Prior probability includes word frequencies?
- Seen() is always 0? HOT 1
- Allow classifier to initialise with only one class HOT 1
- request for a tag of an older commit
- Request for a new function that will enable adding of new class to an existing classifier
- Release 1.0 is really old - make a new release HOT 5
- Wrong package name in docs
- what is good or bad?
- Add classes after classifier creation HOT 7
- Panic if underflow is detected in `SafeProbScores` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bayesian.