Skip to main content
Minor grammar / formatting
Source Link
Stephen Rauch
  • 1.8k
  • 11
  • 22
  • 34

I have started a mlsan MLS course as. As a totaly newie,beginner and I am not mathematician neither, sonon-mathematician it is beinghas 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 onwith 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 dependantdependent 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)

What has happened is what I do not understand. It has 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?

  • 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?

I have started a mls course as a totaly newie, and I am not mathematician neither, so it is being 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 on 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 dependant 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)

What has happened is what I do not understand. It has 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?

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?

Source Link
user70164
user70164

What happens when scikit-learn does a Lasso Model?

I have started a mls course as a totaly newie, and I am not mathematician neither, so it is being 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 on 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 dependant 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)

What has happened is what I do not understand. It has 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?