Giter Site home page Giter Site logo

casual-inference's Introduction

This is the code for the essay "What makes a readable code? A causal analysis method".

The experiments in this thesis consist of the following three main parts including the production of the dataset, the construction of the causal graph and the causal inference part.

Dataset Construction

This part of the experiment involves three packages including Dataset (PDataset), Data Construction (PData Construction), and Result (PResult).

In the PDataset, we show the code snippets we used in our experiments including DBuse, DScalabrino, and DDorn. Since DDorn includes three types of code snippets (Java, Python, and Cuda), we treat DDorn separately. The files "BuseAndSc.csv" and "Dorn.csv" are used to record the values of different features in different code snippets. Since Scalabrino et al. has already provided the dataset on his own proposed features (as shown in the file "feature_S.csv"), we only need to compute the features proposed by Buse and Weimer.

In the PData Construction, we provide our code that uses the scrML tool to compute different features. The result of the calculation is stored in PResult ("data_Dorn_all.csv", and "data_java_all.csv"). Note that since our experiments are conducted for Java, we distinguish the data in the "data_Dorn_all.csv" file by marking 0 for all non-Java code snippets. The dataset of all code snippets is stored in the PResult ("normal_data.csv"). To remove the non-Java data, we use the file "data_clear.py" in PData Construction and the file is stored in the PResult ("data_clear.csv"). Finally, we merge files "data_clear.csv" in PResult and "feature_S.csv" in PDataset to get the final dataset and store in the PResult ("exp_merge_mix.csv").

Causal Graph Construction

This part of the experiment mainly includes feature screening and causal graph construction. In the PCausal Graph Construction, we provide a jupyter file "DecisionTreeRegression.ipynb" to show the results of feature selection, and we provide a code for causal graph generation ("CDT.py").

Causal Inference

This part of the experiment deals with inference of causal effects and robustness testing. The files "Causal Effect.ipynb" and "Robustness Test Cal.py" in PCausal Effect are used for calculating the causal effect and robustness testing.

casual-inference's People

Contributors

mingjie-chen avatar swy0601 avatar

Watchers

 avatar  avatar  avatar

Forkers

robertyuyang

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.