Skip to content Skip to navigation

Bilinear Elastic Net (BEN)

Bilinear Elastic Net or BEN is a bilinear version of Elastic Net that has been proposed for performing text regression (see reference at the bottom). Bilinearity was introduced in order to jointly model words and users in an approach for predicting voting intentions. From this page, you may download an implementation of BEN for MATLAB. Note that this is a prototype beta version; for more up-to-date versions, please get in touch.

Download BEN v0.7 beta (December, 2013)

Prerequisites
>> SPAMS toolbox (for MATLAB) must be installed
>> v2struct function should be present in your path

Usage hints
Suppose that Var1 is a set of N n-grams, Var2 is a set of M users and that we consider T time instances. Then:
>> Var1's vector space representation (H) is a TxN matrix, where Hij is the frequency of n-gram j during time instance i
>> Var2 is an (MxT)xN matrix (U), where Uij is the frequency of n-gram j for user ceil(i,T) during time instance mod(i,T)

BEN is not limited to the scenario above; Var1 and Var2 can represent various other things. The input of function ben is a struct with a multitude of fields. All fields are explained inside the m-file of the function; you may also view them on the command window by typing "help ben". Following the notation above, H and U are represented by the struct fields var1_vsr and var2_vsr respectively. Two useful spots in the SPAMS documentation for understanding the parameter settings for mexFistaFlat function (the one we use to implement Elastic Net) are: spot_A & spot_B.

Functions or scripts included in the package
ben: The main function implementing BEN
formVar1Matrix: Updates the vector space representation of Var1 based on the weights of Var2
centerX: Function for centering
meanSerror: Computes the mean squared error (MSE)
demo: Mock example of usage

Reference
V. Lampos, D. Preoţiuc-Pietro and T. Cohn (2013). A user-centric model of voting intention from Social Media. ACL '13, pp. 993-1003.