Пример #1
0
import _DataMap as dm
import sys

agentFile = 'bestAgent.csv'
bestAgent = []
movieData = []

#Used across many programs
endFireFactor = 0.5
if (len(sys.argv) > 1):
    endFireFactor = float(sys.argv[1])
numCate = 12
numMin = 200

#Get Best again from File
bestAgent = cFile.readCSV(agentFile)[0]
#print(bestAgent)

#Make sure the agent is only floats
for i in range(len(bestAgent)):
    bestAgent[i] = float(bestAgent[i])

#Get information regarding movie to test
if (len(sys.argv) < 7):
    movieData.append(ic.getNum('Enter Rating/Score: ','Invalid Entry'))
    movieData.append(ic.getNum('Enter Category 1 Score: ','Invalid Entry'))
    movieData.append(ic.getNum('Enter Category 2 Score: ','Invalid Entry'))
    movieData.append(ic.getNum('Enter Category 3 Score: ','Invalid Entry'))
    movieData.append(ic.getNum('Enter Running Time: ','Invalid Entry'))
    movieData.append(ic.getNum('Enter Number of Words in Title: ','Invalid Entry'))
else:
Пример #2
0
outputFile = 'testOut.csv'
bestAgentFile = 'bestAgent.csv'
dataInputFile = 'dataV2.csv'

#Number of nodes in each layer
n1 = 0
n2 = 1
n3 = 2
nW = 3

#Used only by the program
generation = 1
numRandomAgents = 0

#Setup Data File with Results and Data for ML
fullData = cfile.readCSV(dataInputFile)[1:]

#Map Data Appropriately
data = dm.MapDataV2(fullData, numCate, numMin)

#Calculate num of Weightings
netInfo = nn.setupNetwork(layoutOfNetwork)

#Setup the Agents
Agents = ag.createAgents(numAgents, netInfo[nW])
AgentScores = ag.createScoreArray(Agents)

generationResults = []
bestAgent = []
while generation != generations + 1:
    random.seed(time.time() * 1000)
Пример #3
0
maxMut = 5
resultPos = 4
outputFile = 'testOut.csv'
bestAgentFile = 'bestAgent.csv'

#Number of nodes in each layer
numL1 = 3
numL2 = 2
numL3 = 1

#Used only by the program
generation = 1
numOfWeightings = 0

#Setup Data File with Results and Data for ML
fullData = cfile.readCSV('Data.csv')[1:]

#Map Data Appropriately
data = dm.MapData(fullData, numCate, numMin)

#Calculate num of Weightings
numOfWeightings = nn.setupNetwork(numL1, numL2, numL3)

#Setup the Agents
Agents = ag.createAgents(numAgents, numOfWeightings)
AgentScores = ag.createScoreArray(Agents)

generationResults = []
bestAgent = []
while generation != generations + 1:
    random.seed(time.time() * 1000)