def __init__(self, path, etype, **kwargs):
super(EnsembleModel, self).__init__(path, etype=etype, **kwargs)
self.basedir = "models/ensemble/"
self.goldstd = kwargs.get("goldstd")
self.data = {}
self.offsets = []
self.pipeline = Pipeline(
[
#('clf', SGDClassifier(loss='hinge', penalty='l1', alpha=0.0001, n_iter=5, random_state=42)),
#('clf', SGDClassifier())
# ('clf', svm.NuSVC(nu=0.01 ))
('clf', RandomForestClassifier(class_weight={False:1, True:1}, n_jobs=-1, criterion="entropy", warm_start=True))
# ('clf', tree.DecisionTreeClassifier(criterion="entropy")),
# ('clf', MultinomialNB())
# ('clf', GaussianNB())
#('clf', svm.SVC(kernel="rbf", degree=2, C=1)),
#('clf', svm.SVC(kernel="linear", C=2))
#('clf', DummyClassifier(strategy="constant", constant=True))
])
评论列表
文章目录