This file contains hidden or 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
| from sklearn.model_selection import GridSearchCV | |
| parameters = {'kernel':('linear', 'rbf'), 'C':[1,2,3,4,5,6,7,8,9,10], 'gamma': | |
| [0.01,0.02,0.03,0.04,0.05,0.10,0.2,0.3,0.4,0.5]} | |
| svr = svm.SVC() | |
| grid = GridSearchCV(svr, parameters) | |
| grid.fit(X_train, y_train) | |
| predicted = grid.predict(X_test) | |
| cnf_matrix = confusion_matrix(y_test, predicted) | |
| print(cnf_matrix) |
This file contains hidden or 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
| > library(arules) | |
| > data("Adult") | |
| > rules <- apriori(Adult,parameter = list(supp = 0.5, conf = 0.9, target = "rules")) | |
| > summary(rules) | |
| #set of 52 rules | |
| #rule length distribution (lhs + rhs):sizes | |
| # 1 2 3 4 | |
| # 2 13 24 13 |
OlderNewer