You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't call fit() on pipeline created by Pipeline.load("pipeline.ak") in python, because return object doesn't have fit() method . But this method works in Java.
Reason
In Java, Pipeline.load() return a Pipeline object. In Python, it returns a PipelineModel object. One misspelled calss name in pyalink/alink/pipeline/base.py Pipeline.load() appears to cause this.
classPipeline(Estimator):
......
@staticmethoddefcollectLoad(operator: BatchOperator):
_j_pipeline_cls=get_java_class("com.alibaba.alink.pipeline.Pipeline")
j_pipeline=_j_pipeline_cls.collectLoad(operator.get_j_obj())
stages=Pipeline._check_lazy_params(j_pipeline)
returnPipeline(*stages, j_pipeline=j_pipeline)
@staticmethoddefload(file_path: Union[str, FilePath]):
_j_pipeline_cls=get_java_class("com.alibaba.alink.pipeline.PipelineModel")
j_pipeline=_j_pipeline_cls()
ifisinstance(file_path, (str,)):
path=file_pathj_pipeline=_j_pipeline_cls.load(path)
elifisinstance(file_path, FilePath):
operator=file_pathj_pipeline=_j_pipeline_cls.load(operator.get_j_obj())
else:
raiseValueError("file_path must be str or FilePath")
stages=Pipeline._check_lazy_params(j_pipeline)
returnPipeline(*stages, j_pipeline=j_pipeline)
Solution
use collectLoad() instead of load() in pyalink.
The text was updated successfully, but these errors were encountered:
I can't call fit() on pipeline created by Pipeline.load("pipeline.ak") in python, because return object doesn't have fit() method . But this method works in Java.
Reason
In Java, Pipeline.load() return a Pipeline object. In Python, it returns a PipelineModel object. One misspelled calss name in pyalink/alink/pipeline/base.py Pipeline.load() appears to cause this.
Solution
use collectLoad() instead of load() in pyalink.
The text was updated successfully, but these errors were encountered: