Git Product home page Git Product logo

Comments (5)

abh avatar abh commented on July 29, 2024 1

MostLikelyClass() seems like a good compromise..

from bayesian.

jbrukh avatar jbrukh commented on July 29, 2024

Fair point, all. Will look into it.

from bayesian.

mycalf avatar mycalf commented on July 29, 2024

@donatj

func (c *Classifier) GetClass(intx int) string { return string(c.Classes[intx]) }

from bayesian.

donatj avatar donatj commented on July 29, 2024

@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.

jbrukh avatar jbrukh commented on July 29, 2024

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:

  1. Return the index and the class. (Starting to overly crowd in the return prototype, IMO.)
  2. Add an auxiliary GetClass function as @mycalf suggests. (Clunky.)
  3. Return a map which maps classes to scores. (More memory intensive.)
  4. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.