Commit e55ec4f0 authored by KangMin An's avatar KangMin An
Browse files

Update : 데이터 처리 예약 작업 - 파일 경로 문제 수정.

parent 770773aa
......@@ -22,7 +22,7 @@ def storeParameters(link, filename, data):
time_dir = '/' + year + '/' + year+month + '/' + year + month + day
file_dir = getcwd() + '/server' + link + time_dir + filename
file_dir = getcwd() + link + time_dir + filename
file = open(file_dir, "w")
......@@ -34,6 +34,8 @@ def storeParameters(link, filename, data):
dbconfig = {"host": sys.argv[1], "user": sys.argv[2],
"password": sys.argv[3], "database": sys.argv[4]}
print(dbconfig)
eue_db = pymysql.connect(user=dbconfig["user"], password=dbconfig["password"],
host=dbconfig["host"], db=dbconfig["database"], charset='utf8')
cursor = eue_db.cursor(pymysql.cursors.DictCursor)
......@@ -71,10 +73,8 @@ for userdata in result:
print("After Linear Regression -\n")
test_data = np.array([[5], [20], [0], [16.87], [40], [
1011], [0.72], [26.70], [47.00], [64]])
print(test_data.shape, mean.shape, std_d.shape)
test_data = (test_data - mean) / std_d
y_hat = model.predict(test_data, model.weights, model.bias)
print(y_hat.shape)
print("Test Data.\n", test_data, "\n")
print("Predict - standard deviation : ", y_hat)
......
......@@ -27,7 +27,7 @@ def loadRawData(link, file_name):
str(yesterday.year) + str(yMonth) + "/" + \
str(yesterday.year) + str(yMonth) + str(yDay)
file_dir = os.getcwd() + "/server" + link + time_dir + file_name
file_dir = os.getcwd() + link + time_dir + file_name
if not os.path.isfile(file_dir):
print("File doesn't exist on {0}".format(file_dir))
......
......@@ -35,8 +35,9 @@ const dataProcessingJob = schedule.scheduleJob(rule, () => {
console.log("Data processing is start.");
});
pyprocess.stderr.on("data", (data) => {
pyprocess.stderr.on("data", (error) => {
console.log("Error in the data processing.");
console.log(error);
});
pyprocess.on("close", () => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment