doke93 / Exploratory-data-analysis-and-Regime-Detection-using-KMean--Nifty-50

Performing EDA on Indian indices and Kmeans to detect market regimes
4 stars 0 forks source link

Exploratory data analysis and Regime Detection using KMean- Nifty-50

The goal of this project is to look at the NIFTY-50 data as well as the sectoral indices and visualise them in order to acquire useful information. Also, use the scikit learn python library's Kmean (unsupervised learning model) to find regimes.

Exploratory data analysis

App Screenshot

App Screenshot

App Screenshot

App Screenshot

Regime Detection - Using unsupervised learning algorithm

Use of Regime Detection in finance

-Importing KMeans from scikit learn python library

from sklearn.cluster import KMeans
window = 20
data['mom'] = data[symbol].rolling(window).mean()
data['vol'] = data[symbol].rolling(window).std()
f = ['mom', 'vol']
model = KMeans(n_clusters=4)
model.fit(data[f])
cluster = model.predict(data[f])

App Screenshot

Regime detected by the model