示例#1
0
        print("Reading Training Data (Cancer Problem)")
    # Reading Training data
    trainData = utl.readDataSetAsMatrix(utl.BREAST_CANCER_TRAINING_FILE, 1,
                                        ',')

    # Separating outputs from inputs
    inputs = trainData[:, :9]
    outputs = trainData[:, 9:]

    if debug:
        print("Training RBF Model (Cancer problem)")
    configuration = utl.RBFTrainProcessConfiguration()
    configuration.unitsInHiddenLayer = unitsInHiddenLayer

    return utl.trainRBFNetwork(\
     inputs,
     outputs,
     configuration
    )


if __name__ == "__main__":

    model, errorsByEpoch = trainModel(8)

    print("Saving RBF Trained Model (Cancer Problem)")
    utl.saveModelAtLocation(\
     model,
     utl.BREAST_CANCER_RBF_MODEL_FILE
    )
示例#2
0
	)

	inputs = trainData[:, 2:]

	if debug:
		print("Training Model RNN hourly Model (Currency Exchange problem)")

	configuration = utl.RecurrentTrainProcessConfiguration()
	configuration.unitsInHiddenLayer = unitsInHiddenLayer
	configuration.maxEpochs = 100

	configuration.learningrate = 0.001
	configuration.momentum = 0.95
	
	return utl.trainJordanRecurrentNetwork(\
		inputs, 1, configuration
	)


if __name__ == "__main__":

	model, errorsByEpoch = trainModel(8)

	print("Saving RNN Jordan Trained Model (Currency Exchange problem)")
	utl.saveModelAtLocation(
		model,
		utl.CURRENCY_EXCHANGE_RNN_JORDAN_MODEL_FILE(\
			utl.SAMPLING_TYPE.HOURLY
		)
	)
示例#3
0
	)

	inputs = trainData[:, 2:]

	if debug:
		print("Training Model RNN Elman Model (Currency Exchange problem)")

	configuration = utl.RecurrentTrainProcessConfiguration()
	configuration.unitsInHiddenLayer = unitsInHiddenLayer
	configuration.maxEpochs = 100

	configuration.learningrate = 0.001
	configuration.momentum = 0.95
	
	return utl.trainELmanRecurrentNetwork(\
		inputs, 1, configuration
	)


if __name__ == "__main__":

	model, errorsByEpoch = trainModel(4)

	print("Saving RNN Elman Trained Model (Currency Exchange problem)")
	utl.saveModelAtLocation(
		model,
		utl.CURRENCY_EXCHANGE_RNN_ELMAN_MODEL_FILE(\
			utl.SAMPLING_TYPE.AT_CLOSING_DAY
		)
	)