Guest User

Untitled

a guest
Feb 18th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. # Data
  2. dataset = pd.read_csv('Social_Network_Ads.csv')
  3. X = dataset.iloc[:, [2, 3]].values
  4. y = dataset.iloc[:, 4].values
  5.  
  6. # Scaling
  7. from sklearn.preprocessing import StandardScaler
  8. sc = StandardScaler()
  9. X = sc.fit_transform(X)
  10.  
  11. # SVM
  12. from sklearn.svm import SVC
  13. classifier = SVC(kernel='rbf', random_state=0)
  14.  
  15. # Grid Search with Cross Validation (Params Optimization)
  16. from sklearn.model_selection import GridSearchCV
  17. p = [{'C': [1, 2, 3, 4, 5], 'Kernel':['linear']},
  18. {'C': [1, 10, 100, 1000], 'kernel': ['rbf'],
  19. 'gamma': [1, 0.5, 0.1, 0.01, 0.001]}]
  20.  
  21. gs = GridSearchCV(estimator=classifier, param_grid=p,
  22. scoring='accuracy', cv=10, n_jobs=-1)
  23. grid_search = gs.fit(X, y)
  24. bestScore = grid_search.best_score_
  25. bestParams = grid_search.best_params_
  26. print(bestScore, bestParams)
  27.  
  28. Traceback (most recent call last):
  29. File "C:UsersuserPycharmProjectsMachineLearningvenvlibsite-
  30. packagessklearnexternalsjoblibexternalslokyprocess_executor.py", line
  31. 391, in _process_worker
  32. call_item = call_queue.get(block=True, timeout=timeout)
  33. File
  34. C:UsersuserAppDataLocalProgramsPythonPython37lib
  35. multiprocessingqueue
  36. s.py", line 99, in get
  37. if not self._rlock.acquire(block, timeout):
  38. PermissionError: [WinError 5] EriลŸim engellendi
Add Comment
Please, Sign In to add comment