(data, proj)
| 140 | return proj |
| 141 | |
| 142 | def transform(data, proj): |
| 143 | if proj is None: |
| 144 | raise RuntimeError("Mapper needs to be trained before use.") |
| 145 | |
| 146 | d = np.asmatrix(data) |
| 147 | |
| 148 | # Do projection |
| 149 | res = (d * proj).A |
| 150 | |
| 151 | return res |
| 152 | |
| 153 | if format_data: |
| 154 | source, target = formatter([source, target]) |