MCPcopy
hub / github.com/jindongwang/transferlearning / train_classify

Method train_classify

code/traditional/TrAdaBoost.py:90–93  ·  view source on GitHub ↗
(self, trans_data, trans_label, test_data, P)

Source from the content-addressed store, hash-verified

88
89
90 def train_classify(self, trans_data, trans_label, test_data, P):
91 clf = tree.DecisionTreeClassifier(criterion="gini", max_features="log2", splitter="random")
92 clf.fit(trans_data, trans_label, sample_weight=P[:, 0])
93 return clf.predict(test_data)
94
95
96 def calculate_error_rate(self, label_R, label_H, weight):

Callers 1

fit_predictMethod · 0.95

Calls 2

fitMethod · 0.45
predictMethod · 0.45

Tested by

no test coverage detected