57 lines
1.3 KiB
Python
57 lines
1.3 KiB
Python
|
|
#!/users/dsc/bin/Python3
|
||
|
|
#-*-coding: UTF-8 -*-
|
||
|
|
# from Serialization import Serialization,Deserialization
|
||
|
|
# a={"a":1,"b":2}
|
||
|
|
# file_name="test"
|
||
|
|
# c=Serialization(file_name,a)
|
||
|
|
# print(c)
|
||
|
|
# b={"c":3,"d":4}
|
||
|
|
# e=Deserialization(file_name)
|
||
|
|
# if(e):
|
||
|
|
# print("e---")
|
||
|
|
# print(e)
|
||
|
|
# print(a)
|
||
|
|
# print(b)
|
||
|
|
# from mntest import mnTest,mnTrain
|
||
|
|
# print(mnTrain())
|
||
|
|
from ml_utiliy import ihyperDB,time_delta_split
|
||
|
|
import datetime
|
||
|
|
# tag_name="TCM1750_ENT-40-183-FH-2"
|
||
|
|
# stime=1704441868000
|
||
|
|
# etime=1704445468000
|
||
|
|
|
||
|
|
# etime2=datetime.datetime.now()
|
||
|
|
# stime2=etime2-datetime.timedelta(minutes=105)
|
||
|
|
# ihd=ihyperDB()
|
||
|
|
# print(type(ihd.value_))
|
||
|
|
# ihd.select_raw_data(tag_name,stime,etime)
|
||
|
|
|
||
|
|
# if(ihd.flag_):
|
||
|
|
# print(len(ihd.value_))
|
||
|
|
# else:
|
||
|
|
# print("ERROR")
|
||
|
|
# ihd.select_raw_data(tag_name,stime2,etime2)
|
||
|
|
# if(ihd.flag_):
|
||
|
|
# print(len(ihd.values_))
|
||
|
|
# print(type(ihd.values_))
|
||
|
|
# else:
|
||
|
|
# print("ERROR")
|
||
|
|
|
||
|
|
# [a,b]=time_delta_split(stime2,etime2)
|
||
|
|
# print(a)
|
||
|
|
# print(b)
|
||
|
|
|
||
|
|
|
||
|
|
import json
|
||
|
|
import numpy as np
|
||
|
|
import ml_train
|
||
|
|
sampleJson = """{"key1": "value1", "key2": "value2"}"""
|
||
|
|
json_path="/users/dsc/code/eqpalg/alg_json/ml_param.json"
|
||
|
|
with open(json_path,'r',encoding='utf8')as fp:
|
||
|
|
json_data = json.load(fp)
|
||
|
|
print(json_data)
|
||
|
|
tm1=ml_train.TrainModle()
|
||
|
|
# tm1.Train(json_data)
|
||
|
|
tm1.Predict(json_data)
|
||
|
|
|
||
|
|
|