Name: Olivier Nguyen
Mentors: Lea Goetz, Heiko Strathmann
Organization: Shogun Machine Learning Toolbox
Abstract
Name: Olivier Nguyen
Mentors: Lea Goetz, Heiko Strathmann
Organization: Shogun Machine Learning Toolbox
Abstract
| # Generates data for y = (x1 v x2) > 5 | |
| import numpy as np | |
| from sklearn.ensemble import RandomForestClassifier | |
| X1 = np.random.randint(5, 10, size=(5, 2)) | |
| X2 = np.random.randint(0, 5, size=(5, 2)) | |
| X = np.concatenate((X1, X2)) | |
| y = [1.0 if i > 5 else 0.0 for i in range(10)] |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from sklearn import svm, datasets | |
| from sklearn.ensemble import RandomForestClassifier | |
| from modshogun import * | |
| #np.random.seed(42) | |
| X = np.array([[-1.0, -1.0], [-1.2, -1.4], [-3.4, -2.2], [1.1, 1.2]]) | |
| y = np.array([0, 0, 1, 1]).astype(np.float) |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from sklearn import svm, datasets | |
| # import some data to play with | |
| iris = datasets.load_iris() | |
| num_samples = len(iris.data) | |
| np.random.seed(seed=42) |
| import numpy as np | |
| from modshogun import MulticlassLabels | |
| int_labels = np.array([0, 1, 2], dtype=np.int) | |
| MulticlassLabels(int_labels) | |
| MulticlassLabels(int_labels.astype(np.int32)) |
| import numpy as np | |
| from modshogun import * | |
| features_train = RealFeatures(np.random.random_sample((10, 5))) | |
| features_test = RealFeatures(np.random.random_sample((10, 5))) | |
| labels_train = MulticlassLabels(np.array([np.random.randint(3) for i in range(5)]).astype(np.float)) | |
| labels_test = MulticlassLabels(np.array([np.random.randint(3) for i in range(5)]).astype(np.float)) | |
| m_vote = MajorityVote() |
| import numpy as np | |
| from modshogun import * | |
| roc = ROCEvaluation() | |
| roc.evaluate(y_pred, y_test) | |
| auc = roc.get_auROC() | |
| print(auc) # 0.845606993532 | |
| roc = ROCEvaluation() |
| """ | |
| The following code crashes with this error message: | |
| ---> 15 result = cv.evaluate() | |
| SystemError: [ERROR] In file /build/shogun-v9ad6W/shogun-6.0.0+1SNAPSHOT201704270057/src/shogun/labels/Labels.cpp | |
| line 67: assertion m_current_values.vector && idx < get_num_labels() failed in | |
| virtual float64_t shogun::CLabels::get_value(int32_t) | |
| file /build/shogun-v9ad6W/shogun-6.0.0+1SNAPSHOT201704270057/src/shogun/labels/Labels.cpp line 67 | |
| """ |
| // Keybad gun bindings | |
| bind "KP_INS" "buy defuser" | |
| bind "KP_END" "buy ak47; buy m4a1;" | |
| bind "KP_DOWNARROW" "buy galil; buy famas" | |
| bind "KP_PGDN" "buy awp" | |
| bind "KP_LEFTARROW" "buy p250" | |
| bind "KP_5" "buy p90" | |
| bind "KP_RIGHTARROW" "buy mp7" | |
| bind "KP_HOME" "buy deagle" | |
| bind "KP_UPARROW" "buy vest" |