Question

I have started an MLS course. As a beginner and non-mathematician it has been hard.

I am trying to understand the exercise about Lasso Models. I have done Lasso models on R-cran, but this is my first time with Python.

I have a dataset of cars with seven variables. The exercise consists on doing a Lasso Model to predict the gasoline consumption of the cars, the dependent variable, so $x$ is a table with the rest of variables and $y$ is the consumption.

Then, if I launch Lasso on scikitlearn:

modelLasso = Lasso(alpha=0.1).fit(x, y)
  • I do not understand the result. Has it generated a prediction on $y$ of every row in the table?

  • If so, how can I access to the array of predictions of the model and how do I use the model to predict the consumption given new $x$ values?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with datascience.stackexchange
scroll top