Giter VIP home page Giter VIP logo

sdlib's Introduction

Founder: @Coder-Yu
Main Contributors: @somnussyq @hustzhoutian @DouTong
Code Reviewer: @mingaoo
SDLib: A Python library used to collect shilling detection methods. (for academic research)

How to Run it

  • 1.Configure the **xx.conf** file in the directory named config. (xx is the name of the method you want to run)
  • 2.Run the **main.py** in the project, and then input following the prompt.

How to Configure the Detection Method

Essential Options

Entry Example Description
ratings ../dataset/averageattack/ratings.txt Set the path to the dirty recommendation dataset. Format: each row separated by empty, tab or comma symbol.
label ../dataset/averageattack/labels.txt Set the path to labels (for users). Format: each row separated by empty, tab or comma symbol.
ratings.setup -columns 0 1 2 -columns: (user, item, rating) columns of rating data are used; -header: to skip the first head line when reading data
MethodName DegreeSAD/PCASelect/etc. The name of the detection method
evaluation.setup -testSet ../dataset/testset.txt Main option: -testSet, -ap, -cv
-testSet path/to/test/file (need to specify the test set manually)
-ap ratio (ap means that the user set (including items and ratings) are automatically partitioned into training set and test set, the number is the ratio of test set. e.g. -ap 0.2)
-cv k (-cv means cross validation, k is the number of the fold. e.g. -cv 5)
output.setup on -dir ./Results/ Main option: whether to output recommendation results
-dir path: the directory path of output results.

How to extend it

  • 1.Make your new algorithm generalize the proper base class.
  • 2.Rewrite some of the following functions as needed.
          - readConfiguration()
          - printAlgorConfig()
          - initModel()
          - buildModel()
          - saveModel()
          - loadModel()
          - predict()

How to generate spammers

  • 1.Configure the **xx.conf** file in shillingmodels/config/.
  • 2.Modify /shillingmodels/generateData.py as needed and run it.

How to Configure the Shilling Model

Essential Options

Entry Example Description
ratings ../dataset/averageattack/ratings.txt Set the path to the recommendation dataset. Format: each row separated by empty, tab or comma symbol.
ratings.setup -columns 0 1 2 -columns: (user, item, rating) columns of rating data are used; -header: to skip the first head line when reading data
attackSize 0.01 The ratio of the injected spammers to genuine users
fillerSize 0.01 The ratio of the filler items to all items
selectedSize 0.001 The ratio of the selected items to all items
linkSize 0.01 The ratio of the users maliciously linked by a spammer to all user
targetCount 20 The count of the targeted items
targetScore 5.0 The score given to the target items
threshold 3.0 Item has an average score lower than threshold may be chosen as one of the target items
minCount 3 Item has a ratings count larger than minCount may be chosen as one of the target items
maxCount 50 Item has a rating count smaller that maxCount may be chosen as one of the target items
outputDir ./data/ User profiles and labels will be output here

Implemented Methods

Algorithm Paper
DegreeSAD Wentao Li and Min Gao, Shilling Attack Detection in Recommender Systems via Selecting Patterns Analysis,IEICE Transactions on Information and System (2016)
PCASelectUsers Mehta, Bhaskar, and Wolfgang Nejdl. "Unsupervised strategies for shilling detection and robust collaborative filtering." User Modeling and User-Adapted Interaction (2009)
SemiSAD Cao, Jie, et al. "Shilling attack detection utilizing semi-supervised learning method for collaborative recommender system." World Wide Web 16.5-6 (2013)
FAP Zhang, Yongfeng, et al. "Catch the Black Sheep: Unified Framework for Shilling Attack Detection Based on Fraudulent Action Propagation." IJCAI (2015)
CoDetector Tong Dou, Junliang Yu et al. "Collaborative Shilling Detection bridging Factorization and User Embedding." COLLABORATECOM (2017)

sdlib's People

Contributors

coder-yu avatar yuqi-song avatar hustzhoutian avatar doutong 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.