Giter Site home page Giter Site logo

Comments (3)

nok avatar nok commented on May 31, 2024

Hello @aflugge ,

can you set the compression level to 0? In Python 3.x the default value is 3 I guess.

from sklearn.externals import joblib
# ...
joblib.dump(clf, 'estimator.pkl', compress=0)

Darius

from sklearn-porter.

aflugge avatar aflugge commented on May 31, 2024

Thanks for the reply. Setting compress=0 does not seem to make any difference. However, with "from sklearn.externals import joblib" rather than "import joblib" as I have done before, I get the different error message as below:

Traceback (most recent call last):
File "/home/user/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/user/anaconda3/lib/python3.6/runpy.py", line 85, in run_code
exec(code, run_globals)
File "/home/user/anaconda3/lib/python3.6/site-packages/sklearn_porter/main.py", line 153, in
main()
File "/home/user/anaconda3/lib/python3.6/site-packages/sklearn_porter/main.py", line 148, in main
with open(dest_path, 'w') as file
:
PermissionError: [Errno 13] Permission denied: '/RandomForestClassifier.js'

I did however manage to export my RandomForestClassifier from within Python with
porter = Porter(clf, language='js')
output = porter.export(embed_data=True)
print(output)
So that way it seems to work :)

from sklearn-porter.

nok avatar nok commented on May 31, 2024

Okay, I'm glad that it's working now 😄,

nevertheless, apparently the module hasn't the permission to create a file. Alternatively you can use python -m sklearn_porter -i estimator.pkl --js --pipe > estimator.js to save the output to a file dynamically.

Darius

from sklearn-porter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.