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


Python NeuralNet.evaluate方法代码示例

本文整理汇总了Python中neuralnet.NeuralNet.evaluate方法的典型用法代码示例。如果您正苦于以下问题:Python NeuralNet.evaluate方法的具体用法?Python NeuralNet.evaluate怎么用?Python NeuralNet.evaluate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在neuralnet.NeuralNet的用法示例。


在下文中一共展示了NeuralNet.evaluate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: plot2

# 需要导入模块: from neuralnet import NeuralNet [as 别名]
# 或者: from neuralnet.NeuralNet import evaluate [as 别名]
def plot2(trainf):
    print("Running Test 2")
    nn = NeuralNet(trainf)

    #nn.evaluate(folds, epochs, learning_rate)
    nn.evaluate(5, 50, 0.1)
    acc1 = nn.evaluate_accuracy()

    nn.clean_training_data()
    nn.evaluate(10, 50, 0.1)
    acc2 = nn.evaluate_accuracy()

    nn.clean_training_data()
    nn.evaluate(15, 50, 0.1)
    acc3 = nn.evaluate_accuracy()

    nn.clean_training_data()
    nn.evaluate(20, 50, 0.1)
    acc4 = nn.evaluate_accuracy()

    nn.clean_training_data()
    nn.evaluate(25, 50, 0.1)
    acc5 = nn.evaluate_accuracy()

    fig1 = plt.figure()
    ax1 = fig1.add_subplot(111)
    ax1.set_title('Accuracy vs. Folds for Neural Net')
    ax1.set_xlabel('Folds')
    ax1.set_ylabel('Accuracy')
    y = [acc1, acc2, acc3, acc4, acc5]
    x = [5, 10, 15, 20, 25]
    ax1.plot(x, y, c='b', marker='o')
开发者ID:smihir,项目名称:neural-net,代码行数:34,代码来源:evaluate.py

示例2: neuralnet

# 需要导入模块: from neuralnet import NeuralNet [as 别名]
# 或者: from neuralnet.NeuralNet import evaluate [as 别名]
def neuralnet(arglist):
    nn = NeuralNet(arglist[1])

    folds = arglist[2]
    learning_rate = arglist[3]
    epochs = arglist[4]

    nn.evaluate(folds, epochs, learning_rate)
    nn.print_results()
开发者ID:smihir,项目名称:neural-net,代码行数:11,代码来源:classify.py

示例3: plot3

# 需要导入模块: from neuralnet import NeuralNet [as 别名]
# 或者: from neuralnet.NeuralNet import evaluate [as 别名]
def plot3(trainf):
    print("Running Test 3")
    nn = NeuralNet(trainf)

    #nn.evaluate(folds, epochs, learning_rate)
    nn.evaluate(10, 50, 0.1)
    x, y = nn.evaluate_roc()
    fig2 = plt.figure()
    ax2 = fig2.add_subplot(111)
    ax2.set_title('ROC for Neural Net')
    ax2.set_xlabel('False Positive Rate')
    ax2.set_ylabel('True Positive Rate')
    ax2.plot(x, y, c='b', marker='o')
开发者ID:smihir,项目名称:neural-net,代码行数:15,代码来源:evaluate.py

示例4: plot1

# 需要导入模块: from neuralnet import NeuralNet [as 别名]
# 或者: from neuralnet.NeuralNet import evaluate [as 别名]
def plot1(trainf):
    print("Running Test 1")
    nn = NeuralNet(trainf)

    #nn.evaluate(folds, epochs, learning_rate)
    nn.evaluate(10, 25, 0.1)
    acc1 = nn.evaluate_accuracy()

    nn.clean_training_data()
    nn.evaluate(10, 50, 0.1)
    acc2 = nn.evaluate_accuracy()

    nn.clean_training_data()
    nn.evaluate(10, 75, 0.1)
    acc3 = nn.evaluate_accuracy()

    nn.clean_training_data()
    nn.evaluate(10, 100, 0.1)
    acc4 = nn.evaluate_accuracy()

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_title('Accuracy vs. Epochs for Neural Net')
    ax.set_xlabel('Epochs')
    ax.set_ylabel('Accuracy')
    y = [acc1, acc2, acc3, acc4]
    x = [25, 50, 75, 100]
    ax.plot(x, y, c='b', marker='o')
开发者ID:smihir,项目名称:neural-net,代码行数:30,代码来源:evaluate.py


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