Skip to content

Commit

Permalink
fixing the measures quality score
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadassaf committed Feb 10, 2015
1 parent 2b65e25 commit a0a6a28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions parsers/CKAN/profiler/profilers/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,12 @@ function profile(parent) {
var measureAverage = size ? ((measureTotal / _.size(qualityMeasure)) / size) : (measureTotal / _.size(qualityMeasure));
totalQuality += measureAverage;

util.colorify(["yellow","red"], [measureTitle + " quality Score: ",parseFloat( measureAverage * 100).toFixed(2)+ "%"]);
util.colorify(["yellow","red"], [measureTitle + " quality Score: ",parseFloat( 100 - (measureAverage * 100)).toFixed(2)+ "%"]);
}
});

// Print the total Quality score
util.colorify(["magenta","red"], ["\Average total quality Score: ",parseFloat((totalQuality / (_.size(this.qualityProfile) - excludeList.length)) * 100).toFixed(2)+ "%"]);
util.colorify(["magenta","red"], ["\Average total quality Score: ",parseFloat(100 - ((totalQuality / (_.size(this.qualityProfile) - excludeList.length)) * 100)).toFixed(2)+ "%"]);

// print the mini spearator for the statsitics section
profile.createTitleHead("cyan", "Quality Indicators Average Error %");
Expand Down
22 changes: 12 additions & 10 deletions parsers/CKAN/profiler/profilers/quality/qualityProfiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function qualityProfiler(parent) {

/* TO DO: Check the performance of parallel vs. Waterfall for the calculations
* There has been some miscalculation in the numbers between both, revise and measure performance gain
*/
this.async.parallel({
completeness : new completeness ( qualityProfiler, dataset).start.bind(null, profileTemplate),
provenance : new provenance ( qualityProfiler, dataset).start.bind(null, profileTemplate),
Expand All @@ -39,19 +40,20 @@ function qualityProfiler(parent) {
}, function (err) {
profilerCallback(false, profileTemplate, new profile(this));
});
*/

this.async.waterfall([

qualityProfiler.async.apply(new completeness(qualityProfiler, dataset).start, profileTemplate),
new provenance(qualityProfiler, dataset).start,
new freshness(qualityProfiler, dataset).start,
new comprehensibility(qualityProfiler, dataset).start,
new licensing(qualityProfiler, dataset).start
// this.async.waterfall([

// qualityProfiler.async.apply(new completeness(qualityProfiler, dataset).start, profileTemplate),
// new provenance(qualityProfiler, dataset).start,
// new freshness(qualityProfiler, dataset).start,
// new comprehensibility(qualityProfiler, dataset).start,
// new licensing(qualityProfiler, dataset).start

// ], function (err, profileTemplate) {
// profilerCallback(false, profileTemplate, new profile(this));
// });

], function (err, profileTemplate) {
profilerCallback(false, profileTemplate, new profile(this));
});
} else profilerCallback(false, profileTemplate, new profile(this));
}
};
Expand Down

0 comments on commit a0a6a28

Please sign in to comment.