-
Notifications
You must be signed in to change notification settings - Fork 138
Conversation
Sweet!! Can you add a test case for this too please? |
For the testcase just copy https://github.com/intel/dffml/blob/master/tests/source/test_file.py into test_csv.py, pass it a repo to update. Write it out to a tempfile and check that the headers are there. You only added close, so don't worry about testing the other methods unless you want to, that can me a separate PR if so |
I ran a quick test to verify and looks like it works! You're test should make a $ dffml predict all \
-model dnn \
-sources csv=iris_test.csv \
-classifications 0 1 2 \
-features \
def:SepalLength:float:1 \
def:SepalWidth:float:1 \
def:PetalLength:float:1 \
def:PetalWidth:float:1 \
-caching \
-update
...
[
{
"classification": "1",
"extra": {},
"features": {
"PetalLength": 4.2,
"PetalWidth": 1.5,
"SepalLength": 5.9,
"SepalWidth": 3.0
},
"last_updated": "2019-03-11T09:11:25Z",
"prediction": {
"classification": "1",
"confidence": 1.0
},
"src_url": "0"
},
...
{
"classification": "1",
"extra": {},
"features": {
"PetalLength": 4.3,
"PetalWidth": 1.3,
"SepalLength": 6.4,
"SepalWidth": 2.9
},
"last_updated": "2019-03-11T09:11:25Z",
"prediction": {
"classification": "1",
"confidence": 1.0
},
"src_url": "29"
}
]
$ dffml list repos -log debug -sources csv=iris_test.csv
DEBUG:dffml.util.cli:Setting <dffml.cli.ListRepos object at 0x7f7b223bcf60>.log = 20
DEBUG:dffml.util.cli:Setting <dffml.cli.ListRepos object at 0x7f7b223bcf60>.sources = [CSVSource('iris_test.csv')]
DEBUG:dffml.source.csv:CSVSource('iris_test.csv') loaded 30 records
Undetermined (0.0% confidence) 0 classified as: 1
SepalLength 5.9
SepalWidth 3.0
PetalLength 4.2
PetalWidth 1.5
prediction 1
confidence 1.0
...
Undetermined (0.0% confidence) 29 classified as: 1
SepalLength 6.4
SepalWidth 2.9
PetalLength 4.3
PetalWidth 1.3
prediction 1
confidence 1.0
DEBUG:dffml.source.csv:CSVSource('iris_test.csv') saved 30 records As seen from this output, and you'll find when you write the testcase, that you'll need to change the Lines 38 to 42 in 88f4b31
|
Codecov Report
@@ Coverage Diff @@
## master #17 +/- ##
=========================================
Coverage ? 93.46%
=========================================
Files ? 30
Lines ? 1637
Branches ? 155
=========================================
Hits ? 1530
Misses ? 95
Partials ? 12
Continue to review full report at Codecov.
|
Whooo hooooo!!! Thanks @sudharsana-kjl!!! You're the first contributor 🎉 🎉 🎉 🎉 🎉 🎉 🎉 |
Thank you :) |
Removed
Changed
Added