text_plain_output_1.png
from sklearn.ensemble import RandomForestRegressor

from sklearn.ensemble import StackingRegressor

from sklearn.linear_model import RidgeCV

from sklearn.svm import LinearSVR

import warnings

from sklearn.linear_model import RidgeCV
from sklearn.svm import LinearSVR
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import StackingRegressor
import warnings
warnings.filterwarnings('ignore')
estimators = [('lr', RidgeCV()), ('svr', LinearSVR(random_state=42, max_iter=1000))]
regStack = StackingRegressor(estimators=estimators, final_estimator=RandomForestRegressor(n_estimators=10, random_state=42))
regStack.fit(X_train, Y_train)
print('train score', regStack.score(X_train, Y_train))
print('test score', regStack.score(X_test, Y_test))