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

oneHot and bin built-in functions in DaphneLib #752

Closed
pdamme opened this issue Jun 10, 2024 · 2 comments · Fixed by #760
Closed

oneHot and bin built-in functions in DaphneLib #752

pdamme opened this issue Jun 10, 2024 · 2 comments · Fixed by #760
Assignees
Labels
DaphneLib Related to DaphneLib (DAPHNE's Python API) good first issue Non-urgent, simple task with limited scope, suitable for getting started as a contributor.

Comments

@pdamme
Copy link
Collaborator

pdamme commented Jun 10, 2024

A large fraction of the DaphneDSL built-in functions is already supported in the DaphneLib API. However, some typical functions for data preprocessing are still missing. This issue is about making the oneHot and bin built-in functions available on matrices in DaphneLib.

Hints:

  • The code for DaphneLib can be found in src/api/python/. In particular, have a look at src/api/python/operator/nodes/matrix.py, where the already supported functions on matrices are implemented.
  • Script-level test cases should be added in test/api/python/, where there are already several examples of equivalent DaphneLib/DaphneDSL scripts.
  • It is fine to skip the recode built-in function for now, since it has two results -- a case that is not supported for DaphneLib built-in functions yet and that should thoroughly be addressed separately.
@pdamme pdamme added DaphneLib Related to DaphneLib (DAPHNE's Python API) good first issue Non-urgent, simple task with limited scope, suitable for getting started as a contributor. labels Jun 10, 2024
@saminbassiri
Copy link
Contributor

Please assign me to this issue.

@pdamme
Copy link
Collaborator Author

pdamme commented Jun 13, 2024

Sure, go ahead!

pdamme pushed a commit that referenced this issue Jun 21, 2024
This PR closes #752 and makes the oneHot and bin built-in functions available on matrices in DaphneLib.

Features:
- Use oneHot(info) to apply one-hot-encoding on matrices in DaphneLib.
- Use bin(numBins, Min, Max) or bin(numBins) to apply binning on matrices in DaphneLib.

Changes:
- Add oneHot and bin built-in functions for matrices in DaphneLib.
- Script-level test case is added in test/api/python/, ensuring that execution works as expected.
- Update doc/DaphneLib/APIRef.md to add oneHot and bin built-in functions for matrices.

Furthermore, as a follow-up to #666, the inc parameter of the seq function is now also optional in DaphneLib.
- Update doc/DaphneLib/APIRef.md for seq() function with optional inc argument.
- Make argument inc optional with default value 1 in seq() function in DaphneLib.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DaphneLib Related to DaphneLib (DAPHNE's Python API) good first issue Non-urgent, simple task with limited scope, suitable for getting started as a contributor.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants