We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I am trying to use fairworkflows to describe a simple ML workflow, but I am facing a few issues
fairworkflows
For example whenever I try to use a type annotation to annotate the input or return value of a function I get an error
@is_fairstep(label='Create and fit classifier', is_script_task=True) def fit_classifier(hyper_params: Dict[str, float], data, y): clf = RandomForestClassifier( n_jobs=hyper_params['n_jobs'], random_state=hyper_params['random_state'], ) clf.fit(data, y) return clf
Will raise something like:
Traceback (most recent call last): File "my-model/src/my_model/train.py", line 51, in <module> def fit_classifier(hyper_params: Dict[str, float], data, y): File "site-packages/fairworkflows/fairstep.py", line 452, in _modify_function inputs = _extract_inputs_from_function(func, kwargs) File "site-packages/fairworkflows/fairstep.py", line 504, in _extract_inputs_from_function computational_type = argspec.annotations[arg].__name__ File "/opt/conda/lib/python3.9/typing.py", line 711, in __getattr__ raise AttributeError(attr) AttributeError: __name__
@is_fairstep(label='Evaluate the trained model', is_script_task=True) def evaluate() -> Dict[str, float]: return { 'precision': 0.85, 'recall': 0.80, 'accuracy': 0.85, 'roc_auc': 0.90, 'f1': 0.75, 'average_precision': 0.85, }
will raise:
Traceback (most recent call last): File "my-model/src/my_model/train.py", line 61, in <module> def evaluate(model) -> Dict[str, float]: File "site-packages/fairworkflows/fairstep.py", line 453, in _modify_function outputs = _extract_outputs_from_function(func, kwargs) File "site-packages/fairworkflows/fairstep.py", line 551, in _extract_outputs_from_function computational_type = return_annotation.__name__ if return_annotation is not None else None File "/opt/conda/lib/python3.9/typing.py", line 711, in __getattr__ raise AttributeError(attr) AttributeError: __name__
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I am trying to use
fairworkflows
to describe a simple ML workflow, but I am facing a few issuesFor example whenever I try to use a type annotation to annotate the input or return value of a function I get an error
Will raise something like:
will raise:
The text was updated successfully, but these errors were encountered: