|
6 | 6 | ParallelTableTransform(transforms)
|
7 | 7 |
|
8 | 8 | A transform where `transforms` are applied in parallel.
|
| 9 | +It [`isrevertible`](@ref) if any of the constituent |
| 10 | +`transforms` is revertible. In this case, the |
| 11 | +[`revert`](@ref) is performed with the first |
| 12 | +revertible transform in the list. |
9 | 13 |
|
10 | 14 | # Examples
|
11 | 15 |
|
12 | 16 | ```julia
|
13 | 17 | Scale(low=0.3, high=0.6) ⊔ EigenAnalysis(:VDV)
|
14 | 18 | ZScore() ⊔ EigenAnalysis(:V)
|
15 | 19 | ```
|
| 20 | +
|
| 21 | +### Notes |
| 22 | +
|
| 23 | +- Metadata is transformed with the first revertible |
| 24 | + transform in the list of `transforms`. |
16 | 25 | """
|
17 | 26 | struct ParallelTableTransform <: TableTransform
|
18 | 27 | transforms::Vector{Transform}
|
@@ -95,19 +104,16 @@ function revert(p::ParallelTableTransform, newtable, cache)
|
95 | 104 | fcols = Tables.columns(newfeat)
|
96 | 105 | names = Tables.columnnames(fcols)
|
97 | 106 |
|
98 |
| - # retrieve subtable to revert |
| 107 | + # subset of features to revert |
99 | 108 | rnames = names[range]
|
100 | 109 | rcols = [Tables.getcolumn(fcols, j) for j in range]
|
101 | 110 | rfeat = (; zip(rnames, rcols)...) |> Tables.materializer(newfeat)
|
102 | 111 |
|
103 |
| - # revert transform on subtable |
104 |
| - feat = revert(rtrans, rfeat, rcache) |
105 |
| - |
106 | 112 | # propagate metadata
|
107 |
| - meta = newmeta |
| 113 | + rtable = attach(rfeat, newmeta) |
108 | 114 |
|
109 |
| - # attach features and metadata |
110 |
| - attach(feat, meta) |
| 115 | + # revert transform |
| 116 | + revert(rtrans, rtable, rcache) |
111 | 117 | end
|
112 | 118 |
|
113 | 119 | function reapply(p::ParallelTableTransform, table, cache)
|
|
0 commit comments