本文整理汇总了Python中evaluator.Evaluator.accuracy方法的典型用法代码示例。如果您正苦于以下问题:Python Evaluator.accuracy方法的具体用法?Python Evaluator.accuracy怎么用?Python Evaluator.accuracy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类evaluator.Evaluator
的用法示例。
在下文中一共展示了Evaluator.accuracy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from evaluator import Evaluator [as 别名]
# 或者: from evaluator.Evaluator import accuracy [as 别名]
def test(self):
# Training error
print "Training error:"
evaluator = Evaluator(self.X_train, self.Y_train, self.W)
evaluator.MSE()
evaluator.accuracy()
# Testing error
print "Testing error:"
evaluator = Evaluator(self.X_test, self.Y_test, self.W)
evaluator.MSE()
evaluator.accuracy()
示例2: test
# 需要导入模块: from evaluator import Evaluator [as 别名]
# 或者: from evaluator.Evaluator import accuracy [as 别名]
def test(self, label=None):
# Training error
print "Training error:"
evaluator = Evaluator(self.X_train, self.Y_train, self.W)
#evaluator.MSE()
evaluator.accuracy()
#evaluator.confusion()
# Testing error
print "Testing error:"
evaluator = Evaluator(self.X_test, self.Y_test, self.W)
#evaluator.MSE()
evaluator.accuracy()
evaluator.confusion()
FPR, TPR = evaluator.roc()
plt.plot(FPR, TPR, label=label)
plt.axis([0.0,0.5,0.5,1.0])
示例3: len
# 需要导入模块: from evaluator import Evaluator [as 别名]
# 或者: from evaluator.Evaluator import accuracy [as 别名]
decay_threshold=decthr,
stop_threshold=stopthr
)
architecture = [784, 400, 400, 10]
net = network.Network(architecture, lr)
validation_errors, training_costs = trainer.sgd(
net,
tr_d,
mb,
momentum=mom,
evaluator=evaluator,
scheduler=scheduler
)
best_net = scheduler.highest_accuracy_network
val_err = Utils.error_fraction(
evaluator.accuracy(va_d, best_net), len(va_d[0])
)*100
eva_err = Utils.error_fraction(
evaluator.accuracy(te_d, best_net), len(te_d[0])
)*100
curr_time = time.strftime("%Y%m%d-%H%M%S")
Io.save(
best_net,
"networks/" +
curr_time +
"_" + str(architecture).replace(' ', '') +
"_valerr" + str(val_err) +
"_evaerr" + str(eva_err) +
"_lr" + str(lr) +
"_mom" + str(mom) +
"_dec" + str(dec) +
示例4: PollutedSpambase
# 需要导入模块: from evaluator import Evaluator [as 别名]
# 或者: from evaluator.Evaluator import accuracy [as 别名]
from polluted import PollutedSpambase
from evaluator import Evaluator
from descent import GradientDescent
if __name__=="__main__":
# Get data
dataset = PollutedSpambase()
train_data, train_labels = dataset.training()
test_data, test_labels = dataset.testing()
# Do Logistic Regression
gd = GradientDescent(train_data, train_labels)
# 200,000 iterations gives ~85% acc
W = gd.logreg_stoch(it=200001)
# Evaluate solution
evaluator = Evaluator([test_data], [test_labels], [W])
evaluator.accuracy()