StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
754 B
27 lines
754 B
4 years ago
|
import interval from "./interval";
|
||
|
|
||
|
var year = interval(function(date) {
|
||
|
date.setMonth(0, 1);
|
||
|
date.setHours(0, 0, 0, 0);
|
||
|
}, function(date, step) {
|
||
|
date.setFullYear(date.getFullYear() + step);
|
||
|
}, function(start, end) {
|
||
|
return end.getFullYear() - start.getFullYear();
|
||
|
}, function(date) {
|
||
|
return date.getFullYear();
|
||
|
});
|
||
|
|
||
|
// An optimized implementation for this simple case.
|
||
|
year.every = function(k) {
|
||
|
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {
|
||
|
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
||
|
date.setMonth(0, 1);
|
||
|
date.setHours(0, 0, 0, 0);
|
||
|
}, function(date, step) {
|
||
|
date.setFullYear(date.getFullYear() + step * k);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
export default year;
|
||
|
export var years = year.range;
|