当前位置: 首页>>代码示例>>Python>>正文


Python Main.read方法代码示例

本文整理汇总了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)
开发者ID:Sobolvitya,项目名称:Diploma,代码行数:12,代码来源:PrepareDataForNN.py

示例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)
开发者ID:Sobolvitya,项目名称:Diploma,代码行数:18,代码来源:PrepareDataForNN.py

示例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()
开发者ID:Sobolvitya,项目名称:Diploma,代码行数:23,代码来源:SolveAlgorithm.py

示例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))
开发者ID:Sobolvitya,项目名称:Diploma,代码行数:33,代码来源:Exprirement.py


注:本文中的Main.read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。