डेटा ट्रांसफॉर्म, फीचर्स, और टार्गेट्स

Python में Finance के लिए Machine Learning

Nathan George

Data Science Professor

फीचर्स और टार्गेट्स बनाना

features = amd_df[['10d_close_pct', 'Adj_Volume']]

targets = amd_df['10d_future_close_pct']
print(type(features))
pandas.core.series.DataFrame
print(type(targets))
pandas.core.series.Series
Python में Finance के लिए Machine Learning

कीमत और मूविंग एवरेज

Python में Finance के लिए Machine Learning

मूविंग एवरेज

मूविंग एवरेज:

  • औसत के लिए पिछले n दिनों का उपयोग करें
  • n के सामान्य मान: 14, 50, 200
Python में Finance के लिए Machine Learning

कीमत और SMA

Python में Finance के लिए Machine Learning

RSI और कीमत प्लॉट

Python में Finance के लिए Machine Learning

RSI समीकरण

RS समीकरण

Python में Finance के लिए Machine Learning

SMA और RSI की गणना

import talib

amd_df['ma200'] = talib.SMA(amd_df['Adj_Close'].values, timeperiod=200)
amd_df['rsi200'] = talib.RSI(amd_df['Adj_Close'].values, timeperiod=200)
Python में Finance के लिए Machine Learning

आखिरकार, हमारे फीचर्स

feature_names = ['10d_close_pct', 'ma200', 'rsi200']
features = amd_df[feature_names]
targets = amd_df['10d_future_close_pct']

feature_target_df = amd_df[feature_names + '10d_future_close_pct']
Python में Finance के लिए Machine Learning

कोरिलेशन जाँचें

import seaborn as sns

corr = feature_target_df.corr()
sns.heatmap(corr, annot=True)
Python में Finance के लिए Machine Learning

फीचर और टार्गेट का कोरिलेशन प्लॉट

Python में Finance के लिए Machine Learning

आइए फीचर्स और टार्गेट्स बनाएँ!

Python में Finance के लिए Machine Learning

Preparing Video For Download...