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

Missing code examples in documentation #3

Closed
ankurankan opened this issue Mar 31, 2021 · 5 comments
Closed

Missing code examples in documentation #3

ankurankan opened this issue Mar 31, 2021 · 5 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@ankurankan
Copy link

ankurankan commented Mar 31, 2021

In the documentation at https://d-k-e.github.io/graphical-models/html/index.html, I can see an example of PGModel but for other model types, there are no code examples. Also, it would be nice if you could use a real dataset/model for the examples, but if you are using a toy example, it would be helpful if you could describe it a bit before the code.

Ref: openjournals/joss-reviews#3115

@D-K-E
Copy link
Owner

D-K-E commented Apr 5, 2021

Generally speaking, if some functionality does not have a unittest associated to it, I don't mention it. So far I could not find test cases for MarkovNetwork and the ConditionalRandomField. I am fairly sure of their functionality because all of the work is done by PGModel and that is truly tested. I would really appreciate if you can point out to test cases covering markov network and conditional random fields' functionality.

I also thought about the real dataset/model suggestion before as well. However io and model specification is something I am avoiding for now. I'd like to stick to toy examples for testing the core functionality. I'll think of an io strategy later on.
The problem is since I define factors as functions, it is easier to work with them statically. For a reasonable io strategy, I need to generate factor functions dynamically. I might use f string literals or decorators or something else. I have not thought about it yet and I don't plan to at this stage if you don't mind.

I also think toy examples I provide seem a little too ad hoc. What would you prefer to see as a description for toy examples ? Would you mind giving an example ?

@ankurankan
Copy link
Author

@D-K-E Thanks for the clarification. For the description, I just meant describing the problem statement that the code example is trying to solve in simple words. An example could be the Monte Hall problem example in pgmpy here: https://github.com/pgmpy/pgmpy/blob/dev/examples/Monty%20Hall%20Problem.ipynb. The notebook gives a context of the Monte Hall problem (which is a toy example) and how you would solve something like that using pgmpy.

@D-K-E
Copy link
Owner

D-K-E commented May 1, 2021

@ankurankan I added some new tests and added a usage examples under Related Pages section of the documentation.
As of now, all sub classes of PGModel that is all that can be subjected to inference are documented.

Most my examples are toy examples taken from text books. I'll try to add more real world examples when I have a bit more time.
How does it look ?

@D-K-E D-K-E added documentation Improvements or additions to documentation good first issue Good for newcomers labels May 3, 2021
@D-K-E D-K-E pinned this issue May 3, 2021
@ankurankan
Copy link
Author

@D-K-E The examples look good, but I am getting errors in running all of them (except the first one). Could you please check?

@D-K-E
Copy link
Owner

D-K-E commented May 6, 2021

@ankurankan All right, they all should have been fixed now, both in the documentation and the newly added jupyet notebooks

@D-K-E D-K-E unpinned this issue May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants