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

Fixes #301 and some other issues #354

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kdergachev
Copy link

  • in pygam.GAM._modelmat added selection of features, edge_knots and dtypes by term so only the necessary features are checked and features for factor terms can be set to 0 or 1 if another term is being checked
  • in pygam.GAM._flatten_mesh added two lines that set by feature to 1 if not None. This fixes issue of partial dependence of tensor terms being 0 everywhere if by feature is present
  • in pygam.GAM.partial_dependence removed check_X as right after it is checked in self._modelmat
  • updated docstring of pygam.GAM._linear_predictor
  • removed line that does nothing in terms.SplineTerm.build_column

This should fix the problem in #301 and some others that #302 might not, e.g. I believe it might break due to factor feature being set to 1.0 if it is a by feature in another term. Along the way found that by feature in tensor term is not set to 1 anywhere so partial dependence returns all 0. As _meshgrid seems to be written specifically for partial_dependence and generate_X_grid made it set by feature to 1 if not None.

* in pygam.GAM._modelmat added selection of features, edge_knots and
  dtypes by term so only the necessary features are checked and features
  for factor terms can be set to 0 or 1 if another term is being checked

* in pygam.GAM._flatten_mesh added two lines that set by feature to 1 if
  not None. This fixes issue of partial dependence of tensor terms being
  0 everywhere if by feature is present

* in pygam.GAM.partial_dependence removed check_X as right after it is
  checked in self._modelmat

* updated docstring of pygam.GAM._linear_predictor

* removed line that does nothing in terms.SplineTerm.build_column
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.

1 participant