Created
December 8, 2019 18:52
-
-
Save mhiro2/385c025cf31157642ddb1808cb75c326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kedro.pipeline import Pipeline, node | |
def mean(xs, n): | |
return sum(xs) / n | |
def mean_sos(xs, n): | |
return sum(x*x for x in xs) / n | |
def variance(m, m2): | |
return m2 - m * m | |
pipeline = Pipeline([ | |
node(len, 'xs', 'n'), | |
node(mean, ['xs', 'n'], 'm', name='mean node'), | |
node(mean_sos, ['xs', 'n'], 'm2', name='mean sos'), | |
node(variance, ['m', 'm2'], 'v', name='variance node') | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment