conda install -c conda-forge alpenglow
In case you also intend to run sample code and tutorials, you should install matplotlib as well:
conda install matplotlib
If you encounter any conflict or error, try installing Alpenglow in a clean conda environment.
cd Alpenglow
conda activate [your_cond_env_name]
./install_alpenglow_sip.sh
conda install libgcc
conda install -c conda-forge eigen
pip install .
It is also possible on other plaforms to compile from source similarly, however we don't maintain exact instructions here. For reference on how the official binaries are built, please see the corresponding feedstock.
from alpenglow.experiments import FactorExperiment
from alpenglow.evaluation import DcgScore
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
data = pd.read_csv("http://info.ilab.sztaki.hu/~fbobee/alpenglow/alpenglow_sample_dataset")
factor_model_experiment = FactorExperiment(
top_k=100,
seed=254938879,
dimension=10,
learning_rate=0.14,
negative_rate=100
)
rankings = factor_model_experiment.run(data, verbose=True)
rankings['dcg'] = DcgScore(rankings)
day = 86400
averages = rankings['dcg'].groupby((rankings['time']-rankings['time'].min())//day).mean()
plt.plot(averages)
export CC="ccache cc"
echo 4 > .parallel
pip install --upgrade --force-reinstall --no-deps .
pip install --upgrade --force-reinstall --no-deps -e .
and export PYTHONPATH="$(pwd)/python:$PYTHONPATH"
. You will also need to install the local sip module to this directory: ./install_alpenglow_sip.sh --destdir $(pwd)/python