Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var promises = combs.map(function (comb) {
var cParams = _o.merge(params, {
c : comb[0],
gamma: comb[1],
epsilon: comb[2],
nu: comb[3],
degree: comb[4],
r: comb[5]
});
var cPromises = subsets.map(function(ss){
var clf = new BaseSVM();
return clf
.train(ss.train, cParams) // train with train set
.then(function(){ // predict values for each example of the test set
done += 1;
deferred.notify({ done: done, total: total });
return _a.map(ss.test, function(test){ return [clf.predictSync(test[0]), test[1]]; });
e.code = 400;
throw e
} else if( ( filters[fieldname] || []).indexOf( filtername ) == -1 ){
var e = new Error(filtername + " filter is not allowed on field " + fieldname );
e.code = 400;
throw e
}
// should be defined on resource instance
attr = fieldmap[ fieldname ] ? fieldmap[fieldname].options.attribute || fieldname : fieldname
fieldname = bits.unshift( attr ) && bits.join('.');
if( allowablepaths.indexOf( fieldname ) >=0 ){
remaining[fieldname] = remaining[fieldname] || {};
filter = isFunction( filtertype.value ) ? filtertype.value( value ) : typecast( value ) ;
remaining[ fieldname ] = isPrimitive( filter ) ? filter : merge( remaining[ fieldname ], filter );
}
}
return remaining;
};
TempDir.prototype.prepareGit = function(revisions) {
var that = this;
revisions = object.merge(revisions || {}, this.defaults);
rimraf.sync(that.path);
mkdirp.sync(that.path);
this.git('init');
this.glob('./!(.git)').map(function(removePath) {
var fullPath = path.join(that.path, removePath);
rimraf.sync(fullPath);
});
object.forOwn(
revisions,
function(files, tag) {
TempDir.prototype.create = function(files, defaults) {
var that = this;
defaults = defaults || this.defaults || {};
files = object.merge(files || {}, defaults);
this.meta = function(tag) {
if (tag) {
return files[tag]['bower.json'];
} else {
return files['bower.json'];
}
};
if (files) {
object.forOwn(files, function(contents, filepath) {
if (typeof contents === 'object') {
contents = JSON.stringify(contents, null, ' ') + '\n';
}
var fullPath = path.join(that.path, filepath);
commandStubs['./' + command] = function() {
var args = [].slice.call(arguments);
args[rawCommand.length - 1] = object.merge(
{ cwd: cwd },
args[rawCommand.length - 1] || {}
);
return rawCommand.apply(null, args);
};
.done(function (model) {
deferred.notify(1);
model.params = _o.merge(self._config, model.params);
_o.mixIn(report, {
reduce: self._config.reduce,
retainedVariance : self._retainedVariance,
retainedDimension : self._retainedDimension,
initialDimension: self._initialDimension
});
deferred.resolve([model, report]);
});
})
function defaultConfig(config) {
config = config || {};
var cachedConfig = readCachedConfig(config.cwd || process.cwd());
return checkConfig(_o.merge(cachedConfig, config));
}
file.forEach(function(filename) {
if (fs.statSync(filename).isDirectory()) {
var error;
error = new Error(filename + ' should not be a directory');
error.code = 'EFILEISDIR';
throw error;
}
var json = fs.readFileSync(filename).toString();
json = parse(json, filename);
content = object.merge(content, json);
});
PluginResolver.prototype.getEndpoint = function() {
return object.merge(this._decEndpoint, {
name: this.getName(),
source: this.getSource(),
target: this.getTarget()
});
};