pdxjohnny on gh-pages
docs: Mon Apr 12 03:33:55 UTC 2… (compare)
pdxjohnny on gh-pages
docs: Sun Apr 11 03:25:49 UTC 2… (compare)
pdxjohnny on gh-pages
docs: Sat Apr 10 03:25:58 UTC 2… (compare)
pdxjohnny on gh-pages
docs: Fri Apr 9 09:06:22 UTC 2… (compare)
pdxjohnny on snyk-fix-98742e62125ff7eb5388f6071fd2b321
fix: operations/image/Dockerfil… (compare)
pdxjohnny on snyk-fix-98742e62125ff7eb5388f6071fd2b321
pdxjohnny on gh-pages
docs: Thu Apr 8 03:34:30 UTC 2… (compare)
pdxjohnny on snyk-fix-4bb1b9c4d21e4f4516cf5e3e12ac08c7
fix: operations/deploy/Dockerfi… (compare)
pdxjohnny on snyk-fix-4bb1b9c4d21e4f4516cf5e3e12ac08c7
pdxjohnny on snyk-fix-33ebe7b2b746d659c5dfc3c13083dda2
fix: dffml/skel/operations/Dock… (compare)
pdxjohnny on snyk-fix-33ebe7b2b746d659c5dfc3c13083dda2
pdxjohnny on gh-pages
docs: Thu Apr 8 01:24:05 UTC 2… (compare)
pdxjohnny on master
service: dev: Port scripts/docs… (compare)
pdxjohnny on snyk-fix-0d54f09ae78d71dd0a0ce473ce7ca45f
fix: operations/nlp/Dockerfile … (compare)
pdxjohnny on snyk-fix-0d54f09ae78d71dd0a0ce473ce7ca45f
pdxjohnny on snyk-fix-2aaa92e9ffe02c2d6cd25d10d023067f
fix: operations/binsec/Dockerfi… (compare)
pdxjohnny on snyk-fix-2aaa92e9ffe02c2d6cd25d10d023067f
pdxjohnny on gh-pages
docs: Wed Apr 7 03:26:10 UTC 2… (compare)
pdxjohnny on snyk-fix-f790ca3982aed8c5df308a329cd0f1ec
fix: operations/image/Dockerfil… (compare)
pdxjohnny on snyk-fix-f790ca3982aed8c5df308a329cd0f1ec
File "/home/runner/work/dffml/dffml/model/daal4py/tests/test_lr.py", line 77, in test_02_predict
correct = self.test_data[i]["Y"]
TypeError: list indices must be integers or slices, not str
i
in this case) to be int, it throws the error. Perhaps a bit redundant, but you could handle this by just casting the type back into int, in the tests that are failing./home/runner/work/dffml/dffml/model/daal4py/tests/test_lr.py", line 77
should be changed to: correct = self.test_data[int(i)]["Y"]
and similarly in the model/scratch
failing tests.
test
directory called test_styles
IntegrationCLITestCase
NoRecordsWithMatchingFeatures
exception, as if the test.csv
file was never changed. I checked if the files are being uploaded correctly, which they are, overwriting the old files. The train function seems to work fine but I can't seem to get the accuracy function to work unless I either restart the server, or name the test file differently (like test2.csv
for example) which I don't want to. Is there any way to get this to work fine? I believe this wasn't happening while using dffml 0.3.7
source
of the csv
file I came cross the following config params https://github.com/intel/dffml/blob/38ddb55ce0276b4590a9afc89dad47ba8cab1e5e/dffml/source/csv.py#L42 Can anyone who have worked on it give me a jist of what role does the following CSV_SOURCE_CONFIG_DEFAULT_tag CSV_SOURCE_CONFIG_DEFAULT_KEY
params does?
key
is a parameter that lets us access Records
in the CSV file.from dffml import Features, Feature, train, accuracy, CSVSource
from dffml_model_scikit import LinearRegressionModel
import asyncio
salarymodel = LinearRegressionModel(
features=Features(
Feature("Years", int, 1),
Feature("Expertise", int, 1),
Feature("Trust", float, 1),
),
predict=Feature("Salary", int, 1),
directory="tempmodel"
)
irismodel = LinearRegressionModel(
features=Features(
Feature("sepal_length", float, 1),
Feature("sepal_width", float, 1),
Feature("petal_length", float, 1)
),
predict=Feature("petal_width", float, 1),
directory="tempmodel"
)
async def main():
s = open("data/salary.csv", "r")
salary = s.read()
s.close()
st = open("data/salarytest.csv", "r")
salarytest = st.read()
st.close()
ir = open("data/iris.csv", "r")
iris = ir.read()
ir.close()
irt = open("data/iristest.csv", "r")
iristest = irt.read()
irt.close()
# write the salary.csv and salarytest.csv files in the train.csv and test.csv files
trainfile = open("data/train.csv", "w")
trainfile.write(salary)
trainfile.close()
testfile = open("data/test.csv", "w")
testfile.write(salarytest)
testfile.close()
# train first model
await train(salarymodel, "data/train.csv")
acc = await accuracy(salarymodel, CSVSource(filename="data/test.csv"))
print("accuracy:", acc)
# rewrite the train.csv and test.csv files to contain a separate dataset
trainfile = open("data/train.csv", "w")
trainfile.write(iris)
trainfile.close()
testfile = open("data/test.csv", "w")
testfile.write(iristest)
testfile.close()
# train different model
await train(irismodel, "data/train.csv")
# NoRecordsWithMatchingFeatures exception occurs, looking for the features in the first dataset despite changing the contents of the train.csv file
acc = await accuracy(irismodel, CSVSource(filename="data/test.csv"))
print("accuracy:", acc)
if __name__ == "__main__":
asyncio.run(main())