mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-10 14:26:56 +08:00
Update GRU model.
This commit is contained in:
@@ -89,6 +89,19 @@ class DropnaLabel(DropnaProcessor):
|
||||
"""The samples are dropped according to label. So it is not usable for inference"""
|
||||
return False
|
||||
|
||||
class TanhProcess(Processor):
|
||||
""" Use tanh to process noise data"""
|
||||
def __call__(self, df):
|
||||
def tanh_denoise(data):
|
||||
mask = data.columns.get_level_values(1).str.contains('LABEL')
|
||||
col = df.columns[~mask]
|
||||
data[col] = data[col] - 1
|
||||
data[col] = np.tanh(data[col])
|
||||
|
||||
return data
|
||||
|
||||
return tanh_denoise(df)
|
||||
|
||||
|
||||
class ProcessInf(Processor):
|
||||
"""Process infinity """
|
||||
|
||||
Reference in New Issue
Block a user