- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近开始尝试使用 OneClassSVM(使用 Sklearn)进行无监督学习,并且我遵循了 this example 。
我对这些愚蠢的问题表示歉意,但我对两件事有点困惑:
我应该在常规示例案例和异常值上训练支持向量机,还是仅在常规示例上进行训练?
OSVM 预测并代表异常值的标签是 1 还是 -1
我再次对这些问题表示歉意,但由于某种原因我找不到此记录的任何软件
最佳答案
由于您引用的这个示例是关于新颖性检测的,因此 docs说:
novelty detection:
The training data is not polluted by outliers, and we are interested in detecting anomalies in new observations.
含义:您应该仅使用常规示例进行训练。
该方法基于:
Schölkopf, Bernhard, et al. "Estimating the support of a high-dimensional distribution." Neural computation 13.7 (2001): 1443-1471.
摘录:
Suppose you are given some data set drawn from an underlying probability distribution P and you want to estimate a “simple” subset S of input space such that the probability that a test point drawn from P lies outside of S equals some a priori specied value between 0 and 1.
We propose a method to approach this problem by trying to estimate a function f that is positive on S and negative on the complement.
上面的文档还说:
Inliers are labeled 1, while outliers are labeled -1.
这也可以在您的示例代码中看到,提取:
# Generate some regular novel observations
X = 0.3 * np.random.randn(20, 2)
X_test = np.r_[X + 2, X - 2]
...
# all regular = inliers (defined above)
y_pred_test = clf.predict(X_test)
...
# -1 = outlier <-> error as assumed to be inlier
n_error_test = y_pred_test[y_pred_test == -1].size
关于machine-learning - 对sklearn对OSVM的实现感到困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49873952/
我目前正在使用 auc-roc 曲线,假设我有一个无排名分类器,例如一类 SVM,其中预测为 0 和 1,并且预测不会轻易转换为概率或分数,如果我不想绘制 AUC-ROC,而是只想计算 AUC 以使用
我是一名优秀的程序员,十分优秀!