Skip to content

Commit 697220f

Browse files
authored
Update GradientDescent.cpp
1 parent 1358fee commit 697220f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

GradientDescent.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ void log_transform(vector<double>& y) {
148148
transform(y.begin(), y.end(), y.begin(), [](const double& s){return log(s);});
149149
}
150150

151+
152+
int writeFile(const pair<double, double>& coefficient) {
153+
ofstream write_my_file;
154+
write_my_file.open("output.txt");
155+
write_my_file << coefficient.first << "\n";
156+
write_my_file << coefficient.second << "\n";
157+
write_my_file.close();
158+
return 0;
159+
}
160+
151161
int main(){
152162
CSVReader reader("Input.csv");
153163
const auto output = reader.getData();

0 commit comments

Comments
 (0)