titicaca / spark-iforest

Isolation Forest on Spark
Apache License 2.0
226 stars 90 forks source link

Unexpected keyword argument `seed` when initializing IForest via Python API #47

Open AnirbanChakraborty06 opened 1 year ago

AnirbanChakraborty06 commented 1 year ago

When I try to initialize the model (as per Python API convention) using the below statement -

from pyspark_iforest.ml.iforest import IForest

iforest = IForest(
    numTrees=100,
    maxSamples=256,
    maxFeatures=len(features),
    contamination=0.025,
    bootstrap=False,
    seed=42,
)

I receive the error - TypeError: __init__() got an unexpected keyword argument 'seed'. However, when seed argument is removed all works as usual.

Note: Used spark3 branch to generate the distribution .tar.gz file.

titicaca commented 10 months ago

seed was not exposed in the Python api, you can use scala api or add the param in the python wrapper