当前位置: 首页>>代码示例>>Python>>正文


Python Evaluator.accuracy方法代码示例

本文整理汇总了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()
开发者ID:LukeJaffe,项目名称:coursework,代码行数:13,代码来源:regression.py

示例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])
开发者ID:LukeJaffe,项目名称:coursework,代码行数:18,代码来源:regression.py

示例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) +
开发者ID:azatris,项目名称:dodn,代码行数:33,代码来源:run.py

示例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()
开发者ID:LukeJaffe,项目名称:coursework,代码行数:20,代码来源:p3a.py


注:本文中的evaluator.Evaluator.accuracy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。