Skip to content

Instantly share code, notes, and snippets.

@CVertex
Created March 10, 2016 22:52
Show Gist options
  • Select an option

  • Save CVertex/a0a3c02ec925f7d184ad to your computer and use it in GitHub Desktop.

Select an option

Save CVertex/a0a3c02ec925f7d184ad to your computer and use it in GitHub Desktop.
Prints the non-zero features in the console in BigML cluster console
var scores = [];
$('.kluster-fields').find('.numeric').each(function() {
var r = $(this);
var name = r.find('span:first').text().replace(":","");
var val = parseFloat(r.find('strong').text());
//console.log(name + ' ' + val);
var s = {name:name,score:val};
scores.push(s);
});
scores.sort(function(a,b) {
return b.score - a.score;
});
for (var s = 0; s<scores.length; s++) {
var score = scores[s];
if (score.score > 0.01) {
console.log(score.name + " : " + score.score);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment