I spent quite some time figuring out how to install libSVM on Mac OSX and use easy.py and grid.py. I've done quite some research but there are problems such as gnuplot isn't installed in the place where easy.py is calling it with brew.

有帮助吗?

解决方案

It turned out I have to do the following steps

  1. go to https://www.dropbox.com/s/rpn6yersv06tttz/gnuplot-4.2.5-i386.dmg
  2. download the gnuplot-4.2.5-i386.dmg
  3. open the resulting DMG file
  4. open the gnuplot-4.2.3 DMG the Extras folder
  5. drop Gnuplot.app into your applications folder
  6. go to /usr/bin in terminal and do
  7. $ sudo ln -sf "/Applications/Gnuplot.app/Contents/Resources/bin/ gnuplot"

You will be prompted to install X11 if you haven't done so, but after that if you run sample line like

 python easy.py svmguide1 svmguide1.t

it should work. The sample files can be downloaded at http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html#svmguide1

references: http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf

其他提示

Make sure Homebrew is installed, then just run:

brew install gnuplot

Link the executable, so that it is in the PATH (i.e. /usr/bin) and can be found by the Python scripts:

sudo ln -s /opt/local/bin/gnuplot /usr/bin/gnuplot

After that's done, libsvm's Python scripts should not complain any longer.

Since macOS high sierra, /usr/bin is not modifyable by the user anymore, gnuplot is installed at /usr/local/bin instead. Open easy.py and change the path from "/usr/bin" to "/usr/local/bin"

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top