Exemple #1
0
def CostList(parameters):
    costList = []
    averageErrorList = []
    for i in range(0 + predictionData.p, 136 - predictionData.p):
        X, Y, Y_List = predictionData.DataSet(predictionData.postMile[i])
        pred_test, cost = functions.predict(X[:, 4000:4600], Y[:, 4000:4600],
                                            parameters)
        averageError = functions.averageError(pred_test, Y[:, 4000:4600])
        costList.append(cost)
        averageErrorList.append(averageError)

    outList.append(costList)
    outList.append(averageErrorList)
Exemple #2
0
                                            parameters)
        test_x = np.concatenate((test_x[1:6, :], pred_test, test_x[6:, :]), 0)
        costList.append(cost)
        averageError = functions.averageError(pred_test,
                                              test_y_List[j][:, 4000:4600])
        averageErrorList.append(averageError)

    outList.append(costList)
    outList.append(averageErrorList)


listPostMile = [51.72, 42.18, 31.83, 6.62]
listPostMile_1 = [53.57, 43.46, 34.36, 4.48]

for i in range(0, 4):
    inputData, outputData, outputList = predictionData.DataSet(listPostMile[i])
    Algorithm(inputData, outputData, outputList, None, True)

inputData, outputData, outputList = predictionData.DataSet(40.68)
train_x = inputData[:, 0:4000]
train_y = outputData[:, 0:4000]
test_x = inputData[:, 4000:4600]
test_y = outputData[:, 4000:4600]
test_y_List = outputList
parameters = L_layer_model(train_x,
                           train_y,
                           layers_dims,
                           num_iterations=10000,
                           print_cost=True)

for i in range(0, 4):
Exemple #3
0
    predictions = function.forward_propagation(X, parameters)
    rmse_error, average_error = function.compute_error(predictions, Y)

    init = tf.global_variables_initializer()

    with tf.Session() as sess:

        sess.run(init)

        rmse_error = rmse_error.eval({X: X_train, Y: Y_train})
        average_error = average_error.eval({X: X_train, Y: Y_train})

    return rmse_error, average_error


inputData, outputData, outputList = predictionData.DataSet(40.68)
X_train = inputData[:, 0:4000]
Y_train = outputData[:, 0:4000]
X_test = inputData[:, 4000:4600]
Y_test = outputData[:, 4000:4600]
Y_test_List = outputList

layers_dims = [30, 25, 25, 1]

#print(np.shape(inputData))
#print(np.shape(outputData))

#print(np.shape(inputData))

#X_test[:, 0:5] = random.uniform(0, 1)