-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest_SVR_Model
More file actions
30 lines (22 loc) · 883 Bytes
/
Test_SVR_Model
File metadata and controls
30 lines (22 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""# Test Stock Price"""
testcolumns = ['SecuritiesCode', 'Open', 'High', 'Low', 'Close', 'Volume']
testdata = pd.read_csv('test_stock_prices.csv', usecols=testcolumns)
testdata.shape
log_testdata = np.log(testdata) # log() == loge()
plt.plot(log_testdata)
plt.show()
log_testdata = log_testdata.replace([np.inf, -np.inf], np.nan)
log_testdata = log_testdata.fillna(log_data.mean())
Std_Scaler = StandardScaler()
Std_feature_transform = Std_Scaler.fit_transform(log_testdata)
Std_feature_transform = pd.DataFrame(Std_feature_transform, columns=log_testdata.columns, index=log_testdata.index)
test_svr_prediction = svr.predict(Std_feature_transform)
print(len(test_svr_prediction))
print(test_svr_prediction)
test_svr_prediction = np.exp(test_svr_prediction)
print(test_svr_prediction)
x = 0
for i in test_svr_prediction:
print(pd.Timestamp(i, unit='s'))
x=x+1
print(x)