Add pipeline cookbook #4323
Add pipeline cookbook #4323
Conversation
vinx13
commented
Jun 2, 2018
•
|
Pipeline | ||
======== | ||
|
||
Pipeline is a machine that chains multiple transformers and machines. It consists of a sequence of transformers as intermediate stages and a machine as the final stage. Features are transformed by transformers and fed into the next stage sequentially. |
karlnapf
Jun 4, 2018
Member
maybe add sgclass
to link to the API docs
maybe add sgclass
to link to the API docs
Pipeline | ||
======== | ||
|
||
Pipeline is a machine that chains multiple transformers and machines. It consists of a sequence of transformers as intermediate stages and a machine as the final stage. Features are transformed by transformers and fed into the next stage sequentially. |
karlnapf
Jun 4, 2018
Member
could you start every sentence in a new line? I.e. newline after each ".", this makes subsequent diffs way easier to review
could you start every sentence in a new line? I.e. newline after each ".", this makes subsequent diffs way easier to review
Pipeline | ||
======== | ||
|
||
Pipeline is a machine that chains multiple transformers and machines. It consists of a sequence of transformers as intermediate stages and a machine as the final stage. Features are transformed by transformers and fed into the next stage sequentially. |
karlnapf
Jun 4, 2018
Member
"stage" of what? Maybe add "stage of training"
"stage" of what? Maybe add "stage of training"
|
||
# additional integration variables | ||
#![extract_centers_and_radius] | ||
RealMatrix c = kmeans.get_cluster_centers() |
karlnapf
Jun 4, 2018
Member
can this be done with the generic get
?
can this be done with the generic get
?
vinx13
Jun 4, 2018
Author
Member
no, this is not a parameter :(
no, this is not a parameter :(
karlnapf
Jun 4, 2018
Member
I see.
Ok, one of the next things I want to do is to register callback functions with get
so that we can lazily evaluate things, like in this case
I see.
Ok, one of the next things I want to do is to register callback functions with get
so that we can lazily evaluate things, like in this case
REQUIRE( | ||
m_stages.empty() || | ||
holds_alternative<CTransformer*>(m_stages.back()), | ||
"Transformers can not be placed after machines.\n"); |
karlnapf
Jun 4, 2018
Member
Could you maybe make this "Last element in pipeline is %s", and then put the machine name there?
Could you maybe make this "Last element in pipeline is %s", and then put the machine name there?
REQUIRE( | ||
m_stages.empty() || | ||
holds_alternative<CTransformer*>(m_stages.back()), | ||
"Multiple machines are added to pipeline.\n"); |
karlnapf
Jun 4, 2018
Member
same story, pls print the name of the last added machine so the user knows what she did wrong
same story, pls print the name of the last added machine so the user knows what she did wrong
{ | ||
REQUIRE( | ||
!m_stages.empty() && holds_alternative<CMachine*>(m_stages.back()), | ||
"Machine has not been added.\n"); |
karlnapf
Jun 4, 2018
Member
Could you be more elaborate here as well
"Pipline cannot be trained without an added machine. Last element is %s"
Could you be more elaborate here as well
"Pipline cannot be trained without an added machine. Last element is %s"
CLabels* CPipeline::apply(CFeatures* data) | ||
{ | ||
REQUIRE( | ||
!m_stages.empty() && holds_alternative<CMachine*>(m_stages.back()), |
karlnapf
Jun 4, 2018
Member
as above. user facing error messages need to be more explicit
as above. user facing error messages need to be more explicit
{ | ||
REQUIRE( | ||
!m_stages.empty() && index < m_stages.size() - 1, | ||
"Index out of bound. There are only %d transformers.\n", |
karlnapf
Jun 4, 2018
Member
print the index as well
"Requested index (%d) out of bounds " ...
print the index as well
"Requested index (%d) out of bounds " ...
|
||
namespace shogun | ||
{ | ||
class CPipeline : public CMachine |
karlnapf
Jun 4, 2018
Member
Could you write some minimal class docs?
Could you write some minimal class docs?
|
||
EXPECT_EQ(pipeline->get_transformer(1), transformer2.get()); | ||
EXPECT_EQ(pipeline->get_machine(), machine.get()); | ||
} |
karlnapf
Jun 4, 2018
Member
great set of tests!
great set of tests!
Great work! |
b7d2ff9
to
f211b65
f211b65
to
0fa4faa
|
||
#![create_pipeline] | ||
Pipeline pipeline() | ||
pipeline.with(subMean) |
vigsterkr
Jun 13, 2018
Member
this needs fixing, because of reserved keyword
this needs fixing, because of reserved keyword
#![create_pipeline] | ||
Pipeline pipeline() | ||
pipeline.with(subMean) | ||
pipeline.with(pca) |
vigsterkr
Jun 13, 2018
Member
change it
change it
|
and in java
|
550639e
into
shogun-toolbox:feature/transformers
* Add transformer factory * Add pipeline cookbook * Fix swig include
* Add transformer factory * Add pipeline cookbook * Fix swig include
* Add transformer factory * Add pipeline cookbook * Fix swig include
* Add transformer factory * Add pipeline cookbook * Fix swig include
* Add transformer factory * Add pipeline cookbook * Fix swig include