Research Article
Detecting Illegal Online Gambling (IOG) Services in the Mobile Environment
Algorithm 3
ML algorithm, KoNLPy, and matching options.
| from sklearn.model_selection import GridSearchCV | | from sklearn.model_selection import train_test_split | | class classifier: | | … | | def adapt(self, opt1, opt2, opt3, grid = True): | | … | | self.grid_cv = GridSearchCV(self.clf, self.param_grid, cv = 4, scoring = “accuracy,” verbose = 2, n_jobs = −1). | | … | | def get_data(self): | | … | | self.train_x, self.test_x, self.train_y, self.test_y = train_test_split(self.original_data.text.tolist(), self.original_data.score.tolist(), test_size = 0.25, shuffle = True, stratify = self.original_data.score.tolist(), random_state = 0). |
|