First time here? Check out the FAQ!

Ask Your Question
2

Is it possible to import machine learning libraries in Sage?

asked 6 years ago

Stockfish3709 gravatar image

I'm doing a machine learning program in Sage and I wish to use Tensorflow or Scikit learn. However, I don't see any way to import the modules in Sage. I'm wondering if it is possible to import other modules outside of Sage into Sage, or if Sage is essentially a black box system that doesn't work with any other module.

Preview: (hide)

Comments

2

you can import any python module that is installed in sage's own python.

FrédéricC gravatar imageFrédéricC ( 6 years ago )
2

or more precisely in the python used by sage, which can be the system's python, depending on the way you installed sage.

FrédéricC gravatar imageFrédéricC ( 6 years ago )

1 Answer

Sort by » oldest newest most voted
3

answered 6 years ago

tmonteil gravatar image

You have to install the Python packages in the Sage virtual environement. For this, you have to open a terminal (assuming you are using GNU/Linux) and type:

sage --pip install tensorflow

And then, from Sage:

sage: import tensorflow
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 6 years ago

Seen: 1,663 times

Last updated: Jan 10 '19