Skip to content

Commit

Permalink
Merge pull request #1 from Quid37/code_style
Browse files Browse the repository at this point in the history
Code style
  • Loading branch information
Quid37 authored Jan 23, 2019
2 parents fd8f9c4 + fd1bedd commit 6084fdd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#include <Common/FieldVisitors.h>


namespace DB {
namespace DB
{

namespace ErrorCodes
{
Expand Down Expand Up @@ -92,6 +93,7 @@ struct LinearRegressionData
readBinary(weights, buf);
readBinary(iter_num, buf);
}

Float64 predict(const std::vector<Float64>& predict_feature) const
{
Float64 res{0.0};
Expand Down Expand Up @@ -162,7 +164,8 @@ class AggregateFunctionMLMethod final : public IAggregateFunctionDataHelper<Data
auto &column = dynamic_cast<ColumnVector<Float64> &>(to);

std::vector<Float64> predict_features(arguments.size() - 1);
for (size_t i = 1; i < arguments.size(); ++i) {
for (size_t i = 1; i < arguments.size(); ++i)
{
const auto& element = (*block.getByPosition(arguments[i]).column)[row_num];
if (element.getType() != Field::Types::Float64)
throw Exception("Prediction arguments must be values of type Float",
Expand All @@ -189,4 +192,4 @@ class AggregateFunctionMLMethod final : public IAggregateFunctionDataHelper<Data

struct NameLinearRegression { static constexpr auto name = "LinearRegression"; };

}
}

0 comments on commit 6084fdd

Please sign in to comment.