本文整理汇总了Python中imblearn.pipeline.Pipeline.predict_log_proba方法的典型用法代码示例。如果您正苦于以下问题:Python Pipeline.predict_log_proba方法的具体用法?Python Pipeline.predict_log_proba怎么用?Python Pipeline.predict_log_proba使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类imblearn.pipeline.Pipeline
的用法示例。
在下文中一共展示了Pipeline.predict_log_proba方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pipeline_methods_anova
# 需要导入模块: from imblearn.pipeline import Pipeline [as 别名]
# 或者: from imblearn.pipeline.Pipeline import predict_log_proba [as 别名]
def test_pipeline_methods_anova():
# Test the various methods of the pipeline (anova).
iris = load_iris()
X = iris.data
y = iris.target
# Test with Anova + LogisticRegression
clf = LogisticRegression()
filter1 = SelectKBest(f_classif, k=2)
pipe = Pipeline([('anova', filter1), ('logistic', clf)])
pipe.fit(X, y)
pipe.predict(X)
pipe.predict_proba(X)
pipe.predict_log_proba(X)
pipe.score(X, y)
示例2: test_pipeline_methods_pca_svm
# 需要导入模块: from imblearn.pipeline import Pipeline [as 别名]
# 或者: from imblearn.pipeline.Pipeline import predict_log_proba [as 别名]
def test_pipeline_methods_pca_svm():
# Test the various methods of the pipeline (pca + svm).
iris = load_iris()
X = iris.data
y = iris.target
# Test with PCA + SVC
clf = SVC(probability=True, random_state=0)
pca = PCA()
pipe = Pipeline([('pca', pca), ('svc', clf)])
pipe.fit(X, y)
pipe.predict(X)
pipe.predict_proba(X)
pipe.predict_log_proba(X)
pipe.score(X, y)
示例3: test_pipeline_methods_pca_svm
# 需要导入模块: from imblearn.pipeline import Pipeline [as 别名]
# 或者: from imblearn.pipeline.Pipeline import predict_log_proba [as 别名]
def test_pipeline_methods_pca_svm():
# Test the various methods of the pipeline (pca + svm).
iris = load_iris()
X = iris.data
y = iris.target
# Test with PCA + SVC
clf = SVC(gamma='scale', probability=True, random_state=0)
pca = PCA(svd_solver='full', n_components='mle', whiten=True)
pipe = Pipeline([('pca', pca), ('svc', clf)])
pipe.fit(X, y)
pipe.predict(X)
pipe.predict_proba(X)
pipe.predict_log_proba(X)
pipe.score(X, y)