diff --git a/docs/user_guide.rst b/docs/user_guide.rst index 374313a..90de0ae 100755 --- a/docs/user_guide.rst +++ b/docs/user_guide.rst @@ -37,7 +37,7 @@ This approach was first proposed by :cite:t:`2006:meinshausen`. Fitting and Predicting ---------------------- -Quantile forests can be fit and used to predict like standard scikit-learn estimators. In this package, the quantile forests extend standard scikit-learn forest regressors and inherent their model parameters, in addition to offering additional parameters related to quantile regression. We'll discuss the many of the important model parameters below. +Quantile forests can be fit and used to predict like standard scikit-learn estimators. In this package, the quantile forests extend standard scikit-learn forest regressors and inherent their model parameters, in addition to offering additional parameters related to quantile regression. We'll discuss many of the important model parameters below. Fitting a Model ~~~~~~~~~~~~~~~ diff --git a/examples/plot_quantile_multioutput.py b/examples/plot_quantile_multioutput.py index c3244b9..c42837c 100755 --- a/examples/plot_quantile_multioutput.py +++ b/examples/plot_quantile_multioutput.py @@ -5,7 +5,7 @@ An example on a toy dataset that demonstrates fitting a single quantile regressor for multiple target variables. For each target, multiple quantiles -can be estimated. +can be estimated simulatenously. """ @@ -29,7 +29,7 @@ ] -def make_func_Xy(funcs, bounds, n_samples): +def make_Xy(funcs, bounds, n_samples): x = np.linspace(bounds[0], bounds[1], n_samples) y = np.empty((len(x), 3)) y[:, 0] = funcs[0](x) + np.random.normal(scale=0.01 * np.abs(x)) @@ -38,7 +38,7 @@ def make_func_Xy(funcs, bounds, n_samples): return x, y -X, y = make_func_Xy(funcs, bounds, n_samples) +X, y = make_Xy(funcs, bounds, n_samples) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=0) qrf = RandomForestQuantileRegressor(random_state=0) @@ -49,7 +49,9 @@ def make_func_Xy(funcs, bounds, n_samples): def plot_multioutputs(colors, funcs, X, y): for i in range(y.shape[-1]): - plt.fill_between(X, y_pred[:, 0, i], y_pred[:, 2, i], color=colors[i], label=f"Target {i}") + y1 = y_pred[:, 0, i] + y2 = y_pred[:, 2, i] + plt.fill_between(X, y1, y2, color=colors[i], label=f"Target {i}") plt.plot(X, funcs[i](X), c="black") plt.xlim(bounds) plt.ylim([-8, 8]) diff --git a/quantile_forest/_quantile_forest.py b/quantile_forest/_quantile_forest.py index 7fa06a0..4dd43c4 100755 --- a/quantile_forest/_quantile_forest.py +++ b/quantile_forest/_quantile_forest.py @@ -535,13 +535,6 @@ def predict( if not isinstance(interpolation, (bytes, bytearray)): interpolation = interpolation.encode() - if weighted_leaves and not weighted_quantile: - warn( - "`weighted_leaves` is True, but is only used if `weighted_quantile=True`. " - "`weighted_leaves` will be set to False." - ) - weighted_leaves = False - if oob_score: if not self.bootstrap: raise ValueError("Out-of-bag estimation only available if bootstrap=True.")