ynew = f(xnew) # print("xnew: ", len(xnew), xnew) print("lenTimeSeries = ", len(ynew)) return xnew.tolist(), ynew.tolist() pathData = "data/GR-Emerald-3X_GR-Emerald-3X.csv" # dataShape1, _, _ = myCrpFunctions.readCSVFileByShape(pathData, 2, 1, 2) dataByShape = [[],[],[],[],[]] for i in range(5): allTimeseries, _, _ = myCrpFunctions.readCSVFileByShape(pathData, i+1, 1, 2) for timeseries in allTimeseries: dataByShape[i] = allTimeseries data = dataByShape[4][2][10:15] print(len(data)) folderOut = "out24032019/RP/" myCrpFunctions.createFolder(folderOut) nPredict = [] # a = [1, 5, 3, 6, 5] # b = [1, 2 ,3 ,4 ,5 ]
pathFolder = "1301_smoothListTriangle/" # checkRecall(pathFolder) fileName = [ "RBA-3P_RBA-3P.csv", "RBA-6P_RBA-6P.csv", "RBA-12PST4_RBA-12PST4.csv", "RUBY-1X_RUBY-1X_1.csv", "RUBY-4X_RUBY-4X_1.csv", "TN-3X_TN-3X.csv" ] path = [("data/" + name) for name in fileName] shape = 2 indexColOfShape = 3 indexColFeature = 2 allTrainSet, minOfTrain, maxOfTrain = myCrpFunctions.readCSVFileByShape( path[0], shape, indexColFeature, indexColOfShape) for i in range(1, 5): allTrainSetI, minOfTrainI, maxOfTrainI = myCrpFunctions.readCSVFileByShape( path[i], shape, indexColFeature, indexColOfShape) allTrainSet += allTrainSetI if (minOfTrainI < minOfTrain): minOfTrain = minOfTrainI if (maxOfTrainI > maxOfTrain): maxOfTrain = maxOfTrainI # dataTest = myCrpFunctions.readCSVFile(path[5], indexColFeature) dataTest, testShape = myCrpFunctions.readCSVFileForTest( path[5], indexColFeature) shapePredict = [0 for i in range(len(testShape))]
if (__name__ == "__main__"): fileName = [ "RBA-3P_RBA-3P.csv", "RBA-6P_RBA-6P.csv", "RBA-12PST4_RBA-12PST4.csv", "RUBY-1X_RUBY-1X_1.csv", "RUBY-4X_RUBY-4X_1.csv", "TN-3X_TN-3X.csv" ] path = [("data/" + name) for name in fileName] shape = 2 indexColOfShape = 3 indexColFeature = 2 dataTrain, minOfTrain, maxOfTrain = myCrpFunctions.readCSVFileByShape( path[1], shape, indexColFeature, indexColOfShape) dataTest = myCrpFunctions.readCSVFile(path[4], indexColFeature) if (minOfTrain > min(dataTest)): minOfNorm = min(dataTest) else: minOfNorm = minOfTrain if maxOfTrain < max(dataTest): maxOfNorm = max(dataTest) else: maxOfNorm = maxOfTrain trainSet = myCrpFunctions.ConvertSetNumber(dataTrain, minOfSet=minOfNorm, maxOfSet=maxOfNorm)