Example #1
0
trainPl = variables["General"]["TrainingData"]
testPl = variables["General"]["TestingData"]

#paramteres for deciding what version of the Tsetlin Machine
#and what the pro gram should do
convolutional = variables["Connect4"]["Convolutional"]
parallel = variables["Connect4"]["Parallel"]
CrossVal = variables["General"]["CrossEvaluation"]
FindClauses = variables["General"]["FindClauses"]


#------------------------------------------------------------
print("Getting Data")

#Load the data
training = DataUtil.LoadFile(dataPath + trainPl)
testing = DataUtil.LoadFile(dataPath + testPl)
print(str(len(training[0])) + " entries")    

#Transform the data to correct form
TrainX = np.array(TsUtil.ReshapeData(training[0], convolutional))
TrainY = np.array(training[1])

TestX = np.array(TsUtil.ReshapeData(testing[0], convolutional))
TestY = np.array(testing[1])

#------------------------------------------------------------
print("Setting Up Machine")
#Get parameters for Tsetlin Machine
clauses = int(variables["Connect4"]["Clause"])
T = variables["Connect4"]["T"]