Last active
October 7, 2021 04:22
-
-
Save SajidLhessani/5ae7bfcf315f3d5bae086ddab07c987e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test variables for 'c' and 'g' | |
#Setting the different values to test within C, Gamma and Kernel | |
c = [10, 100, 1000, 10000] | |
g = [1e-2, 1e-1, 1e0] | |
# Intialise the parameters | |
parameters = {'svc__C': c, | |
'svc__gamma': g, | |
'svc__kernel': ['rbf'] | |
} | |
#Creating the step by step pipeline | |
# Create the 'steps' variable with the pipeline functions | |
steps = [('scaler', StandardScaler()), ('svc', SVC())] | |
# Pass the 'steps' to the Pipeline function | |
pipeline = Pipeline(steps) | |
#Creating a randomized function to help to find the best parameters. | |
# Call the RandomizedSearchCV function and pass the parameters | |
rcv = RandomizedSearchCV(pipeline, parameters, cv=TimeSeriesSplit(n_splits=2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment