Code Monkey home page Code Monkey logo

parameter-fitting-experiments's Introduction

These are the experiments for the paper "Robust Parameter Fitting to Realistic Network Models via Iterative Stochastic Approximation".

Additional data can be found at https://doi.org/10.5281/zenodo.10629451.

Installation

  • Make sure you have Python, Pip and R installed.
  • Checkout this repository
  • Install the python dependencies with
pip3 install -r requirements.txt
R -e 'install.packages(c("ggplot2", "reshape2", "plyr", "dplyr", "scales"), repos="https://cloud.r-project.org/")'
  • Download the file konect-data.zip from Zenodo and extract its contents into the folder input_data/konect
  • Optional: Download the file output-data.zip from Zenodo and extract its contents into the folder output_data. This way, you can access all experiment results without running them yourself.

File structure

  • The folder input_data contains all networks used (KONECT) and generated (by random network models).
  • The folder output_data contains all data and figures generated by the experiments.
  • The files experiments-*.py are used for executing the Python experiments.
  • The folder R contains R scripts for generating the plots.
  • The folder plots contains all plots generated by the R scripts.

Executing the experiments

  • Execute python3 experiments-models.py <experiment_name> to run experiments related to the models. The different experiments are as follows:
    • For some <model> in "erdos-renyi", "chung-lu-pl", "girg-1d", run:
      • sample_and_measure_<model> to sample from the model and measure the resulting feature values
      • fit_parameters_<model> to fit the parameters via the ParFit algorithm
      • fitted_sample_and_measure_<model> to sample and measure features based on the fitted parameters
    • merge_csv to merge all files for further processing in R
  • Execute python3 experiments-konect.py <experiment_name> to run experiments related to the real-world networks. The different experiments are as follows:
    • clean_graphs to convert each real-world network to its largest component and convert the format
    • measure_target_features to measure the target features for every real-world network
    • For some <model> in "erdos-renyi", "chung-lu-pl", "girg-1d", run:
      • fit_parameters_<model> to fit the parameters via the ParFit algorithm
      • fitted_sample_and_measure_<model> to sample and measure features based on the fitted parameters
    • merge_csv to merge all files for further processing in R
  • Execute python3 experiments-ablation.py <experiment_name> to run experiments related to the ParFit configuration (i.e., alpha and threshold values). The different experiments are as follows:
    • For some <model> in "erdos-renyi", "chung-lu-pl", "girg-1d", run:
      • fit_parameters_alpha_<model> to fit the parameters via the ParFit algorithm (for alpha experiments)
      • fit_parameters_threshold_<model> to fit the parameters via the ParFit algorithm (for treshold experiments)
      • fitted_sample_and_measure_alpha_<model> to sample and measure features based on the fitted parameters (for alpha experiments)
      • fitted_sample_and_measure_threshold_<model> to sample and measure features based on the fitted parameters (for threshold experiments)
    • merge_csv to merge all files for further processing in R

Running R scripts

Run Rscript R/<scriptname> to run R scripts, found in the Rsubfolder. For example, run Rscript R/erdos-renyi-ablation-alpha.R to generate figures and tables related to the effect of the alpha configuration of ParFit for the ER model. The resulting figures and tables can be found in output_data/figures.

parameter-fitting-experiments's People

Contributors

pfischbeck avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.