-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Custom TransformerMixin #725
Comments
I am facing the same issue. The AddNewFeatures(equivalent class in my case) class is created inside script_path = 'sklearn_abalone_featurizer.py'. My guess is that error is getting thrown from within in mode_fn(in sklearn_abalone_featurizer.py) |
After several hours of trying (including source_dir), the option that finally worked for me was:
|
Hi, I apologize for the delay in response. You are exactly correct, the suggested approach is to either bring in the file through the |
I know this issue is closed, but I have the same problem. @ChandraLingam, please can I ask what did you include in your |
@wiltonwu how exactly would I add the script to a new directory (and which directory) and then bring it in with |
https://stackoverflow.com/questions/54314876/aws-sagemaker-sklearn-entry-point-allow-multiple-script |
Hi @ChandraLingam and @wiltonwu, Here's my settings:
The files script.py and DataTransformer.py is zipped and uploaded on S3, the 'source_dir' points to the .tar.gz file. |
Am working on same "sklearn_abalone_featurizer.py" and end up with sagemaker_containers._errors.ClientError: module 'main' has no attribute 'AddNewFeatures'. Could you share your solution how you resolved it. I have followed with solution mentioned in this link https://stackoverflow.com/questions/54314876/aws-sagemaker-sklearn-entry-point-allow-multiple-script but no result. Still stuck with same error |
@karthikph007 sklearn_preprocessor = SKLearn( |
@tonybaby16 class DataframeFunctionTransformer():
def process_dataframe(input_df):
|
I have resolved issue by creating DataframeFunctionTransformer.py with class and import it as a module in both training and testing. from package.DataframeFunctionTransformer import DataframeFunctionTransformer, process_dataframe Reference taken from: |
amazon-sagemaker-examples/sagemaker-python-sdk/scikit_learn_inference_pipeline/
In the abalone example, sklearn build-in transformers/encoders are used. How do we integrate a custom transfomer in the SageMaker Pipeline?
I want to add new features that are computed based on other features. When I include the below class as part of the pipeline, transform job fails with an error:
AttributeError: module 'main' has no attribute 'AddNewFeatures'
What is recommended approach for this?
The text was updated successfully, but these errors were encountered: