An interaction based data modeling JavaScript library
View the Project on GitHubgtvalab/Interactive-Analytics-Library
IAL's core is based on the interaction weight concept. User interest is modeled and approxmited in IAL, using two weight vectors.
ial: {
"id": 0,
"itemScore": 4.1389,
"weight": 1
}
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 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.
%parameters: data point object and current attribute weight vector
ial.usermodel.getItemScore(ial.id, attributeVector);
exmaple
output
%parameters: data point object, new weightiting,
status of log event, and information of additional log
ial.usermodel.incrementItemWeight(ial.id, incrementBy);
exmaple
output
%parameters: data point object, new weightiting,
status of log event, and information of additional log
ial.usermodel.setItemWeight (d, newWeight, logEvent, additionalLogInfoMap)
exmaple
output
Updates item scores for all data points.
ial.usermodel.updateItemScores ()
exmaple
output
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.
%parameters: attribute
ial.usermodel.getAttributeWeight (attribute)
exmaple
output
%parameters: attribute, new weightiting,
status of log event, and information of additional log
ial.usermodel.incrementAttributeWeight (attribute, increment, logEvent, additionalLogInfoMap)
exmaple
output
%parameters: attribute, new weightiting,
status of log event, and information of additional log
ial.usermodel.setAttributeWeight (attribute, newWeight, logEvent, additionalLogInfoMap)
exmaple
output
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
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
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
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
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