Skip to content

Commit

Permalink
Merge pull request #546 from EducationalTestingService/update-examples
Browse files Browse the repository at this point in the history
Update examples, and create tests
  • Loading branch information
desilinguist committed Oct 16, 2019
2 parents 4c443d4 + 78dcf2c commit 4cfa233
Show file tree
Hide file tree
Showing 42 changed files with 1,914 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
- TESTFILES="tests/test_featureset.py tests/test_utilities.py"
- TESTFILES="tests/test_output.py"
- TESTFILES="tests/test_regression.py"
- TESTFILES="tests/test_input.py tests/test_preprocessing.py tests/test_metrics.py tests/test_custom_learner.py tests/test_logutils.py"
- TESTFILES="tests/test_input.py tests/test_preprocessing.py tests/test_metrics.py tests/test_custom_learner.py tests/test_logutils.py tests/test_examples.py"
- TESTFILES="tests/test_classification.py tests/test_cv.py tests/test_ablation.py"

# run on the new Travis infrastructure
Expand Down
Empty file added examples/__init__.py
Empty file.
20 changes: 7 additions & 13 deletions examples/make_titanic_example_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,16 @@ def main():
logger.info('Creating titanic/test directory')
os.makedirs('titanic/test')

usecols_train = features_to_keep + ['PassengerId', 'Survived']
usecols_test = features_to_keep + ['PassengerId']

# Read and write training FeatureSet
train_fs = Reader.for_path('train.csv',
label_col='Survived',
id_col='PassengerId',
quiet=False,
drop_blanks=True,
pandas_kwargs={'usecols': ['Sex', 'Age',
'Pclass', 'Fare',
'SibSp', 'Parch',
'Embarked',
'PassengerId',
'Survived']},
pandas_kwargs={'usecols': usecols_train},
quiet=False,
sparse=False).read()

train_fs.filter(features=features_to_keep)
Expand Down Expand Up @@ -98,13 +96,9 @@ def main():
# Read and write test FeatureSet
test_fs = Reader.for_path('test.csv',
label_col='Survived',
quiet=False,
drop_blanks=True,
pandas_kwargs={'usecols': ['Sex', 'Age',
'Pclass', 'Fare',
'SibSp', 'Parch',
'Embarked',
'PassengerId']},
pandas_kwargs={'usecols': usecols_test},
quiet=False,
sparse=False).read()

test_fs.filter(features=features_to_keep)
Expand Down
1 change: 1 addition & 0 deletions examples/titanic/evaluate_tuned.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ objectives = ['accuracy']
[Output]
# again, these can be absolute paths
metrics = ['roc_auc']
probability = true
log = output
results = output
predictions = output
Expand Down
2 changes: 1 addition & 1 deletion examples/titanic/learning_curve.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ id_col = PassengerId

[Tuning]
grid_search = false
objectives = ['accuracy']

[Output]
# again, these can be absolute paths
log = output
results = output
metrics = ['accuracy']

0 comments on commit 4cfa233

Please sign in to comment.