Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Pipeline_parameters

pipe_sgd = Pipeline([('scl', StandardScaler()),
                    ('clf', SGDClassifier(n_jobs=-1))])

param_dist_sgd = {'clf__loss': ['log'],
                 'clf__penalty': [None, 'l1', 'l2', 'elasticnet'],
                 'clf__alpha': np.linspace(0.15, 0.35),
                 'clf__n_iter': [3, 5, 7]}

sgd_randomized_pipe = RandomizedSearchCV(estimator = pipe_sgd, 
                                         param_distributions=param_dist_sgd, 
                                         cv=3, n_iter=30, n_jobs=-1)

sgd_randomized_pipe.fit(X_train, y_train)


#use
scaler = sgd_randomized_pipe.best_estimator_.named_steps['scl']
classifier = sgd_randomized_pipe.best_estimator_.named_steps['clf']
Comment

PREVIOUS NEXT
Code Example
Python :: summation 
Python :: pyqt5 cursor starting on a widget 
Python :: how to send message to specific channel discord/py 
Python :: Factory reset the filesystem micropython 
Python :: pygame download for python 3.10 
Python :: python quickly goto line in file 
Python :: password validation in python 
Python :: how to find 6,6,77,8 in python 
Python :: list devices python 3 
Python :: python with statement local variables 
Python :: one line test python 
Python :: treesitter python languages 
Python :: Iterate through string with index in python using while loop and rang 
Python :: current python 
Python :: module django contrib admin has no attribute action ACTION_CHECKBOX_NAME 
Python :: dict pop with index python 
Python :: Encapsulation in Python using public members 
Python :: Assigning X and y using .iloc index 
Python :: nlp generate parse tree in python 
Python :: repalce na with mean per group 
Python :: generator expressions python 
Python :: how to close turle loop 
Python :: what takes more memory string or list python 
Python :: flask google analytics 
Python :: get all view port type dynamo revit 
Python :: fibonacci series python program 
Python :: pylatex subsection 
Python :: convert unit dynamo revit 
Python :: python boto3 ypload_file to s3 
Python :: mechanize python #8 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =