#Tryout Lasso with multioutput
So now just replace your multioutput regression function with Lasso and chek out the results. This technique of trying various models and compare against baselinbe is helpful in determing the optimum solution.
#Write function Lasso reusing create_model function and passing appropriate paramters as instructed above your function signature will look like this and you will perform following operations
- Split X,y in x_train,x_test,y_train,y_test
- Create model by calling create_model
- Get its predictions on entire set and record them in res creating a model predicted feature set
- store all statistical error metrics in stats dataframe
| x_train | DataFrame | compulsory | | Independent variables training | | x_test| DataFrame | compulsory | | Independent variables testing| | y_train | DataFrame | compulsory | | training target| | y_test| DataFrame | compulsory | | testing target| | name| | compulsory | | name for stats| | alpha| | | | |
Return | dtype | description |
---|---|---|
G | Model | |
y_pred | predictions | |
stats | dataframe | store results-'cross_validation', 'rmse','mae','r2' with index as name |