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

Fix masked inputs filtering in the base selector for regression tasks #86

Merged
merged 1 commit into from
Feb 11, 2024

Conversation

kachayev
Copy link
Collaborator

Closes #83.

import numpy as np
from sklearn.linear_model import LinearRegression
from skada import KLIEP

X_source = np.ones(10)
X_target = X_source

y_source = np.ones(10)
y_target = np.zeros(10)

from skada.datasets import DomainAwareDataset
dataset = DomainAwareDataset([(X_source, y_source, 's'), (X_target, y_target, 't')])
X, y, sample_domain = dataset.pack_train(as_sources=['s'], as_targets=['t'])

lr = LinearRegression()

kliep = KLIEP(base_estimator=lr)

kliep.fit(X.reshape(-1, 1), y, sample_domain=sample_domain)
kliep.predict(X.reshape(-1, 1))
Out[7]:
array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
       1., 1., 1.])

Copy link

codecov bot commented Feb 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (78d42f3) 87.34% compared to head (027a492) 87.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
+ Coverage   87.34%   87.35%   +0.01%     
==========================================
  Files          38       38              
  Lines        2433     2435       +2     
==========================================
+ Hits         2125     2127       +2     
  Misses        308      308              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kachayev kachayev merged commit 31ea1b0 into main Feb 11, 2024
11 of 12 checks passed
@kachayev kachayev deleted the fix-regression-mask-filtering branch February 11, 2024 17:54
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.

make_da_pipeline does not remove target labels during estimator fit
1 participant