Test Result Set for OPDC app¶
- class test_result_set_opdc.TestResultSetOPDC(folder_relative_path)¶
Test Result Set class for OPDC app. Its main functionality is to read all the files (measurements) within a given path and extract the features. It will return a data frame where the rows are the measurements and the columns correspond to the extracted features.
- Parameters:
folder_relative_path (str) – (required) the relative folder path
- Example:
>>> import pdkit >>> testResultSet = pdkit.TestResultSet(folderpath) >>> dataframe = testResultSet.process
where folderpath is the relative folder with the different measurements. OPDC style datasets can be collected using the open source Hopkins PD app for Android or by application to the OPDC project.
- Example:
>>> testResultSet.write_output(dataframe, name)
To write the data frame to a output file (name)
- process()¶
This method reads all the directories that contain files (measurements) within a given relative path and extracts the features. the resulting dataframe with all the features processed is saved in testResultSet.features Where features Dataframe the rows are the measurements and the columns correspond to the extracted features. The data frame will have a column ‘id’ with the name of the measurement.
- write_output(filename, output_format='csv')¶
This method writes to a file the features data frame.
- Parameters:
filename (string) – the name to give to the file
output_format (string) – the format of the file to write (‘csv’, ‘json’ or ‘sql’)