likely.js
function(row)
	{
		var rowIndex = row; // assume row is a number
		// If we're using labels we have to look up the row index
		if(this.rowLabels)
		{
			rowIndex = findInArray(this.rowLabels, row);
		}
		
		// estimates for this user
		var ratingElements = this.estimated.row(rowIndex+1).elements;
		
		// build a two dimensional array from the ratings and indexes
		//     [[index, rating], [index, rating]]
		var outputArray = new Array();
		for(var i=0; i<ratingElements.length; i++)
		{
			outputArray[i] = [i, ratingElements[i]];
			
			// if we have column labels, use those
			if(this.colLabels)
			{
				outputArray[i][0] = this.colLabels[i];
			}
		}
		
		// Sort the array by index
		return outputArray.sort(function(a, b) {return a[1] < b[1]})
	}
function(row)
	{
		var rowIndex = row; // assume row is a number
		// If we're using labels we have to look up the row index
		if(this.rowLabels)
		{
			rowIndex = findInArray(this.rowLabels, row);
		}
		
		// estimates for this user
		var ratingElements = this.estimated.row(rowIndex+1).elements;
		
		// build a two dimensional array from the ratings and indexes
		//     [[index, rating], [index, rating]]
		var outputArray = new Array();
		for(var i=0; i<ratingElements.length; i++)
		{
			outputArray[i] = [i, ratingElements[i]];
			
			// if we have column labels, use those
			if(this.colLabels)
			{
				outputArray[i][0] = this.colLabels[i];
			}
		}
		
		// Sort the array by index
		return outputArray.sort(function(a, b) {return a[1] < b[1]})
	}
function ( row ) { var rowIndex = row ; // assume row is a number // If we're using labels we have to look up the row index if ( this . rowLabels ) { rowIndex = findInArray ( this . rowLabels , row ) ; } // estimates for this user var ratingElements = this . estimated . row ( rowIndex + 1 ) . elements ; // build a two dimensional array from the ratings and indexes //     [[index, rating], [index, rating]] var outputArray = new Array ( ) ; for ( var i = 0 ; i < ratingElements . length ; i ++ ) { outputArray [ i ] = [ i , ratingElements [ i ] ] ; // if we have column labels, use those if ( this . colLabels ) { outputArray [ i ] [ 0 ] = this . colLabels [ i ] ; } } // Sort the array by index return outputArray . sort ( function ( a , b ) { return a [ 1 ] < b [ 1 ] } ) }
Returns all items for a given row, sorted by rating.
@param row The row to return values for
@returns Array An array of arrays, each containing two entries. [0] is the index and [1] is the value, sorted by value.
Returns all items for a given row sorted by rating .