本文整理汇总了Python中Main.read方法的典型用法代码示例。如果您正苦于以下问题:Python Main.read方法的具体用法?Python Main.read怎么用?Python Main.read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main.read方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createTestDataSet
# 需要导入模块: import Main [as 别名]
# 或者: from Main import read [as 别名]
def createTestDataSet(fileName, numExpr):
global matrixA,pirsonMatrix,fileNameResult,fileNameDepend
pirsonMatrix = []
matrixA = []
fileRes = fileNameResult + str(numExpr)+".txt"
Main.read(fileRes, matrixA)
global size
size = len(matrixA)
CalculatePirsonCorelation(size)
Main.write("DataMatrixExpr"+ str(numExpr)+".txt",pirsonMatrix)
示例2: createDataSet
# 需要导入模块: import Main [as 别名]
# 或者: from Main import read [as 别名]
def createDataSet( indexI, indexJ,numExpr):
for i in range (1,countStates):
global matrixA,pirsonMatrix,fileNameResult,fileNameDepend
pirsonMatrix = []
matrixA = []
fileRes = fileNameResult + str(i)+".txt"
Main.read(fileRes, matrixA)
tmpDepMatrix = []
fileDep = fileNameDepend + str(i)+".txt"
Main.read(fileDep,tmpDepMatrix)
global size
size = len(matrixA)
CalculatePirsonCorelation(size)
if i != numExpr :
Main.write("Answer" + str(i)+".txt",[[tmpDepMatrix[indexI][indexJ]]])
Main.write("DataMatrix"+ str(i)+".txt",pirsonMatrix)
示例3: mainFunc
# 需要导入模块: import Main [as 别名]
# 或者: from Main import read [as 别名]
def mainFunc ():
realDependecyMatrix = []
Main.read("ResultMatrix6.txt", resultMatrix)
Main.read("DependMatrix6.txt",realDependecyMatrix)
listPermutation = [k for k in range(len(resultMatrix))]
allPermutations = list(itertools.permutations(listPermutation))
for i in range(len (allPermutations)):
ReNullGlovalVariables()
global resultMatrix
resultMatrix = []
for k in range(len(listPermutation[i])):
resultMatrix.append(listPermutation[i][k])
print resultMatrix
findDependMatrix(resultMatrix[0],resultMatrix[1])
setFisrtAndLastElementSequens()
if [] in generalD:
continue
testDependMatrix()
示例4: print
# 需要导入模块: import Main [as 别名]
# 或者: from Main import read [as 别名]
middRes2 = []
print ("================TEST DATA NUMBER - " + str(testDataNumber) + " ==================")
for i in range(dimenssionMatrix):
arrTmp = []
for j in range(dimenssionMatrix):
print ("================PREPARE DATASET for[" + str(i) + "][" + str(j)+"]==============")
PrepareDataForNN.setFileName("Result\\"+str(dimenssionMatrix)+"x"+str(dimenssionMatrix)+"\ResultMatrix","Result\\"+str(dimenssionMatrix)+"x"+str(dimenssionMatrix)+"\DependMatrix")
PrepareDataForNN.createDataSet(i,j,testDataNumber)
PrepareDataForNN.createTestDataSet("Result\\4x4\\test\ResultMatrix",testDataNumber)
print ("================RUN NEURALNETWORK for[" + str(i) + "][" + str(j)+"]==============")
tempRes = NeuralNetwork.teachNeuralNetwork(PrepareDataForNN.countStates,testDataNumber)
arrTmp.append(tempRes)
arrResult.append(arrTmp)
tmpDepMatrix = []
fileDep = "Result\\"+str(dimenssionMatrix)+"x"+str(dimenssionMatrix)+"\DependMatrix" + str(testDataNumber)+".txt"
Main.read(fileDep, tmpDepMatrix)
diff1, diff2 = diffMatr(arrResult, tmpDepMatrix)
middRes1.append(diff1)
middRes2.append(diff2)
arrResultMatrix.append(arrResult)
writeResultMatrix(arrResultMatrix, "ResultMatrix.txt")
sum1 = 0
sum2 = 0
for i in range(len(middRes1)):
print (str(middRes1[i]) + " : " + str(middRes2[i]))
sum1 += middRes1[i]
sum2 += middRes2[i]
res1 = float(sum1)/float(len(middRes1))
res2 = float(sum2)/float(len(middRes2))