Skip to content

Conversation

@jer2ig
Copy link
Member

@jer2ig jer2ig commented Oct 27, 2025

Addition of logistic partially linear model.

Created PR to check for merging and review changes. Unit tests in work.

n_obs = x.shape[0]

smpls_is_partition = _check_is_partition(smpls, n_obs)
# TODO: Better name for smples_is_partition
Copy link
Member

Choose a reason for hiding this comment

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

I think this argument is fine. But we might set the default to True

Copy link
Member Author

@jer2ig jer2ig Nov 11, 2025

Choose a reason for hiding this comment

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

If we set it to true in its current form it doesn't really work. I've given the argument a new name, but I'm open to better ideas.

Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to just se the argument to is_partition with a default of True?

`sample splitting <https://docs.doubleml.org/stable/guide/resampling.html>`_ in the DoubleML user guide.
"""

_double_sample_splitting = False
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed right?

n_obs = x.shape[0]

smpls_is_partition = _check_is_partition(smpls, n_obs)
# TODO: Better name for smples_is_partition
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to just se the argument to is_partition with a default of True?

Copy link
Member

Choose a reason for hiding this comment

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

It would be great to move the dataset tests for the plr models to a separate test_datasets.py file in the plm/tests directory. The same is already done with the did datasets.

Number of inner folds for nested resampling used internally.
n_rep : int, default=1
Number of repetitions for sample splitting.
score : {'nuisance_space', 'instrument'} or callable, default='nuisance_space'
Copy link
Member

Choose a reason for hiding this comment

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

Callable is not implemented

super().__init__(obj_dml_data, n_folds, n_rep, score, draw_sample_splitting, double_sample_splitting=True)

self._error_on_convergence_failure = error_on_convergence_failure
self._coef_start_val = 1.0
Copy link
Member

Choose a reason for hiding this comment

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

Can be removed.



@pytest.mark.ci
def test_ssm_exception_resampling():
Copy link
Member

Choose a reason for hiding this comment

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

update name


# construct a classifier which is not identifiable as classifier via is_classifier by sklearn
log_reg = LogisticRegressionManipulatedType()
# TODO(0.11) can be removed if the sklearn dependency is bumped to 1.6.0
Copy link
Member

Choose a reason for hiding this comment

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

This should not be necessary anymore (dependency is already updated)

return res_dict


@pytest.mark.ci
Copy link
Member

Choose a reason for hiding this comment

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

Can you also add a test on the se ?

return self._smpls

@property
def smpls_inner(self):
Copy link
Member

Choose a reason for hiding this comment

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

Can you add this to the exception tests?

self : object
"""
if self._is_cluster_data:
if self._double_sample_splitting:
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test_sample_splitting_exceptions.py to test the exceptions from the mixin. In a later update i can move all specific sample splitting exceptions of the DoubleML class there.

@SvenKlaassen SvenKlaassen added the new feature new feature label Nov 11, 2025
@SvenKlaassen SvenKlaassen added this to the Release 0.11.0 milestone Nov 11, 2025
@SvenKlaassen SvenKlaassen linked an issue Nov 11, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Implement Logistic PLR Model

4 participants