MCPcopy Create free account
hub / github.com/MachineLP/TextMatch / LR

Class LR

textmatch/models/ml/lr.py:17–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15from textmatch.config.constant import Constant as const
16
17class 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

Callers 3

lr_test.pyFile · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected