wangdx25 commited on
Commit
ca923db
·
verified ·
1 Parent(s): d8d188a

Add TsFile (converted from AAdevloper/nifty50-market-regime)

Browse files
Files changed (2) hide show
  1. README.md +77 -0
  2. nifty50_market_regime.tsfile +0 -0
README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - tabular-classification
5
+ - time-series-forecasting
6
+ tags:
7
+ - tsfile
8
+ - timeseries
9
+ - time-series
10
+ - finance
11
+ - trading
12
+ - market-data
13
+ - nifty50
14
+ - india
15
+ - technical-indicators
16
+ - format:tsfile
17
+ pretty_name: NIFTY 50 Market Regime (TsFile)
18
+ size_categories:
19
+ - 1K<n<10K
20
+ ---
21
+
22
+ # NIFTY 50 Market Regime (TsFile)
23
+
24
+ Apache TsFile version of [`AAdevloper/nifty50-market-regime`](https://huggingface.co/datasets/AAdevloper/nifty50-market-regime).
25
+
26
+ ## Overview
27
+
28
+ Technical indicators and corresponding market-regime labels for the NIFTY 50
29
+ index, used to train binary classification models that predict market regimes
30
+ (`RISK_ON` / `RISK_OFF`) in Indian financial markets. Each record is one daily
31
+ observation with derived indicators (VIX, RSI, moving averages) plus the regime
32
+ label.
33
+
34
+ - **Regimes:** `RISK_ON` (1) — favorable conditions, lower volatility, bullish
35
+ momentum; `RISK_OFF` (0) — unfavorable conditions.
36
+
37
+ ## Schema (TsFile structure)
38
+
39
+ - **Time** (INT64, milliseconds) — the trading date.
40
+ - **india_vix** (FIELD, FLOAT) — India VIX.
41
+ - **rsi_14** (FIELD, FLOAT) — 14-period Relative Strength Index.
42
+ - **ma_50** / **ma_200** (FIELD, FLOAT) — 50-/200-period moving averages.
43
+ - **regime** (FIELD, INT64) — regime label (1 = RISK_ON, 0 = RISK_OFF).
44
+
45
+ ## Usage
46
+
47
+ Install the Apache TsFile Python SDK (`pip install tsfile`) and read a converted file:
48
+
49
+ ```python
50
+ from pathlib import Path
51
+ from tsfile import TsFileReader
52
+
53
+ path = Path("nifty50_market_regime.tsfile")
54
+ with TsFileReader(str(path)) as reader:
55
+ schemas = reader.get_all_table_schemas()
56
+ print("tables:", list(schemas))
57
+ table_name = next(iter(schemas))
58
+ table = schemas[table_name]
59
+ columns = [column.get_column_name() for column in table.get_columns()]
60
+ print("columns:", columns)
61
+ field_names = [
62
+ column.get_column_name()
63
+ for column in table.get_columns()
64
+ if column.get_column_name() not in {"Time", "time"}
65
+ ]
66
+ if field_names:
67
+ with reader.query_table(table_name, field_names[:3], batch_size=1024) as result:
68
+ batch = result.read_arrow_batch()
69
+ if batch is not None:
70
+ print(batch.to_pandas().head())
71
+ ```
72
+
73
+ ## Source & license
74
+
75
+ - Original dataset: https://huggingface.co/datasets/AAdevloper/nifty50-market-regime
76
+ - Author / publisher: AAdevloper
77
+ - License: MIT
nifty50_market_regime.tsfile ADDED
Binary file (33.1 kB). View file