You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Only following data processing functions should be placed in Dataset: 数据集中只应放置以下数据处理函数:
59
59
// - The processing is related to specific model. 处理与具体的模型有关。
60
60
// - The processing is related to data split. 处理与数据分割有关。
61
-
///
62
-
///
61
+
///
62
+
///
63
63
structDatasetH{
64
64
pubsegments:Segments,
65
65
pubhandler:DataHandler
@@ -68,7 +68,7 @@ struct DatasetH{
68
68
implDatasetforDatasetH{
69
69
///
70
70
/// 解析配置
71
-
///
71
+
///
72
72
fnconfig(self,config: serde_json::Value){
73
73
todo!()
74
74
}
@@ -85,38 +85,38 @@ impl Dataset for DatasetH{
85
85
86
86
///
87
87
/// 数据处理
88
-
///
88
+
///
89
89
structDataHandler{
90
90
///
91
91
/// The stock list to retrieve. 基线股票集合
92
-
///
92
+
///
93
93
pubinstruments:String,
94
94
95
95
///
96
96
/// start_time of the original data. 原始数据的开始时间
97
-
///
97
+
///
98
98
pubstart_time:String,
99
99
100
100
///
101
101
/// end_time of the original data. 原始数据的结束时间
102
-
///
102
+
///
103
103
pubend_time:String,
104
104
105
105
///
106
106
/// data loader to load the data.
107
-
///
107
+
///
108
108
pubdata_loader:Box<dynDataLoader>,
109
-
109
+
110
110
///
111
111
/// initialize the original data in the constructor.
112
-
///
112
+
///
113
113
pubinit_data:String,
114
-
114
+
115
115
///
116
116
/// Return the original data instead of copy if possible.
117
-
///
117
+
///
118
118
pubfetch_orig:bool,
119
-
119
+
120
120
}
121
121
122
122
implSerializableforDataHandler{
@@ -133,30 +133,30 @@ impl Serializable for DataHandler{
133
133
134
134
///
135
135
/// 片段
136
-
/// 1)
136
+
/// 1)
137
137
/// ```json
138
138
/// 'segments': {
139
139
/// 'train': ("2008-01-01", "2014-12-31"),
140
140
/// 'valid': ("2017-01-01", "2020-08-01",),
141
141
/// 'test': ("2015-01-01", "2016-12-31",),
142
142
/// }
143
143
/// ```
144
-
/// 2)
144
+
/// 2)
145
145
/// ```json
146
146
/// 'segments': {
147
147
/// 'insample': ("2008-01-01", "2014-12-31"),
148
148
/// 'outsample': ("2017-01-01", "2020-08-01",),
149
149
/// }
150
150
/// ```
151
-
///
151
+
///
152
152
enumSegments{
153
153
TVT(SegmentTVT),
154
154
SIMPLE(SegmentsSimple)
155
155
}
156
156
157
157
///
158
158
/// 机器学习常用切片分组
159
-
///
159
+
///
160
160
structSegmentTVT{
161
161
pubtrain:StratEndRange,
162
162
pubvalid:StratEndRange,
@@ -165,15 +165,15 @@ struct SegmentTVT{
165
165
166
166
///
167
167
/// 简单切片,包含输入输出范围
168
-
///
168
+
///
169
169
structSegmentsSimple{
170
170
pubinsample:StratEndRange,
171
171
puboutsample:StratEndRange
172
172
}
173
173
174
174
///
175
175
/// 开始结束范围
176
-
///
176
+
///
177
177
structStratEndRange{
178
178
pubstart:String,
179
179
pubend:String,
@@ -187,19 +187,19 @@ mod dataset_works{
187
187
188
188
#[test]
189
189
fndataset_h_works(){
190
-
let segments = Segments::TVT(super::SegmentTVT{
191
-
train:super::StratEndRange{
190
+
let segments = Segments::TVT(super::SegmentTVT{
191
+
train:super::StratEndRange{
192
192
start:String::from("2008-01-01"),
193
-
end:String::from("2017-12-31")
194
-
},
195
-
valid:super::StratEndRange{
193
+
end:String::from("2017-12-31")
194
+
},
195
+
valid:super::StratEndRange{
196
196
start:String::from("2008-01-01"),
197
-
end:String::from("2017-12-31")
198
-
},
199
-
test:super::StratEndRange{
197
+
end:String::from("2017-12-31")
198
+
},
199
+
test:super::StratEndRange{
200
200
start:String::from("2008-01-01"),
201
-
end:String::from("2017-12-31")
202
-
}
201
+
end:String::from("2017-12-31")
202
+
}
203
203
});
204
204
205
205
let handler:DataHandler = DataHandler{instruments:todo!(),start_time:todo!(),end_time:todo!(),data_loader:todo!(),init_data:todo!(),fetch_orig:todo!()};
0 commit comments