Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Script for R #102

Merged
merged 5 commits into from
Aug 14, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ endif
# Compile the mlpack scripts. (Can't do this until ANN is released or a
# git version of mlpack is used.)
#cd methods/mlpack/src/ && ./build_scripts.sh
# Compile the DLIBML scripts.
g++ -O0 -std=c++11 methods/dlibml/src/ALLKNN.cpp -o methods/dlibml/dlibml_allknn -I"$(INCLUDEPATH)" -L"$(LIBPATH)" -ldlib -lmlpack -lboost_program_options -lblas -llapack

.setup:
cd libraries/ && ./download_packages.sh && ./install_all.sh $(BUILD_CORES)
Expand Down
18 changes: 0 additions & 18 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2803,22 +2803,4 @@ methods:
['datasets/abalone7_train.csv', 'datasets/abalone7_test.csv', 'datasets/abalone7_labels.csv'],
['datasets/satellite_train.csv', 'datasets/satellite_test.csv', 'datasets/satellite_labels.csv'],
['datasets/ecoli_train.csv', 'datasets/ecoli_test.csv', 'datasets/ecoli_labels.csv'] ]
---
# dlib-ml
library: dlibml
methods:
ALLKNN:
run: ['metric']
iteration: 3
script: methods/dlibml/ALLKNN.py
format: [csv, txt]
datasets:
- files: ['datasets/wine.csv', 'datasets/cloud.csv',
'datasets/wine_qual.csv', 'datasets/isolet.csv',
'datasets/corel-histogram.csv', 'datasets/covtype.csv',
'datasets/1000000-10-randu.csv', 'datasets/mnist_all.csv',
'datasets/Twitter.csv', 'datasets/tinyImages100k.csv']
options:
k: 3


7 changes: 6 additions & 1 deletion libraries/install_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fi
./nearpy_install.sh $1
if [ "$?" -ne "0" ]; then
echo "Error installing nearpy!";
exit 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

fi
./annoy_install.sh $1
if [ "$?" -ne "0" ]; then
Expand Down Expand Up @@ -79,4 +80,8 @@ if [ "$?" -ne "0" ]; then
echo "Error installing dlib!";
exit 1;
fi

./r_install.sh $1
if [ "$?" -ne "0" ]; then
echo "Error installing dlib!";
exit 1;
fi
1 change: 1 addition & 0 deletions libraries/package-urls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ annoy https://pypi.python.org/packages/3a/14/e733caa00f20544d4f3685434073a6911f4
mrpt https://github.com/teemupitkanen/mrpt/archive/master.tar.gz
milk https://github.com/luispedro/milk/archive/release-0.6.1.tar.gz
dlibml https://github.com/davisking/dlib/archive/v19.4.tar.gz
R https://cran.r-project.org/src/base/R-3/R-3.4.1.tar.gz
24 changes: 24 additions & 0 deletions libraries/r_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#
# Wrapper script to unpack and build R.
#
# Include files will be installed to ../include/.
# Library files will be installed to ../lib/.
#
# One R.tar.gz file should be located in this directory.
tars=`ls R.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No source R.tar.gz found in libraries/!"
exit 1
fi

# Remove any old directory.
rm -rf R/
mkdir R/
tar -xzpf R.tar.gz --strip-components=1 -C R/

cd R/
./configure --prefix=/opt/R/3.4.1 --enable-R-shlib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should install R in lib so we should use --prefix=../../ and if we strip the version we don't have to adjust the path with each update.

make
make install
112 changes: 0 additions & 112 deletions methods/dlibml/ALLKNN.py

This file was deleted.

58 changes: 0 additions & 58 deletions methods/dlibml/src/ALLKNN.cpp

This file was deleted.

34 changes: 0 additions & 34 deletions tests/benchmark_allknn.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,39 +299,5 @@ def test_RunMetrics(self):
self.assertTrue(result["Runtime"] > 0)
self.assertTrue(result["ComputingNeighbors"] > 0)

'''
Test the dlibml All K-Nearest-Neighbors script.
'''
class ALLKNN_DLIBML_TEST(unittest.TestCase):

'''
Test initialization.
'''
def setUp(self):
self.dataset = "datasets/wine.csv"
self.verbose = False
self.timeout = 240

module = Loader.ImportModuleFromPath("methods/dlibml/ALLKNN.py")
obj = getattr(module, "ALLKNN")
self.instance = obj(self.dataset, verbose=self.verbose, timeout=self.timeout)

'''
Test the constructor.
'''
def test_Constructor(self):
self.assertEqual(self.instance.verbose, self.verbose)
self.assertEqual(self.instance.timeout, self.timeout)
self.assertEqual(self.instance.dataset, self.dataset)

'''
Test the 'RunMetrics' function.
'''
def test_RunMetrics(self):
result = self.instance.RunMetrics({ "k": 3 })
print(result)
self.assertTrue(result["Runtime"] > 0)


if __name__ == '__main__':
unittest.main()