Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed ampds converter #850

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fixed ampds converter #850

wants to merge 2 commits into from

Conversation

klemenjak
Copy link
Collaborator

Hi,

I experienced some issues with the dataset AMPds2 and the new API. I found that the appliance types in the metadata were not correct, so I changed that. Also, I edited the converter for AMPds to fit the second version, which has more data.

Best,
Christoph

@levaphenyl
Copy link
Collaborator

Relates to #682

@levaphenyl
Copy link
Collaborator

CSV files are not anymore available for download on the AMPds2 website. This makes this converter obsolete already :(.

@klemenjak @PMeira Should we try to update to use the .tab files or do we remove the converter and recommend downloading the AMPds2.h5 directly?

@PMeira
Copy link
Collaborator

PMeira commented Jan 6, 2021

@levaphenyl You have to select the original files from the download menu in the file list:

image

This download (ZIP file) includes all CSVs, the HDF5 file, and the equipment manuals.

The .h5 itself is kind of small (maybe resampled?), but if it indeed works and provides the same data, we can at least recommend it.

By the way, we should to keep the original converter (v1) since it is important for historical purposes and reproducibility. Nothing against adding the new one, of course.

@levaphenyl
Copy link
Collaborator

levaphenyl commented Jan 6, 2021

@levaphenyl You have to select the original files from the download menu in the file list:

Useless alarm, sorry 🤦. Thank you for the hint @PMeira!

By the way, we should to keep the original converter (v1) since it is important for historical purposes and reproducibility. Nothing against adding the new one, of course.

If I understand it well, the ideal converter would be able to deal with both v1 and v2 or we need 2 separate files and a lot of duplicated code :D.

gt_temp = np.where(gt_temp<threshold,0,1)
pred_temp = np.array(app_pred)
pred_temp = np.where(pred_temp<threshold,0,1)
return matthews_corrcoef(gt_temp, pred_temp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matthews_corrcoef is missing from the imports in this file, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I will resolve this problem. Thanks!

@PMeira
Copy link
Collaborator

PMeira commented Jan 6, 2021

If I understand it well, the ideal converter would be able to deal with both v1 and v2 or we need 2 separate files and a lot of duplicated code :D.

@levaphenyl Yeah... In this case the differences are not that large (from @klemenjak's commits, column changes and some metadata), so a single converter looks feasible.

Several of the converters have duplicated code, developing a base class/module with most of the common code would be useful later. That probably would be required to abstract some of the HDF5 aspects away too.

Given the current state of things, I think it would be fine to
just rename the new convert_ampds.py to convert_ampds_v2.py if keeping both versions in the same file presents difficulties.

TIMEZONE = "America/Vancouver"

def convert_ampds(input_path, output_filename, format='HDF'):
"""
Convert AMPds R2013 as seen on Dataverse. Download the files
Convert AMPds2 R2016 as seen on Dataverse. Download the files
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth to add a comment here to clarify how to download those, e.g. #850 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants