Skip to content

Update ModelBuilder to show regression lines #538

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

Merged
merged 4 commits into from
Apr 6, 2023

Conversation

BerylKanali
Copy link
Contributor

@cluhmann Here is the PR from yesterday's session. I worked on it with @Monsurat-Onabajo

Towards #530
cc: @fonnesbeck @reshamas

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

marker="x",
label="predict",
),
ax.plot(
Copy link
Member

Choose a reason for hiding this comment

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

The changes are modifying an x vs y plot to two line plots where the x axis is always an arange and the y axis is mapped to the values in the 1st plot and to the y values in the 2nd plot. Mapping these two different quantities to the same axis is definitely wrong and should be changed. I think what @fonnesbeck wanted in the issue was having both scatter x vs y of the predictions along with the x vs y of the regressions lines from the model that generated those predictions. It would have a similar look to the last image in https://www.pymc.io/projects/examples/en/latest/generalized_linear_models/GLM-robust.html but with the x_pred / pred_means["y"] as the scatter instead of truth valued and no true regression line

Choose a reason for hiding this comment

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

Ok, I get the picture now, I will work on it

@twiecki
Copy link
Member

twiecki commented Apr 2, 2023

We also recently changed the API of ModelBuilder (slightly), are you interested in bringing this example up-to-date? Here is the PR: pymc-devs/pymc-extras#131

@Monsurat-Onabajo
Copy link

Monsurat-Onabajo commented Apr 3, 2023

When I tried to plot the graph of the truth values and the predicted values in one figure, I got this graph and upon investing further, I noticed the truth value data is more of a wavelength dataset than a regression dataset. That was probably the reason a line can't be used as a connector because there is no pattern in the data for the graph to be formed on.

20230403_215738~2

@Monsurat-Onabajo
Copy link

Monsurat-Onabajo commented Apr 3, 2023

This was when I tried to plot the true value using scattered plot to check the trend
16806072262584167303588619519001

@twiecki
Copy link
Member

twiecki commented Apr 4, 2023

@Monsurat-Onabajo The upload didn't work, you might have to wait a bit longer.

@Monsurat-Onabajo
Copy link

@Monsurat-Onabajo The upload didn't work, you might have to wait a bit longer.

I have uploaded it again

@OriolAbril
Copy link
Member

@Monsurat-Onabajo @BerylKanali if you don't mind waiting we can take a look this Thursday, maybe it is easier to solve in the sync session

@BerylKanali
Copy link
Contributor Author

@Monsurat-Onabajo @BerylKanali if you don't mind waiting we can take a look this Thursday, maybe it is easier to solve in the sync session

@OriolAbril Sure. We can look at it then.

@OriolAbril OriolAbril linked an issue Apr 6, 2023 that may be closed by this pull request
@BerylKanali
Copy link
Contributor Author

BerylKanali commented Apr 6, 2023

@fonnesbeck I made additional changes with the guidance of @OriolAbril
cc: @Monsurat-Onabajo

@OriolAbril OriolAbril merged commit 41dd3a7 into pymc-devs:main Apr 6, 2023
@Monsurat-Onabajo
Copy link

@fonnesbeck I made additional changes with the guidance of @OriolAbril cc: @Monsurat-Onabajo

Goodjob beryl

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.

ModelBuilder notebook is missing predicted regression lines
4 participants