本文整理汇总了Python中Preprocess.get_c_percent方法的典型用法代码示例。如果您正苦于以下问题:Python Preprocess.get_c_percent方法的具体用法?Python Preprocess.get_c_percent怎么用?Python Preprocess.get_c_percent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preprocess
的用法示例。
在下文中一共展示了Preprocess.get_c_percent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: import Preprocess [as 别名]
# 或者: from Preprocess import get_c_percent [as 别名]
testing_errs_by_percent = {}
auc_by_percent = {}
roc = []
auc = 0.0
k_folds = Preprocess.prepare_k_folds(training_data, k)
percent_list = (5, 10, 15, 20, 30, 50, 80)
for i in range(k):
tr_data_all, te_data = Preprocess.get_i_fold(k_folds, i)
for c in percent_list:
if c not in training_errs_by_percent.keys():
training_errs_by_percent[c] = []
testing_errs_by_percent[c] = []
auc_by_percent[c] = []
tr_data = Preprocess.get_c_percent(c, tr_data_all)
tr_n, f_d = np.shape(tr_data[0])
te_n, = np.shape(te_data[1])
# TODO prepare distribution
d = util.init_distribution(len(tr_data[0]))
# TODO compute thresholds cheat sheet
thresh_cs = util.pre_compute_threshes_uci(tr_data[0], tr_data[1], threshes)
boost = b.Boosting(d)
testing_predict = np.zeros((1, te_n)).tolist()[0]
training_predict = np.zeros((1, tr_n)).tolist()[0]
round_tr_err = []
round_te_err = []
round_model_err = []
round_te_auc = []
converged = False