| 15 | from textmatch.config.constant import Constant as const |
| 16 | |
| 17 | class LR: |
| 18 | |
| 19 | def __init__(self): |
| 20 | self.other_params = {} |
| 21 | for k, v in cfg.lr.items(): |
| 22 | print ('LR params:',k,'>>>>',v) |
| 23 | self.other_params[k] = v |
| 24 | self.clf = LogisticRegression(**self.other_params) |
| 25 | pass |
| 26 | |
| 27 | def fit(self, train_x, train_y): |
| 28 | self.clf.fit(train_x, train_y) |
| 29 | return self |
| 30 | |
| 31 | def predict(self, X_test): |
| 32 | predict = self.clf.predict_proba(X_test)[:,1] |
| 33 | return predict |
| 34 | |
| 35 | def save_model(self): |
| 36 | pass |
| 37 | |
| 38 | def load_model(self): |
| 39 | pass |
| 40 | |
| 41 | |
| 42 |
no outgoing calls
no test coverage detected