Closed LacombeLouis closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
614293e
) 100.00% compared to head (89c47a4
) 100.00%. Report is 256 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
Fix issue #410. This involves simplifying the type of check and making it more memory efficient.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
from mapie.regression import MapieQuantileRegressor
random_state = 26 rng = np.random.default_rng(random_state)
Generate a random train_data
n = 10000000 p = 10 X = rng.standard_normal((n, p)) beta = rng.standard_normal(p) y = X @ beta + rng.standard_normal(n)
X_train, X_test, y_train, y_test = train_test_split( X, y, train_size=0.8, random_state=random_state, shuffle=False, ) X_train, X_calib, y_train, y_calib = train_test_split( X_train, y_train, train_size=0.8, random_state=random_state, shuffle=False, )
print(X_test.shape, X_calib.shape, X_train.shape)
estimator = LGBMRegressor( objective="quantile", alpha=0.5, random_state=random_state )
mqr = MapieQuantileRegressor( estimator, method="quantile", cv="split", alpha=0.02 ) mqr.fit( X_train, y_train, X_calib=X_calib, y_calib=y_calib, random_state=random_state, )
y_pred, y_pis = mqr.predict(X_test) print("DONE!")