log_reg function
Implementation
double log_reg(var row, var coffecients) {
var yhat = coffecients[0];
for (int i = 0; i < row.length - 1; i++) {
yhat += coffecients[i + 1] * row[i];
}
return 1.0 / (1.0 + exp(-yhat));
}
double log_reg(var row, var coffecients) {
var yhat = coffecients[0];
for (int i = 0; i < row.length - 1; i++) {
yhat += coffecients[i + 1] * row[i];
}
return 1.0 / (1.0 + exp(-yhat));
}