Skip to content

JasonLC506/LabelRanking

Repository files navigation

LabelRanking (LR)

Label Ranking algorithms & data sets 9 LR algorithms implementations are included. One (DTPG) is proposed by author, while among the other 8, 6 (RPC, LWR, SMP, KNN-PL, KNN-M, LogLinear) are existing state-of-the-art label ranking algorithms, 2 are baselines (both implemented as logRegression.py, as LogR and NAIVE).

Data sets:

  1. Facebook Post data: For each post in Facebook, sorting the predefined six emoticons by the votes from users to each of them into label ranking. The post feature is obtained using AlchemyLanguage sentiment analysis tool to analyze post text content. Data format: each line as a post, with ["feature_emotion"] as post feature, and ["emoticons"] as number of votes for each emoticon. Reading data is through ReadData.dataFacebook("datafilename"). To transform to label ranking data, using ReadData.label2rank(). Detail can be found in TrainTest.py. There are four data sets, as following:

    1. Random_Normal_User (ROU): Posts crawled from public posts of random normal users;
    2. nytimes (NYT): Posts crawled from New York Times Facebook Page;
    3. wapo (WaPo): Posts crawled from The Washington Post Facebook Page;
    4. wsj (WSJ): Posts crawled from The Wall Street Journal Facebook Page.
  2. Semi-synthetic data: Obtained by converting benchmark multi-class classification using Naive Bayes and regression data using feature-to-label technique from the UCI and Statlog repositories into label ranking~\cite{cheng2009decision}. These data sets are widely used as benchmark in label ranking works. As the original link in \cite{cheng2009decision} failed, we obtained the data sets from https://github.com/toppu/PLRank.

Tail abstention: For tail abstention problem, where ranking may be incomplete with some labels missing, according to the scenario in Facebook post data, they are considered abstention at tail position.

Algorithms:

The original works codes refer to are cited at the beginning of each file. The usage is summarized in TrainTest.py (not for running). Several modifications compared with original works are as follows:

  1. RPC: For tail abstention situation, when Abstention parameter is set to True, then all pairwise comparison is replicated k times, while pair of labels included in abstention contribute to 1 count in both orders. It is equivalent to count abstention as 1/k times for each order. This is to make sure pairs of labels mainly appearing in tail abstention got smooth training.

  2. SMP: The initialization is set differently from the original work. Here only distinct instances will be considered as prototypes, otherwise those same prototypes will keep the same as learning goes on, which makes no sense. As a result, the number of prototypes K should be set accordingly, as shown in TrainTest.py.

  3. DTPG: With alpha parameter set as None, use pruning with searching hyperparameters with cross-validation in training set is used, with criteria set as prune_criteria parameter; as any real number larger than zero, use pruning with hyperparameter set as given value; as zero, no pruning.

About

Label Ranking algorithms & data sets

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages