Repository: jerry81333/StockProdiction
Branch: master
Commit: e9054f2eeb0f
Files: 9
Total size: 21.2 KB
Directory structure:
gitextract_f3d5p1ip/
├── .gitattributes
├── .gitignore
├── GYN.json
├── IASP520_ARMA_V1.01.py
├── IASP520_SVM.py
├── IASP520_SVM_V2.py
├── IASP520_SVM_V2_With_Polarity_Json.py
├── NQN.json
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
================================================
FILE: .gitignore
================================================
IASP520 Project(1).docx
Re_ Final Project.zip
Re_ Final Project/GetNewsPolarity.py
Re_ Final Project/GYN.json
Re_ Final Project/IASP520_SVM_V2_With_Polarity.py
Re_ Final Project/IASP520_SVM_V2_With_Polarity_Json.py
Re_ Final Project/NQN.json
Re_ Final Project/scoreSentiment.R
Re_ Final Project/scoreSentimentYahooNews.R
Re_ Final Project/Write_Polarity_To_File.py
Re_ Final Project/__pycache__/GetNewsPolarity.cpython-35.pyc
Data Mining Stock_V1.02.pptx
IASP520 Project.docx
================================================
FILE: GYN.json
================================================
{"2015-01-27": {"Polarity": 0.8888888888888888, "Date": "2015-01-27", "Epoch": "1422334800"}, "2015-02-13": {"Polarity": -0.3333333333333333, "Date": "2015-02-13", "Epoch": "1423803600"}, "2015-03-19": {"Polarity": 1.0, "Date": "2015-03-19", "Epoch": "1426737600"}, "2015-04-21": {"Polarity": 1.0, "Date": "2015-04-21", "Epoch": "1429588800"}, "2015-05-27": {"Polarity": 1.0, "Date": "2015-05-27", "Epoch": "1432699200"}, "2015-06-18": {"Polarity": 1.0, "Date": "2015-06-18", "Epoch": "1434600000"}, "2015-07-09": {"Polarity": 1.0, "Date": "2015-07-09", "Epoch": "1436414400"}, "2015-07-17": {"Polarity": 1.0, "Date": "2015-07-17", "Epoch": "1437105600"}, "2015-07-27": {"Polarity": 0.4, "Date": "2015-07-27", "Epoch": "1437969600"}, "2015-07-31": {"Polarity": 1.0, "Date": "2015-07-31", "Epoch": "1438315200"}, "2015-09-02": {"Polarity": 1.0, "Date": "2015-09-02", "Epoch": "1441166400"}, "2015-10-20": {"Polarity": 1.0, "Date": "2015-10-20", "Epoch": "1445313600"}, "2015-11-23": {"Polarity": 1.0, "Date": "2015-11-23", "Epoch": "1448254800"}, "2015-12-16": {"Polarity": 0.2, "Date": "2015-12-16", "Epoch": "1450242000"}, "2016-01-07": {"Polarity": -1.0, "Date": "2016-01-07", "Epoch": "1452142800"}, "2016-02-01": {"Polarity": 0.0, "Date": "2016-02-01", "Epoch": "1454302800"}, "2016-02-02": {"Polarity": 1.0, "Date": "2016-02-02", "Epoch": "1454389200"}, "2016-02-03": {"Polarity": -0.16666666666666666, "Date": "2016-02-03", "Epoch": "1454475600"}, "2016-02-10": {"Polarity": 0.42857142857142855, "Date": "2016-02-10", "Epoch": "1455080400"}, "2016-02-18": {"Polarity": 0.0, "Date": "2016-02-18", "Epoch": "1455771600"}, "2016-04-27": {"Polarity": 0.4, "Date": "2016-04-27", "Epoch": "1461729600"}, "2016-05-05": {"Polarity": 0.2222222222222222, "Date": "2016-05-05", "Epoch": "1462420800"}, "2016-05-16": {"Polarity": 1.0, "Date": "2016-05-16", "Epoch": "1463371200"}, "2016-05-20": {"Polarity": 0.6666666666666666, "Date": "2016-05-20", "Epoch": "1463716800"}, "2016-05-25": {"Polarity": 1.0, "Date": "2016-05-25", "Epoch": "1464148800"}, "2016-05-31": {"Polarity": 1.0, "Date": "2016-05-31", "Epoch": "1464667200"}, "2016-06-07": {"Polarity": 0.6, "Date": "2016-06-07", "Epoch": "1465272000"}, "2016-06-08": {"Polarity": 1.0, "Date": "2016-06-08", "Epoch": "1465358400"}, "2016-06-09": {"Polarity": 0.3333333333333333, "Date": "2016-06-09", "Epoch": "1465444800"}, "2016-07-05": {"Polarity": 1.0, "Date": "2016-07-05", "Epoch": "1467691200"}, "2016-07-07": {"Polarity": 1.0, "Date": "2016-07-07", "Epoch": "1467864000"}, "2016-07-18": {"Polarity": 0.3137254901960784, "Date": "2016-07-18", "Epoch": "1468814400"}, "2016-07-19": {"Polarity": 1.0, "Date": "2016-07-19", "Epoch": "1468900800"}, "2016-07-22": {"Polarity": 1.0, "Date": "2016-07-22", "Epoch": "1469160000"}, "2016-07-25": {"Polarity": 0.6723809523809524, "Date": "2016-07-25", "Epoch": "1469419200"}, "2016-08-08": {"Polarity": 0.0, "Date": "2016-08-08", "Epoch": "1470628800"}, "2016-08-26": {"Polarity": 1.0, "Date": "2016-08-26", "Epoch": "1472184000"}, "2016-08-31": {"Polarity": 1.0, "Date": "2016-08-31", "Epoch": "1472616000"}, "2016-09-22": {"Polarity": 0.14285714285714285, "Date": "2016-09-22", "Epoch": "1474516800"}, "2016-09-23": {"Polarity": -0.3333333333333333, "Date": "2016-09-23", "Epoch": "1474603200"}, "2016-10-06": {"Polarity": 1.0, "Date": "2016-10-06", "Epoch": "1475726400"}, "2016-10-18": {"Polarity": 0.14285714285714285, "Date": "2016-10-18", "Epoch": "1476763200"}, "2016-10-19": {"Polarity": 0.14285714285714285, "Date": "2016-10-19", "Epoch": "1476849600"}, "2016-10-27": {"Polarity": 0.14285714285714285, "Date": "2016-10-27", "Epoch": "1477540800"}, "2016-11-22": {"Polarity": 0.5384615384615384, "Date": "2016-11-22", "Epoch": "1479790800"}, "2016-11-26": {"Polarity": 0.5172413793103449, "Date": "2016-11-26", "Epoch": "1480136400"}, "2016-11-29": {"Polarity": -0.16013071895424838, "Date": "2016-11-29", "Epoch": "1480395600"}, "2016-11-30": {"Polarity": 0.3076923076923077, "Date": "2016-11-30", "Epoch": "1480482000"}, "2016-12-02": {"Polarity": 0.125, "Date": "2016-12-02", "Epoch": "1480654800"}, "2016-12-05": {"Polarity": 0.41435185185185186, "Date": "2016-12-05", "Epoch": "1480914000"}, "2016-12-08": {"Polarity": 0.6153846153846154, "Date": "2016-12-08", "Epoch": "1481173200"}, "2016-12-09": {"Polarity": 0.4495726495726496, "Date": "2016-12-09", "Epoch": "1481259600"}, "2016-12-11": {"Polarity": 0.0, "Date": "2016-12-11", "Epoch": "1481432400"}, "2016-12-12": {"Polarity": 0.5454406704406705, "Date": "2016-12-12", "Epoch": "1481518800"}, "2016-12-14": {"Polarity": 0.32844490453186104, "Date": "2016-12-14", "Epoch": "1481691600"}, "2016-12-15": {"Polarity": 0.26835749954655724, "Date": "2016-12-15", "Epoch": "1481778000"}, "2016-12-17": {"Polarity": 0.46338743802957916, "Date": "2016-12-17", "Epoch": "1481950800"}, "2016-12-18": {"Polarity": 0.6180405242905243, "Date": "2016-12-18", "Epoch": "1482037200"}}
================================================
FILE: IASP520_ARMA_V1.01.py
================================================
from yahoo_finance import Share
from pandas import Series,DataFrame
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm
import statsmodels.api as sm
from statsmodels.graphics.api import qqplot
import statsmodels.tsa.stattools as ts
from scipy import stats
import pywt
yaho = Share('YHOO') #choose stock, YAHOO, GOLD
startday='2015-11-1' #choose first day
endday='2016-12-15' #choose end day
#train = 15 #How many data for train, 9 is the least.
#draw
fig=plt.figure()
ax1=fig.add_subplot(711)
ax2=fig.add_subplot(712)
ax3=fig.add_subplot(713)
ax4=fig.add_subplot(714)
ax5=fig.add_subplot(715)
ax6=fig.add_subplot(716)
ax7=fig.add_subplot(717)
#Data processing
StockDate = DataFrame(yaho.get_historical(startday, endday))
StockDate.index = StockDate.Date
StockDate = DataFrame.sort_index(StockDate) #sort
test = DataFrame(yaho.get_historical(startday, '2016-12-1'))
test.index = test.Date
test = DataFrame.sort_index(test)
test = test['Close']
test=test.astype(float)
test.plot(ax=ax5)
#L=len(StockDate)
#total_predict_data=L-train
'''
#draw
Data = StockDate.drop(['Date','Symbol','Adj_Close'],axis=1)
Data=Data.astype(float)
ax=Data.plot(secondary_y=['Volume'])
ax.set_ylabel('Value')
ax.right_ax.set_ylabel('Volume')
plt.grid(True)
plt.show()
#Create more data
value = pd.Series(Data['Open']-Data['Close'],index=Data.index)
#Data['DOP'] = value #Difference between Open and Close
#Data['DHL'] = Data['High']-Data['Low'] #Difference between High and Low
value[value>=0]=0 #0 means fall
value[value<0]=1 #1 means rise
print(value)
'''
#ARIMA
Close_original = StockDate['Close']
Close_original=Close_original.astype(float)
#Close.plot()
close=pywt.dwt(Close_original, 'db4') #DB4,Wavelet decomposition
Close_db4=pd.Series(close[0])
Close_db4=Close_db4-14
Close_db4.index = pd.Index(sm.tsa.datetools.dates_from_range('2001','2145'))
#aa=Close.diff(3)
#draw
#aa.plot(ax=ax4)
Close_db4.plot(ax=ax2)
Close=Close_db4.diff(4) #stationary time series
Close=Close[4:]
print("Augmented Dickey-Fuller test:",ts.adfuller(Close,4)) #Augmented Dickey-Fuller test
Close.plot(ax=ax3)
Close_original.plot(ax=ax1)
sm.graphics.tsa.plot_acf(Close,lags=40,ax=ax6) #ARIMA,q
sm.graphics.tsa.plot_pacf(Close,lags=40,ax=ax7) #ARIMA,p
#print(Close)
Arma = sm.tsa.ARMA(Close,order=(9,3)).fit(disp=-1, method='mle')
print(Arma.aic,Arma.bic,Arma.hqic)
#predict
Arma_stock=Arma.predict()
Arma_stock.plot(ax=ax3)
predict_stock = Arma.predict('2137','2148',dynamic=True)
predict_stock.plot(ax=ax3)
#reduce diff()
L=len(Arma_stock)
i=0
while i<L:
if(i<4):
Arma_stock[i]=Arma_stock[i]+Close_db4[i]
else:
Arma_stock[i] = Arma_stock[i]+Arma_stock[i-4]
i=i+1
Arma_stock.plot(ax=ax4)
L=len(predict_stock)
i=0
while i<L:
if(i<4):
predict_stock[i] = predict_stock[i]+Arma_stock[-4+i]
else:
predict_stock[i] = predict_stock[i]+predict_stock[i-4]
i=i+1
predict_stock.plot(ax=ax4)
plt.grid(True)
plt.show()
'''
#Data['Value']=value
#SVM
correct = 0
train_original=train
while train<L:
Data_train=Data[train-train_original:train]
value_train = value[train-train_original:train]
Data_predict=Data[train:train+1]
value_real = value[train:train+1]
#print(Data_train)
#print(value_train)
print(train)
#classifier =svm.SVC(kernel='poly') #52% need optimization, some data may expand to infinite demension
#classifier =svm.SVC(kernel='sigmoid') #49%
#classifier =svm.SVC(kernel='precomputed') #bug
#classifier =svm.SVC() #kernel='rbf'
classifier =svm.LinearSVC() #53%
classifier.fit(Data_train,value_train)
print(train)
value_predict=classifier.predict(Data_predict)
print(train)
#print("value_real = ",value_real[0])
#print("value_predict = ",value_predict)
if(value_real[0]==int(value_predict)):
correct=correct+1
print(correct)
train = train+1
correct=correct/total_predict_data*100
print("Correct =",correct,"%")
#test SVM
print("support_:",classifier.support_)
print("support_vectors_:",classifier.support_vectors_)
print("n_support_:",classifier.n_support_)
'''
================================================
FILE: IASP520_SVM.py
================================================
from yahoo_finance import Share
from pandas import Series,DataFrame
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm
yaho = Share('YHOO') #choose stock
startday='2015-11-1' #choose first day
endday='2016-11-23' #choose end day
train = 15 #How many data for train, 9 is the least.
#Data processing
StockDate = DataFrame(yaho.get_historical(startday, endday))
StockDate.index = StockDate.Date
StockDate = DataFrame.sort_index(StockDate) #sort
L=len(StockDate)
total_predict_data=L-train
#draw
Data = StockDate.drop(['Date','Symbol','Adj_Close'],axis=1)
Data=Data.astype(float)
ax=Data.plot(secondary_y=['Volume'])
ax.set_ylabel('Value')
ax.right_ax.set_ylabel('Volume')
#plt.grid(True)
#plt.show()
#Create more data
value = pd.Series(Data['Open'].shift(-1)-Data['Close'].shift(-1),index=Data.index)
Data['Next_Open'] = Data['Open'].shift(-1) #Next day's Open data.
#Data['DHL'] = Data['High']-Data['Low'] #Difference between High and Low
value[value>=0]=0 #0 means fall
value[value<0]=1 #1 means rise
print(value)
#Data['Value']=value
correct = 0
train_original=train
i=0
'''
#Classical classification, normal way
Data_train=Data[0:L-20]
value_train = value[0:L-20]
Data_predict=Data[L-20:L]
value_real = value[L-20:L]
print(Data_predict)
classifier = svm.SVC()
classifier.fit(Data_train,value_train)
value_predict=classifier.predict(Data_predict)
print("value_real = ",value_predict)
while i<19:
print("value_real = ",value_real[i])
if(value_real[i]==int(value_predict[i])):
correct=correct+1
i+=1
print("Correct = ",correct/19*100,"%")
'''
#loop training,15 days data for train
while train<L-1:
Data_train=Data[train-train_original:train]
value_train = value[train-train_original:train]
Data_predict=Data[train:train+1]
value_real = value[train:train+1]
#print(Data_train)
#print(value_train)
classifier = svm.SVC(kernel='poly')#kernel='linear')
classifier.fit(Data_train,value_train)
value_predict=classifier.predict(Data_predict)
#print("value_real = ",value_real[0])
#print("value_predict = ",value_predict)
if(value_real[0]==int(value_predict)):
correct=correct+1
train = train+1
correct=correct/total_predict_data*100
print("Correct = ",correct,"%")
'''
print("support_:",classifier.support_)
print("support_vectors_:",classifier.support_vectors_)
print("n_support_:",classifier.n_support_)
'''
================================================
FILE: IASP520_SVM_V2.py
================================================
#V2.0
#change all the data, now it's base on relation not price.
#Increase the training Data set.
from yahoo_finance import Share
from pandas import Series,DataFrame
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm
yaho = Share('YHOO') #choose stock
startday='2015-11-1' #choose first day
endday='2016-11-23' #choose end day
train = 70 #How many data for train, 9 is the least.
#Data processing
StockDate = DataFrame(yaho.get_historical(startday, endday))
StockDate.index = StockDate.Date
StockDate = DataFrame.sort_index(StockDate) #sort
L=len(StockDate)
total_predict_data=L-train
#draw
Data = StockDate.drop(['Date','Symbol','Adj_Close'],axis=1)
Data=Data.astype(float)
ax=Data.plot(secondary_y=['Volume'])
ax.set_ylabel('Value')
ax.right_ax.set_ylabel('Volume')
plt.grid(True)
plt.show()
#Create more data
value = pd.Series(Data['Close'].shift(-1)-Data['Close'],index=Data.index)
#Data['Next_Open'] = Data['Open'].shift(-1) #Next day's Open data.
Data['High-Low'] = Data['High']-Data['Low'] #Difference between High and Low
Data['NOpen-Close']=Data['Open'].shift(-1)-Data['Close'] #Next Day's Open-today's Close
Data['Close-YClose']=Data['Close']-Data['Close'].shift(1) #Today is rise or fall
Data['Close-Open']=Data['Close']-Data['Open'] #today's Close - Open
Data['High-Close'] = Data['High']-Data['Close'] #today's High - Close
Data['Close-Low'] = Data['Close']-Data['Low'] #today's Close - Low
value[value>=0]=1 #0 means rise
value[value<0]=0 #1 means fall
Data=Data.dropna(how='any')
del(Data['Open'])
del(Data['Close'])
del(Data['High'])
del(Data['Low'])
#print(Data)
print(type(Data))
#Data['Value']=value
correct = 0
train_original=train
i=0
L=len(Data)
'''
#Classical classification, normal way
Data_train=Data[0:L-20]
value_train = value[0:L-20]
Data_predict=Data[L-20:L]
value_real = value[L-20:L]
print(Data_predict)
classifier = svm.SVC()
classifier.fit(Data_train,value_train)
value_predict=classifier.predict(Data_predict)
print("value_real = ",value_predict)
while i<19:
print("value_real = ",value_real[i])
if(value_real[i]==int(value_predict[i])):
correct=correct+1
i+=1
print("Correct = ",correct/19*100,"%")
'''
#loop training,15 days data for train
print(L)
while train<L:
Data_train=Data[train-train_original:train]
value_train = value[train-train_original:train]
Data_predict=Data[train:train+1]
value_real = value[train:train+1]
#print(Data_train)
#print(value_train)
classifier = svm.SVC(kernel='poly')#
classifier.fit(Data_train,value_train)
value_predict=classifier.predict(Data_predict)
#print("value_real = ",value_real[0])
#print("value_predict = ",value_predict)
if(value_real[0]==int(value_predict)):
correct=correct+1
train = train+1
correct=correct/total_predict_data*100
print("Correct = ",correct,"%")
'''
print("support_:",classifier.support_)
print("support_vectors_:",classifier.support_vectors_)
print("n_support_:",classifier.n_support_)
'''
================================================
FILE: IASP520_SVM_V2_With_Polarity_Json.py
================================================
#V2.0
#change all the data, now it's base on relation not price.
#Increase the training Data set.
from yahoo_finance import Share
from pandas import Series,DataFrame
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm
import json
#Json
with open('GYN.json', 'r') as f:
RData = json.load(f)
print(RData.keys())
yaho = Share('YHOO') #choose stock
startday='2015-11-1' #choose first day
endday='2016-12-15' #choose end day
train = 70 #How many data for train, 9 is the least.
#Data processing
StockDate = DataFrame(yaho.get_historical(startday, endday))
StockDate.index = StockDate.Date
StockDate = DataFrame.sort_index(StockDate) #sort
RDate=[]
RPolarity=[]
for key in RData.keys():
RDate.append(RData[key]['Date'])
RPolarity.append(RData[key]['Polarity'])
#print(RDate,RPolarity)
RDataPanda=pd.DataFrame(RPolarity,index=RDate,columns=['Polarity'])
#print(RDataPanda)
StockDate['Polarity']=RDataPanda['Polarity']
StockDate.fillna(value=0,inplace=True)
#print(StockDate['Polarity'])
'''
for index in StockDate.index:
print(index)
for key in RData.keys():
print(index)
print(key)
if (index==key):
StockDate[index,'Polarity'] = RData[key]['Polarity']
print(StockDate['Polarity'])
'''
L=len(StockDate)
total_predict_data=L-train
#draw
Data = StockDate.drop(['Date','Symbol','Adj_Close'],axis=1)
Data=Data.astype(float)
DataPic1=Data.drop(['Polarity'],axis=1)
fig=plt.figure()
ax1=fig.add_subplot(111)
Ax1=DataPic1.plot(secondary_y=['Volume'],ax=ax1)
Ax1.set_ylabel('Value')
Ax1.right_ax.set_ylabel('Volume')
plt.grid(True)
plt.show()
#Create more data
value = pd.Series(Data['Close'].shift(-1)-Data['Close'],index=Data.index)
#Data['Next_Open'] = Data['Open'].shift(-1) #Next day's Open data.
Data['High-Low'] = Data['High']-Data['Low'] #Difference between High and Low
Data['NOpen-Close']=Data['Open'].shift(-1)-Data['Close'] #Next Day's Open-today's Close
Data['Close-YClose']=Data['Close']-Data['Close'].shift(1) #Today is rise or fall
Data['Close-Open']=Data['Close']-Data['Open'] #today's Close - Open
Data['High-Close'] = Data['High']-Data['Close'] #today's High - Close
Data['Close-Low'] = Data['Close']-Data['Low'] #today's Close - Low
value[value>=0]=1 #0 means rise
value[value<0]=0 #1 means fall
Data=Data.dropna(how='any')
del(Data['Open'])
del(Data['Close'])
del(Data['High'])
del(Data['Low'])
#print(Data)
print(type(Data))
#Data['Value']=value
correct = 0
train_original=train
i=0
L=len(Data)
'''
#Classical classification, normal way
Data_train=Data[0:L-20]
value_train = value[0:L-20]
Data_predict=Data[L-20:L]
value_real = value[L-20:L]
print(Data_predict)
classifier = svm.SVC()
classifier.fit(Data_train,value_train)
value_predict=classifier.predict(Data_predict)
print("value_real = ",value_predict)
while i<19:
print("value_real = ",value_real[i])
if(value_real[i]==int(value_predict[i])):
correct=correct+1
i+=1
print("Correct = ",correct/19*100,"%")
'''
#loop training,15 days data for train
print(L)
while train<L:
Data_train=Data[train-train_original:train]
value_train = value[train-train_original:train]
Data_predict=Data[train:train+1]
value_real = value[train:train+1]
#print(Data_train)
#print(value_train)
classifier = svm.SVC(kernel='poly',degree=40)#kernel='poly',(gamma*u'*v + coef0)^degree
classifier.fit(Data_train,value_train)
value_predict=classifier.predict(Data_predict)
#print("value_real = ",value_real[0])
#print("value_predict = ",value_predict)
if(value_real[0]==int(value_predict)):
correct=correct+1
train = train+1
correct=correct/total_predict_data*100
print("Correct = ",correct,"%")
'''
print("support_:",classifier.support_)
print("support_vectors_:",classifier.support_vectors_)
print("n_support_:",classifier.n_support_)
'''
================================================
FILE: NQN.json
================================================
{"2016-11-19": {"Polarity": 0.2751415251415251, "Date": "2016-11-19", "Epoch": "1479531600"}, "2016-11-21": {"Polarity": 0.06792373769117956, "Date": "2016-11-21", "Epoch": "1479704400"}, "2016-11-22": {"Polarity": 0.5, "Date": "2016-11-22", "Epoch": "1479790800"}, "2016-11-23": {"Polarity": 0.14285714285714285, "Date": "2016-11-23", "Epoch": "1479877200"}, "2016-11-25": {"Polarity": 0.12731481481481483, "Date": "2016-11-25", "Epoch": "1480050000"}, "2016-11-29": {"Polarity": -0.02, "Date": "2016-11-29", "Epoch": "1480395600"}, "2016-11-30": {"Polarity": 0.35857713996945495, "Date": "2016-11-30", "Epoch": "1480482000"}, "2016-12-02": {"Polarity": 0.047245290719756014, "Date": "2016-12-02", "Epoch": "1480654800"}, "2016-12-05": {"Polarity": 0.1, "Date": "2016-12-05", "Epoch": "1480914000"}, "2016-12-06": {"Polarity": 0.5, "Date": "2016-12-06", "Epoch": "1481000400"}, "2016-12-07": {"Polarity": 0.5238095238095238, "Date": "2016-12-07", "Epoch": "1481086800"}, "2016-12-08": {"Polarity": 0.40145502645502645, "Date": "2016-12-08", "Epoch": "1481173200"}, "2016-12-09": {"Polarity": 0.3864942528735632, "Date": "2016-12-09", "Epoch": "1481259600"}, "2016-12-10": {"Polarity": 0.3333333333333333, "Date": "2016-12-10", "Epoch": "1481346000"}, "2016-12-12": {"Polarity": 0.008644647933339241, "Date": "2016-12-12", "Epoch": "1481518800"}, "2016-12-14": {"Polarity": 0.21833429390355386, "Date": "2016-12-14", "Epoch": "1481691600"}, "2016-12-15": {"Polarity": 0.21662705486234898, "Date": "2016-12-15", "Epoch": "1481778000"}, "2016-12-16": {"Polarity": 0.13751596460018634, "Date": "2016-12-16", "Epoch": "1481864400"}, "2016-12-18": {"Polarity": 1.0, "Date": "2016-12-18", "Epoch": "1482037200"}}
================================================
FILE: README.md
================================================
StockPrediction
=========
Stock data come from Yahoo_finance by Python.
News data come from tm.plugin by R.
ARMIA
===
Step
---
1.Use Daubechies 4 wavelet to transform the Stock Data which comes from Yahoo_finance.
2.Difference the time series make it stationary.
3.Create ACF & Pacf pictures to find out p & q which is the parameter in ARIMA.
4.Predict the stationary time series by ARIMA(p,q). Because this ARIMA package can't do difference bigger than 2, thus I don't use ARIMA(p,d,q).
5.Revert difference which we do in step 2.
| ARIMA |
|:----------------------------------:|
|  |
SVM
===
Not good enough. I try to transform Price to the relation, like the relation between Open & Close attributes or today & yesterday.
Stock can't be Predicted only based on history stock data, so we pull in new data. It's still not good but much better than before.
| SVM |
|:----------------------------------:|
|  |
gitextract_f3d5p1ip/ ├── .gitattributes ├── .gitignore ├── GYN.json ├── IASP520_ARMA_V1.01.py ├── IASP520_SVM.py ├── IASP520_SVM_V2.py ├── IASP520_SVM_V2_With_Polarity_Json.py ├── NQN.json └── README.md
Condensed preview — 9 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (24K chars).
[
{
"path": ".gitattributes",
"chars": 378,
"preview": "# Auto detect text files and perform LF normalization\n* text=auto\n\n# Custom for Visual Studio\n*.cs diff=csharp\n\n# St"
},
{
"path": ".gitignore",
"chars": 475,
"preview": "IASP520 Project(1).docx\nRe_ Final Project.zip\nRe_ Final Project/GetNewsPolarity.py\nRe_ Final Project/GYN.json\nRe_ Final "
},
{
"path": "GYN.json",
"chars": 4932,
"preview": "{\"2015-01-27\": {\"Polarity\": 0.8888888888888888, \"Date\": \"2015-01-27\", \"Epoch\": \"1422334800\"}, \"2015-02-13\": {\"Polarity\":"
},
{
"path": "IASP520_ARMA_V1.01.py",
"chars": 4017,
"preview": "from yahoo_finance import Share\nfrom pandas import Series,DataFrame\nimport pandas as pd\nimport numpy as np\nimport matplo"
},
{
"path": "IASP520_SVM.py",
"chars": 2381,
"preview": "from yahoo_finance import Share\nfrom pandas import Series,DataFrame\nimport pandas as pd\nimport numpy as np\nimport matplo"
},
{
"path": "IASP520_SVM_V2.py",
"chars": 2970,
"preview": "#V2.0 \n#change all the data, now it's base on relation not price. \n#Increase the training Data set.\nfrom yahoo_finance i"
},
{
"path": "IASP520_SVM_V2_With_Polarity_Json.py",
"chars": 3775,
"preview": "#V2.0 \n#change all the data, now it's base on relation not price. \n#Increase the training Data set.\nfrom yahoo_finance i"
},
{
"path": "NQN.json",
"chars": 1706,
"preview": "{\"2016-11-19\": {\"Polarity\": 0.2751415251415251, \"Date\": \"2016-11-19\", \"Epoch\": \"1479531600\"}, \"2016-11-21\": {\"Polarity\":"
},
{
"path": "README.md",
"chars": 1045,
"preview": "StockPrediction\n=========\nStock data come from Yahoo_finance by Python.\n\nNews data come from tm.plugin by R.\n\nARMIA\n===\n"
}
]
About this extraction
This page contains the full source code of the jerry81333/StockProdiction GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 9 files (21.2 KB), approximately 7.6k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.