READ_ME:

# Similarity Network Fusion
## General Information
This notebook recreates the SNF analysis of Early Bronze Age (EBA), Middle Bronze Age (MBA), and Late Iron Age (LIA) burial sites in Dorset, presented in the paper _Similarity Network Fusion: Understanding Patterns and their Spatial Significance in Archaeological Datasets_. Before you run the script, please make sure you have:
* properly installed SNFpy. For guidance, please follow the instructions on [github](https://github.com/rmarkello/snfpy). The SNFpy package requires Python version 3.5 or greater.
* saved the contingency tables at the location of the snf/data/test folder.
* defined the location of your results under the _save dataset_ section of each analysis

## The Analysis
The analysis was conducted for all three periods (EBA, MBA, LBA) and two different datasets for each period (in total 6 different analyses). One datasat (= dataset 1) gives a more holistic impression of burial rituals and covers a great variety of aspects of the burial data, the other focuses on object related data (= dataset 2). The analysis of each dataset consists of 5 different steps:
1. Import modules: Importing all necessary Python modules
2. Define datasets: Defining the location of your datasets, the contingency tables used for the analysis, and the label file
3. Create similarity network: Creating the actual similarity network for each table and fuse the results to one network
4. Define clusters within network: Defining the clusters within the fused network
5. Save Dataset: Saving the results of the cluster analysis as csv

Additionally, for the holistic dataset of the EBA sites I provided an example of a plot of the results of the fused network.

## The Dataset
All data used in the contingency tables were taken from the [Digital Archive for Grave Goods](https://archaeologydataservice.ac.uk/archives/view/grave_ahrc_2020/database.cfm), also providing [key information](chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://archaeologydataservice.ac.uk/archiveDS/archiveDownload?t=arch-3438-1/dissemination/csv/documentation/2_PGGP_db_input_method_ads.pdf) for the input method of the data and further information on the used vocabularies and the sites. 

The categories defined by the _Grave Good Project_ have not been altered. One exception is the table _Individuals_, for which new categories were defined to ensure comparability.

The meaning of the tables and their attributes can be summarised as follows:

### Dataset 1
* _Cremation_: Cremation or not; attributes: Cremation, Inhumation, Mixed
* _Gravetype_: Different types of graves present at the site; attributes: Cist, Ditchgully, Mound, etc.
* _Hierarchy_: Grave hierarchy; attributes: Primary, Secondary, Unknown
* _Individuals_: Number of individuals; attributes: 1 (=@1), 2 (=@2), 3 (=@3), 4 (=@4), 5(=@5), 6-10 (=@610), 11-20 (=@1120), 21-30 (=@2130), 40-60 (=@4060)
* _Materials_: Materials of the grave goods; attributes: Amber, Bone, Bronze, etc.
* _Monumenttype_: Different types of monuments present at the site; attributes: Bankbarrow, Cist, Hengiform monument, etc.
* _Objecttype_: Types of grave goods; attributes: Brooch, Knife, Sword, etc.

### Dataset 2
* _Objecttype_spez_: Specific types of grave goods; attributes: Biconical Urne; Incense Cup, Collared Urn, etc.
* _Placement_: Where the objects were placed in relation to the body; attributes: anlongside body, head, legs, etc.

The labels relating each column with a unique site ID given by the grave good project are provided in a separate file (_label_).

## Results
The output files (cf. files with ending _Snf_matrix.csv_ or _Snf_matrix_objecttype.csv_) and a file with the site location and their cluster association (cf. _Sites.csv_) used for further processing and representation in GIS are provided separately.