我一直在与几个分级特征选择的方法。正如你可能知道,这些类型的算法,根据一些具体的方法(例如,统计,稀疏学习,ECC)排名的特点和他们的必须为了达到最好的效果来调整几个超参数统治。
该领域的现状提出了参数的调整和看在我碰到下面的方法来网络不同的方法:网格搜索方法。截至本link规定,搜索包括了以下步骤:
我总结了以下步骤在这一段代码(从点3开始):
tuned_parameters = {
'LASSO': {'alpha': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]},
}
# pick the i-th feature selector
for fs_name, fs_model in slb_fs.iteritems():
comb = []
params_name = []
for name, tun_par in tuned_parameters[fs_name].iteritems():
comb.append(tun_par)
params_name.append(name)
# function for creating all the exhausted combination of the parameters
print ('\t3 - Creating parameters space: ')
combs = create_grid(comb)
for comb in combs:
# pick the i-th combination of the parameters for the k-th feature selector
fs_model.setParams(comb,params_name,params[fs_name])
# number of folds for k-CV
k_fold = 5
X = dataset.data
y = dataset.target
kf = KFold(n_splits=k_fold)
print ('\t4 - Performing K-cross validation: ')
for train_index, test_index in kf.split(X):
X_train, X_test = X[train_index, :], X[test_index, :]
y_train, y_test = y[train_index], y[test_index]
print ('\t5.1 - Performing feature selection using: ', fs_name)
idx = fs_model.fit(X_train, y_train)
# At this point I have the ranked features
print ('5.2 - Classification...')
for n_rep in xrange(step, max_num_feat + step, step):
# Using classifier to evaluate the algorithm performance on the test set using incrementally the retrieved feature (1,2,3,...,max_num_feat)
X_train_fs = X_train[:, idx[0:n_rep]]
X_test_fs = X_test[:, idx[0:n_rep]]
_clf = clf.Classifier(names=clf_name, classifiers=model)
DTS = _clf.train_and_classify(X_train_fs, y_train, X_test_fs, y_test)
# Averaging results of the CV
print('\t4.Averaging results...')
在点5.1,我用评估所选择的功能选择上的功能的一个子集所获得的性能分类(在我的情况下,我逐渐使用它们,因为该功能进行排名),并通过交叉验证方案来平均结果。我在这一点上,结果是,平均精度的分数的特征每个子集(例如,1:70%,2:75,3:77%,...,N:100%)。
显然,后者平均结果的参数(请参见下面的表)的每个组合而获得。举例来说,假设当前特征选择只需要调整参数α,我会得到的结果列于下表。
我的问题是:是否有任何已知采摘的基础上进行的所有功能或将它们固定数量的取得的成果的最佳参数配置方法?
我想到了平均的结果,并把它作为“最佳配置”,但我不认为它可以工作。是否任何人都知道任何具体的做法?
我会很感激,如果有人可以帮助我。
你好@DavideNardone
关于性能指标,@kutschkem是正确的:如果你工作在一个二元分类和你的方法产生混淆矩阵,而不是使用准确性或F1马修斯相关系数(MCC)分数或其他利率。请把我的paper看看提示8科学的原因。
关于如何选择适合您的型号的最佳配置,我想你大多数的做法是在正确的方向。我就这么理解它是这样的:
也许这种做法是不是世界上最好的,但肯定有很强的科学背景(多数表决,事实上,在random forest使用为好)。
另外,我觉得堆栈溢出可能不是最好的地方要问智能计算的问题;我建议你移动/重问上Cross Validated或其他Stack Exchange websites这个问题。
祝好运!
问题的至少一部分可以解决围绕衡量你想使用选择你的超参数。这取决于你的问题,但一般不应使用平均精度为您的措施。
平均精度强调了最大的一类,或者是把它更加敏感。但是往往不是最有趣的类。
更好的衡量标准往往是F1-measure,这是类似平均准确性,但不一样的。它的精确度和召回的调和平均数,并在信息检索任务,其中“积极”级通常是小,“负面”级超大型常用。
F1-措施似乎的信息检索任务以外的地方critized的施力,类似的精度。更好的衡量标准似乎是Matthews Correlation Coefficient。该措施采用混淆矩阵的所有单元格,并从相同的偏见与其他两种标准并不吃亏。我有这个措施没有经验,但根据维基百科的文章是由达维德基科在他的论文“Ten quick tips for machine learning in computational biology”推荐。