# %>>%

0th

Percentile

##### PipeOp Composition Operator

This operator "pipes" data from the source g1 into the sink g2. Both source and sink can either be a Graph or a PipeOp (or an object that can be automatically converted into a Graph or PipeOp, see as_graph() and as_pipeop()).

%>>% tries to automatically match output channels of g1 to input channels of g2; this is only possible if either

• the number of output channels of g1 (as given by g1$output) is equal to the number of input channels of g2 (as given by g2$input), or

• g1 has only one output channel (i.e. g1$output has one line), or • g2 has only one input channel, which is a vararg channel (i.e. g2$input has one line, with name entry "...").

Connections between channels are created in the order in which they occur in g1 and g2, respectively: g1's output channel 1 is connected to g2's input channel 1, channel 2 to 2 etc.

This operator always created deep copies of its input arguments, so they cannot be modified by reference afterwards. To access individual PipeOps after composition, use the resulting Graph's $pipeops list. Both arguments of %>>% are automatically converted to Graphs using as_graph(); this means that objects on either side may be objects that can be automatically converted to PipeOps (such as Learners or Filters), or that can be converted to Graphs. This means, in particular, lists of Graphs, PipeOps or objects convertible to that, because as_graph() automatically applies gunion() to lists. See examples. Note that if g1 is NULL, g2 converted to a Graph will be returned. Analogously, if g2 is NULL, g1 converted to a Graph will be returned. ##### Usage g1 %>>% g2 ##### Arguments g1 (Graph | PipeOp | Learner | Filter | list | ...) Graph / PipeOp / object-convertible-to-PipeOp to put in front of g2. g2 (Graph | PipeOp | Learner | Filter | list | ...) Graph / PipeOp / object-convertible-to-PipeOp to put after g1. ##### Value Graph: the constructed Graph. ##### See Also Other Graph operators: as_graph(), as_pipeop(), assert_graph(), assert_pipeop(), greplicate(), gunion(), pipeline_greplicate() ##### Aliases • %>>% ##### Examples # NOT RUN { o1 = PipeOpScale$new()
o2 = PipeOpPCA$new() o3 = PipeOpFeatureUnion$new(2)

# The following two are equivalent:
pipe1 = o1 %>>% o2

pipe2 = Graph$new()$
add_pipeop(o1$clone(deep = TRUE))$
add_pipeop(o2$clone(deep = TRUE))$
add_edge(o1$id, o2$id)

# Note automatical gunion() of lists.
# The following three are equivalent:
graph1 = list(o1, o2) %>>% o3

graph2 = gunion(list(o1, o2)) %>>% o3

graph3 = Graph$new()$
add_pipeop(o1$clone(deep = TRUE))$
add_pipeop(o2$clone(deep = TRUE))$
add_pipeop(o3$clone(deep = TRUE))$
add_edge(o1$id, o3$id, dst_channel = 1)$add_edge(o2$id, o3\$id, dst_channel = 2)
# }

Documentation reproduced from package mlr3pipelines, version 0.3.0, License: LGPL-3

### Community examples

Looks like there are no examples yet.