Machine learning สำหรับการเงิน

Machine Learning สำหรับการเงินด้วย Python

Nathan George

Data Science Professor

Machine Learning ในด้านการเงิน

Machine Learning สำหรับการเงินด้วย Python

ราคาปิดของ AMD

Machine Learning สำหรับการเงินด้วย Python

กราฟความผันผวน

Machine Learning สำหรับการเงินด้วย Python

ทำความเข้าใจข้อมูล

print(amd_df.head())
            Adj_Close  Adj_Volume
Date                             
1999-03-10      8.690   4871800.0
1999-03-11      8.500   3566600.0
1999-03-12      8.250   4126800.0
1999-03-15      8.155   3006400.0
1999-03-16      8.500   3511400.0
Machine Learning สำหรับการเงินด้วย Python

กราฟราคาปิดและปริมาณการซื้อขาย

Machine Learning สำหรับการเงินด้วย Python

กราฟ EDA

amd_df['Adj_Close'].plot()
plt.show()

ราคาปิดของ AMD

# clears the plot area
plt.clf()
vol = amd_df['Adj_Volume']
vol.plot.hist(bins=50)
plt.show()

ฮิสโตแกรมปริมาณการซื้อขาย

Machine Learning สำหรับการเงินด้วย Python
amd_df['10d_close_pct'] = amd_df['Adj_Close'].pct_change(10)

amd_df['10d_close_pct'].plot.hist(bins=50) plt.show()

ฮิสโตแกรมการเปลี่ยนแปลงราคาเป็นเปอร์เซ็นต์

Machine Learning สำหรับการเงินด้วย Python
amd_df['10d_future_close'] = amd_df['Adj_Close'].shift(-10)

amd_df['10d_future_close_pct'] = amd_df['10d_future_close'].pct_change(10)

ข้อมูลที่ถูก shift และข้อมูล pct_change

Machine Learning สำหรับการเงินด้วย Python
corr = amd_df.corr()
print(corr)
                      10d_future_close_pct  10d_future_close  10d_close_pct  \
10d_future_close_pct              1.000000          0.070742       0.030402   
10d_future_close                  0.070742          1.000000       0.082828   
10d_close_pct                     0.030402          0.082828       1.000000   
Adj_Close                        -0.083982          0.979345       0.073843   
Adj_Volume                       -0.024456         -0.122473       0.044537   

                      Adj_Close  Adj_Volume  
10d_future_close_pct  -0.083982   -0.024456  
10d_future_close       0.979345   -0.122473  
10d_close_pct          0.073843    0.044537  
Adj_Close              1.000000   -0.119437  
Adj_Volume            -0.119437    1.000000
Machine Learning สำหรับการเงินด้วย Python

กราฟกระจายความสัมพันธ์แบบดิบ

Machine Learning สำหรับการเงินด้วย Python

กราฟกระจายความสัมพันธ์แบบเต็ม

Machine Learning สำหรับการเงินด้วย Python

กราฟกระจายความสัมพันธ์สูง

Machine Learning สำหรับการเงินด้วย Python

มาลอง EDA กันเถอะ!

Machine Learning สำหรับการเงินด้วย Python

Preparing Video For Download...