Skip to content

Latest commit

 

History

History
 
 

algorithms

A Few Early Example Algorithms in DaphneDSL

Example data

To get some toy example data, you may execute the following commands from the repository's root directory:

mkdir data
curl https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv -o data/wine.csv
sed -i '1d' data/wine.csv
sed -i 's/;/,/g' data/wine.csv
echo '{"numRows": 4898, "numCols": 12, "valueType": "f64", "numNonZeros": 58776}' > data/wine.csv.meta

This downloads a dataset in CSV format, slightly transforms it to be readable with DAPHNE's current CSV reader, and creates a metadata file for the CSV file.

Some example invocations

Run these example invocations from the repository's root directory. Note that all of them are toy examples on small datasets (either the one downloaded above or random data).

Connected components

bin/daphne scripts/algorithms/components.daph n=100 e=500 C=\"outC.csv\"

Does not work with vectorized execution (--vec) at the moment.

Gaussian Nonnegative Matrix Factorization (GNMF)

bin/daphne scripts/algorithms/gnmf.daph rank=2 n=100 e=500 W=\"outW.csv\" H=\"outH.csv\"

Does not work with vectorized execution (--vec) at the moment (executes, but with different results).

Linear Regression using the Direct Solve method

bin/daphne scripts/algorithms/lmDS.daph XY=\"data/wine.csv\" icpt=0 reg=0.0000001 verbose=true

Linear Regression using the Conjugate Gradient method

bin/daphne scripts/algorithms/lmDS.daph XY=\"data/wine.csv\" icpt=0 reg=0.0000001 tol=0.0000001 maxi=0 verbose=true

Multinomial Logistic Regression using Trust Region method

bin/daphne scripts/algorithms/multiLogReg.daph XY=\"data/wine.csv\" B=\"output.csv\"

Does not work with vectorized execution (--vec) at the moment

Principal Component Analysis (PCA)

bin/daphne scripts/algorithms/pca.daph X=\"data/wine.csv\" K=2 center=true scale=false Xout=\"outX.csv\" Mout=\"outM.csv\"