Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

lasso regression implementation python

from sklearn.linear_model import Lasso
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()

X_train, X_test, y_train, y_test = train_test_split(X_data, y_data,
                                                   random_state = 0)

X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)

linlasso = Lasso(alpha=2.0, max_iter = 10000).fit(X_train_scaled, y_train)
Comment

PREVIOUS NEXT
Code Example
Python :: one-line for loop python 
Python :: python glob 
Python :: sort list by key 
Python :: python letter to number in alphabet 
Python :: django content type 
Python :: how to create string in python 
Python :: isnumeric 
Python :: how to make django model field case insensitive 
Python :: sha512 python 
Python :: get text selenium 
Python :: python how to add turtle in tkinter 
Python :: pandas delete column by name 
Python :: how to calculate sum of a list in python 
Python :: find substr within a str in python 
Python :: make tkinter label and input 
Python :: python list length 
Python :: python env 
Python :: qrcode.make python 
Python :: python regex group 
Python :: multiprocessing queue python 
Python :: df to csv 
Python :: python append to 2d array 
Python :: python get file name without dir 
Python :: python - count how many unique in a column 
Python :: iterate through characters in a string python 
Python :: return count of substring in a string 
Python :: how to mention a div with class in xpath 
Python :: how to import sin and cos in python 
Python :: python average of list 
Python :: python profiler 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =