Interactive Analytics Library

An interaction based data modeling JavaScript library

View the Project on GitHubgtvalab/Interactive-Analytics-Library

Interaction Weight Vectors

IAL's core is based on the interaction weight concept. User interest is modeled and approxmited in IAL, using two weight vectors.

  1. An attribute weight vector
  2. An item weight vector
Combining the two vectors, IAL generates an item score that signifies how important a data point is. On initialization, IAL generates default attribute weight and item weights as identity vectors, and also generates the corresponding item scores. These values are bound to the data directly in the DOM as an ial object.

ial: {
      "id": 0,
      "itemScore": 4.1389,
      "weight": 1
      }

Modifying Weight Vectors

The power to update and modify weight vectors based on interactions is given completely to the developer. We realize that each Visual Analytic toolkit has different goals, and the behavior of the weight vectors must be set according. For fine grained control of the weight vectors, we provide the following getter and setter methods.






Item Weight

Item weights can be directly accessed and added to any event handler. We provide the following methods to do so. To access the item weights, these methods require the item identifier. This identifier is attached to each data item on initialization.

Get Item Score

%parameters: data point object and current attribute weight vector

ial.usermodel.getItemScore(ial.id, attributeVector);   
exmaple 
output  

Increment Item Weight

%parameters: data point object, new weightiting,
        status of log event, and information of additional log

ial.usermodel.incrementItemWeight(ial.id, incrementBy);   
exmaple 
output  

Set Item Weight

%parameters: data point object, new weightiting,
        status of log event, and information of additional log

ial.usermodel.setItemWeight (d, newWeight, logEvent, additionalLogInfoMap)   
exmaple 
output  

Update Item Scores

Updates item scores for all data points.

ial.usermodel.updateItemScores () 
exmaple 
output  





Attribute Weight

Similarly, attribute weights can be directly accessed and added to any event handler. We provide the following methods to do so. To access the attribute weights, these methods require the attribute identifier. This identifier is defined by the dataset used; key names from the data's JSON object are used to uniquely identify each attribute.

Get Attribute Weight

%parameters: attribute

ial.usermodel.getAttributeWeight (attribute) 
exmaple 
output  

Increment Attribute Weight

%parameters: attribute, new weightiting,
        status of log event, and information of additional log

ial.usermodel.incrementAttributeWeight (attribute, increment, logEvent, additionalLogInfoMap)
exmaple 
output  

Set Attribute Weight

%parameters: attribute, new weightiting,
        status of log event, and information of additional log

ial.usermodel.setAttributeWeight (attribute, newWeight, logEvent, additionalLogInfoMap)  
exmaple 
output  

Get Top n Points by Interaction Weights

Returns top n points based on interaction weight.

%parameters: number of point, status of log event,
                        and information of additional log

ial.usermodel.getTopNPointsByInteractionWeights (N, logEvent, additionalLogInfoMap) 
exmaple 
output  

Get Top n Points by Scores

Returns top n points based on attributes and attribute weights.

%parameters: number of point, status of log event,
                        and information of additional log

ial.usermodel.getTopNPointsByScores (N, logEvent, additionalLogInfoMap) 
exmaple 
output  

Get n Similar Points

Returns an array of the n most similar points to the given data point.

%parameters: given data point, number of expected similar data points, status of log event,
                        and information of additional log

ial.usermodel.getNSimilarPoints (dataPoint, n, logEvent, additionalLogInfoMap) 
exmaple 
output  

Generate Attribute Weight Vector using Similarity

Finding similar or dissimilar points is a very commonly required task in visual analytics. IAL provides easy access to updating attributes, based on how similar or dissimilar points. This method allows developers to modify the attribute weight vector directly, based on the similarity of a set of points. The method does not return any values, as it directly modifies the attribure weight vector. By default, the method operates on all points in the data set. This behavior can be modified by optionally passing an array of data objects that you want the method to work on.


ial.usermodel.generateAttributeWeightVectorUsingSimilarity([points]); 
exmaple 
output  

Generate Attribute Weight Vector using Differences

The other side of the same coin, is generating attribute weights based on how dissimilar a set of points are. IAL allows you to pass an array of points, and can generate the attribute weight vector based on the variance of each attribute.


ial.usermodel.generateAttributeWeightVectorUsingDifferences([points]); 
exmaple 
output  

IAL can also generate dissimilarity scores between two user-defined clusters of points. To do so, an additional array of points can be passed, and IAL can determine the attribute weight vector based on the difference between set 1 and set 2.

ial.usermodel.generateAttributeWeightVectorUsingDifferences([set1],[set2]);
exmaple 
output