open-source software's responsibility to science · 2020. 8. 9. · gatekeepers names...
TRANSCRIPT
![Page 1: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/1.jpg)
Open-Source Software’sResponsibility to Science
Joel Nothman
20th July 2018
![Page 2: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/2.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 2
Me in open source
I Mostly contributed to popular Scientific Python libraries:scikit-learn, nltk, scipy.sparse, pandas, ipython, numpydoc
I Also information extraction evaluation (neleval), etc.
I Community service
I “Volunteer software development”
I With thanks to our financial sponsors
I Caretakers aren’t always founders
I Founders aren’t always caretakers
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 3: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/3.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 3
Overheard at ICML
Don’t worry about how tricky it is to implement . . .
Someone will put it in Scikit-learn and you can just use it.
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 4: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/4.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 4
Thoughts on an arrogant ML researcher
I Scientists think software maintenance is no big deal
I Science and engineering rely heavily on open-source infrastructure
I Popular tools become de-facto standards
I Most users are uncomfortable building their own tools
I Many will only use what’s provided in a popular library
I Many will not inspect how it works on the inside
I Volunteer maintainers act as gatekeepers
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 5: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/5.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 4
Thoughts on an arrogant ML researcher
I Scientists think software maintenance is no big deal
I Science and engineering rely heavily on open-source infrastructure
I Popular tools become de-facto standards
I Most users are uncomfortable building their own tools
I Many will only use what’s provided in a popular library
I Many will not inspect how it works on the inside
I Volunteer maintainers act as gatekeepers
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 6: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/6.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 5
The power of the gatekeeper
I decides which algorithms are available
I decides how to ensure correctness and stability
I decides how to name or describe the algorithm
I decides whether to be faithful to a published description
I decides on an API that may facilitate good science/engineering
OSS maintainers can enable or inhibit scientific best practices
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 7: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/7.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 5
The power of the gatekeeper
I decides which algorithms are available
I decides how to ensure correctness and stability
I decides how to name or describe the algorithm
I decides whether to be faithful to a published description
I decides on an API that may facilitate good science/engineering
OSS maintainers can enable or inhibit scientific best practices
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 8: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/8.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 6
But you can’t blame the gatekeeper
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ANDCONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED.
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 9: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/9.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 7
This presentation is a series of examples
I Risks to good science and engineering related to software design
I Some things we do to help science
I Some things we have changed to help science
I Some things we have yet to solve
I There’s not a great deal of NLP in herebut there’s a lot of ML and software engineering in NLP(so I hope it is relevant, interesting and accessible)
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 10: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/10.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 8
Scikit-learn preliminaries
I An ecosystem of estimatorsI Fit an estimator on some data, so that it can:
I describe the training dataI transform unseen dataI predict a target for unseen data
I Data is usually a numeric matrix X (samples × features)I May provide a target vector or matrix y at training time
I real valued for regressionI categories for multiclass classificationI multiple columns of binary targets for multilabel classification
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 11: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/11.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 9
Methods and results and are indecipherable if researchers publish aninappropriate, or underspecified, algorithm name
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 12: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/12.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 10
A simple example of a bad name
I sklearn.covariance.GraphLasso for sparse inverse covariance estimation
I but Graph Lasso is sparse regression where the features lie on a graph
I the paper for covariance estimation named it Graphical Lasso
Solution deprecate GraphLasso and rename it GraphicalLasso
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 13: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/13.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 10
A simple example of a bad name
I sklearn.covariance.GraphLasso for sparse inverse covariance estimation
I but Graph Lasso is sparse regression where the features lie on a graph
I the paper for covariance estimation named it Graphical Lasso
Solution deprecate GraphLasso and rename it GraphicalLasso
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 14: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/14.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 11
Tripping over hidden parameters
I precision_score([‘a’,‘a’,‘b’,‘b’,‘c’], [‘a’,‘b’,‘b’,‘c’,‘c’])
I For multi-class or multi-label, how should you average across classes?I Pa = 1
1 , Pb =12 , Pc =
12
I average=’micro’ ⇒ 35
I average=’macro’ ⇒ (1 + 12 + 1
2 )/3 = 23
I average=’weighted’ ⇒ (2× 1 + 2× 12 + 1× 1
2 )/5 = 710
I for a long time, prevalence-weighted macro average was the default
∴ papers say “We achieved a precision of . . . ”
Solution precision_score raises an error if the data is not binary,unless the user specifies average.
Use the API to force literacy & awareness
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 15: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/15.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 11
Tripping over hidden parameters
I precision_score([‘a’,‘a’,‘b’,‘b’,‘c’], [‘a’,‘b’,‘b’,‘c’,‘c’])
I For multi-class or multi-label, how should you average across classes?I Pa = 1
1 , Pb =12 , Pc =
12
I average=’micro’ ⇒ 35
I average=’macro’ ⇒ (1 + 12 + 1
2 )/3 = 23
I average=’weighted’ ⇒ (2× 1 + 2× 12 + 1× 1
2 )/5 = 710
I for a long time, prevalence-weighted macro average was the default
∴ papers say “We achieved a precision of . . . ”
Solution precision_score raises an error if the data is not binary,unless the user specifies average.
Use the API to force literacy & awareness
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 16: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/16.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 12
What’s in a name?
I What makes an implementation of some named algorithm correct?
I Faithful to a published research paper?
I Faithful to a reference implementation?
I Faithful to some community of practice?
I Consistent with other components of our software library?
I Consistent with previous versions of the library?
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 17: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/17.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 13
Experimenters report sub-optimal resultsbecause they assume our implementation is nicely behaved
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 18: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/18.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 14
The fit you thought was finished
I Many optimisations are iterative
I have criteria to test if it has converged on an optimum
I Predictions and inferences may be poor if parameters did not converge
Solution Warn if we did not detect convergencebut if we have too many warnings, users ignore them. . .
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 19: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/19.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 14
The fit you thought was finished
I Many optimisations are iterative
I have criteria to test if it has converged on an optimum
I Predictions and inferences may be poor if parameters did not converge
Solution Warn if we did not detect convergencebut if we have too many warnings, users ignore them. . .
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 20: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/20.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 15
The words you didn’t mean to stop
I CountVectorizer turns text into a term-document matrix
I can choose stop words: None, ‘english’ or BYO
I ‘english’ will remove system (and used to remove computer)
I ‘english’ will remove five, six, eight but not seven
I ‘english’ will remove we have but treat we’ve as ve
I This is documented nowhere.
I See my NLP-OSS paper with Hanmin Qin and Roman Yurchak
Solution Deprecate ‘english’ and add another perfect stop list . . .
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 21: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/21.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 15
The words you didn’t mean to stop
I CountVectorizer turns text into a term-document matrix
I can choose stop words: None, ‘english’ or BYO
I ‘english’ will remove system (and used to remove computer)
I ‘english’ will remove five, six, eight but not seven
I ‘english’ will remove we have but treat we’ve as ve
I This is documented nowhere.
I See my NLP-OSS paper with Hanmin Qin and Roman Yurchak
Solution Deprecate ‘english’
and add another perfect stop list . . .
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 22: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/22.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 15
The words you didn’t mean to stop
I CountVectorizer turns text into a term-document matrix
I can choose stop words: None, ‘english’ or BYO
I ‘english’ will remove system (and used to remove computer)
I ‘english’ will remove five, six, eight but not seven
I ‘english’ will remove we have but treat we’ve as ve
I This is documented nowhere.
I See my NLP-OSS paper with Hanmin Qin and Roman Yurchak
Solution Deprecate ‘english’ and add another perfect stop list . . .
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 23: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/23.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 16
The intercept you didn’t mean to regularise
I In Logistic Regression, we learn a weight vector β
I and a bias term β0 which corresponds to a feature x0 of all-1s
I Regularisation: minimise√∑
i β2i to ensure small weights as well as small loss
I liblinear regularises β0. You probably never want to do this.
I All our other linear estimators do not regularise the intercept.
Sol’n 1 intercept_scaling: also need to optimise x0’s fill value. . . but most users don’t see/do this
Sol’n 2 Implement alternative optimisers, and deprecate liblinear as defaultLogisticRegression solver
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 24: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/24.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 16
The intercept you didn’t mean to regularise
I In Logistic Regression, we learn a weight vector β
I and a bias term β0 which corresponds to a feature x0 of all-1s
I Regularisation: minimise√∑
i β2i to ensure small weights as well as small loss
I liblinear regularises β0. You probably never want to do this.
I All our other linear estimators do not regularise the intercept.
Sol’n 1 intercept_scaling: also need to optimise x0’s fill value
. . . but most users don’t see/do this
Sol’n 2 Implement alternative optimisers, and deprecate liblinear as defaultLogisticRegression solver
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 25: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/25.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 16
The intercept you didn’t mean to regularise
I In Logistic Regression, we learn a weight vector β
I and a bias term β0 which corresponds to a feature x0 of all-1s
I Regularisation: minimise√∑
i β2i to ensure small weights as well as small loss
I liblinear regularises β0. You probably never want to do this.
I All our other linear estimators do not regularise the intercept.
Sol’n 1 intercept_scaling: also need to optimise x0’s fill value. . . but most users don’t see/do this
Sol’n 2 Implement alternative optimisers, and deprecate liblinear as defaultLogisticRegression solver
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 26: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/26.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 17
Analysis of code on GitHub shows that people use defaultparameters when they shouldn’t
Andreas Muller
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 27: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/27.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 18
Most users are lazyI Users don’t explore alternatives
I alternative parameters valuesI alternative software libraries
I My students tend to use a CountVectorizer evenwhen they’re counting non-words (e.g. synsets)
I We try to provide sensible default parameters
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 28: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/28.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 19
Sensible default fail
I Ten-tree forests
I Three-fold cross validation
I ?? A tokeniser that splits on word-internal punctuation
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 29: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/29.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 20
What makes a default value good?
I Good defaults should give good predictive models and reliable statisticsI ? Good defaults should behave how users expect
I but different communities of practice
I Good defaults should be invariant to:I sample size (for stability in cross validation)I number of features (for stability in model selection)I ?feature scaling (for stability in different tasks/datasets)
I Example: finding a good default γ for an RBF kernel (#779, #10331)
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 30: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/30.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 21
Good parametrisation
I We choose the defaults, but also how parameters are expressed
I (and whether they can be changed at all)
I Should number of nearest neighbors be specified as:I an absolute value (e.g. 10)?I a proportion of training samples (e.g. 2%)?I an arbitrary function of training data shape?
I Algorithms and optimisation research often don’t report on this
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 31: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/31.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 22
Scientific software should make it easy for users to do good science.
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 32: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/32.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 23
Have you ever tried to de-tokenise the Penn TreeBank?
I PTB is delivered with each token POS tagged or bracketed
I We wanted to know how paragraph structure, etc. informed parsing
I The source text before tokenisation is available
I An easy case:
[ Imports/NNS ]
were/VBD at/IN
[ $/$ 50.38/CD billion/CD ]
,/, up/RB
[ 19/CD %/NN ]
./.
Imports were at $50.38billion, up 19%.
Imports 1–7were 9–12at 14–15$ 16–1650.38 17–21
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 33: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/33.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 24
Have you ever tried to de-tokenise the Penn TreeBank?
I PTB is delivered with each token POS tagged or bracketed
I We wanted to know how paragraph structure, etc. informed parsing
I The source text before tokenisation is available
⇒ alignment hell due to typos corrected/inserted, reorderings, missed text, etc.
I Hindsight: delivering annotations on tokenised text is a bad idea
I It restricts what you can do with it later
I NLP software should always provide stand-off markup
I Or store the whitespace/non-token data as spaCy does
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 34: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/34.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 25
Avoiding leakage in cross validation
Bad X_preprocessed = preprocessor.fit_transform(X)
result = cross_validate(classifier, X_preprocessed, y)
Test data statistics leak into preprocessing⇒ inflated cross validation results
Good pipeline = make_pipeline(preprocessor, classifier)
result = cross_validate(pipeline, X, y)
Solution De-emphasise fit_transform.And make sure Pipeline works with everything;and make sure cross_validate works with everything.
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 35: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/35.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 25
Avoiding leakage in cross validation
Bad X_preprocessed = preprocessor.fit_transform(X)
result = cross_validate(classifier, X_preprocessed, y)
Test data statistics leak into preprocessing⇒ inflated cross validation results
Good pipeline = make_pipeline(preprocessor, classifier)
result = cross_validate(pipeline, X, y)
Solution De-emphasise fit_transform.And make sure Pipeline works with everything;and make sure cross_validate works with everything.
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 36: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/36.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 26
Maintainers of large projectscan’t be experts in all the things they maintain
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018
![Page 37: Open-Source Software's Responsibility to Science · 2020. 8. 9. · Gatekeepers Names Surprises Sensibility Misdirection Collaborate2 Me in open source I Mostly contributed to popular](https://reader035.vdocuments.us/reader035/viewer/2022071219/60546f939ec0476f7d59ab5d/html5/thumbnails/37.jpg)
Gatekeepers Names Surprises Sensibility Misdirection Collaborate 27
Scientists can (and do) help us:
I make sure the implementation matches the name
I make users aware of or avoid unexpected behaviour
I parametrise algorithms and set defaults helpfully
I understand how our design choices lead to flawed experiments
Users trust popular OSS.Thank you for helping us make OSS trustworthy.
Joel Nothman Open-Source Software’s Responsibility to Science 20th July 2018