@@ -31,6 +31,7 @@ class Inputs:
31
31
32
32
class Outputs :
33
33
transformed_data = Output ("Transformed Data" , Table , replaces = ["Transformed data" ])
34
+ data = Output ("Data" , Table , default = True )
34
35
components = Output ("Components" , Table )
35
36
pca = Output ("PCA" , PCA , dynamic = False )
36
37
@@ -180,6 +181,7 @@ def clear(self):
180
181
181
182
def clear_outputs (self ):
182
183
self .Outputs .transformed_data .send (None )
184
+ self .Outputs .data .send (None )
183
185
self .Outputs .components .send (None )
184
186
self .Outputs .pca .send (self ._pca_projector )
185
187
@@ -286,7 +288,7 @@ def _update_axis(self):
286
288
axis .setTicks ([[(i , str (i )) for i in range (1 , p + 1 , d )]])
287
289
288
290
def commit (self ):
289
- transformed = components = None
291
+ transformed = data = components = None
290
292
if self ._pca is not None :
291
293
if self ._transformed is None :
292
294
# Compute the full transform (MAX_COMPONENTS components) once.
@@ -311,9 +313,18 @@ def commit(self):
311
313
metas = metas )
312
314
components .name = 'components'
313
315
316
+ data_dom = Domain (
317
+ self .data .domain .attributes ,
318
+ self .data .domain .class_vars ,
319
+ self .data .domain .metas + domain .attributes )
320
+ data = Table .from_numpy (
321
+ data_dom , self .data .X , self .data .Y ,
322
+ numpy .hstack ((self .data .metas , transformed .X )))
323
+
314
324
self ._pca_projector .component = self .ncomponents
315
325
self .Outputs .transformed_data .send (transformed )
316
326
self .Outputs .components .send (components )
327
+ self .Outputs .data .send (data )
317
328
self .Outputs .pca .send (self ._pca_projector )
318
329
319
330
def send_report (self ):
0 commit comments