Ask Your Question
2

Is it possible to import machine learning libraries in Sage?

asked 2019-01-10 08:54:55 +0100

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.

edit retag flag offensive close merge delete

Comments

2

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

FrédéricC gravatar imageFrédéricC ( 2019-01-10 08:57:27 +0100 )edit
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 ( 2019-01-10 17:22:29 +0100 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2019-01-10 17:28:44 +0100

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
edit flag offensive delete link more

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: 2019-01-10 08:54:55 +0100

Seen: 1,608 times

Last updated: Jan 10 '19