本文整理匯總了Python中SdA.test_model方法的典型用法代碼示例。如果您正苦於以下問題:Python SdA.test_model方法的具體用法?Python SdA.test_model怎麽用?Python SdA.test_model使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SdA
的用法示例。
在下文中一共展示了SdA.test_model方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1:
# 需要導入模塊: import SdA [as 別名]
# 或者: from SdA import test_model [as 別名]
filename=data_dir + "GM12878_200bp_Classes_3Cl_l2normalized_TestSet.txt";
test_set_y_org=numpy.loadtxt(filename,delimiter='\t',dtype=object)
prev,test_set_y_org=cl.change_class_labels(test_set_y_org)
filename=data_dir + "GM12878_Features_Unique.txt";
features=numpy.loadtxt(filename,delimiter='\t',dtype=object)
rng=numpy.random.RandomState(1000)
# train
classifier,training_time=SdA.train_model(train_set_x_org=train_set_x_org, train_set_y_org=train_set_y_org,
valid_set_x_org=valid_set_x_org, valid_set_y_org=valid_set_y_org,
pretrain_lr=0.1,finetune_lr=0.1, alpha=0.01,
lambda_reg=0.00005, alpha_reg=0.5,
n_hidden=[64,64,32], corruption_levels=[0.01,0.01,0.01],
pretraining_epochs=5, training_epochs=1000,
batch_size=200, rng=rng)
# test
test_set_y_pred,test_set_y_pred_prob,test_time=SdA.test_model(classifier, test_set_x_org, batch_size=200)
print test_set_y_pred[0:20]
print test_set_y_pred_prob[0:20]
print test_time
# evaluate classification performance
perf,conf_mat=cl.perform(test_set_y_org,test_set_y_pred,numpy.unique(train_set_y_org))
print perf
print conf_mat
gc_collect()