Thrill  0.1
logistic_regression.cpp File Reference
#include <thrill/api/cache.hpp>
#include <thrill/api/dia.hpp>
#include <thrill/api/generate.hpp>
#include <thrill/api/print.hpp>
#include <thrill/api/read_lines.hpp>
#include <thrill/common/logger.hpp>
#include <thrill/common/string.hpp>
#include <tlx/cmdline_parser.hpp>
#include <array>
#include <random>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include "logistic_regression.hpp"
+ Include dependency graph for logistic_regression.cpp:

Go to the source code of this file.

Macros

#define LOGM   LOGC(debug && ctx.my_rank() == 0)
 

Typedefs

using DataObject = std::pair< bool, Element >
 
using Element = std::array< T, dim >
 
using T = double
 

Functions

static auto GenerateInput (api::Context &ctx, size_t size)
 
static auto GenerateTestData (api::Context &ctx, size_t size)
 
int main (int argc, char *argv[])
 
template<typename Input >
static auto ReadInputFile (api::Context &ctx, const Input &input_path)
 
template<typename InputDIA >
void TestLogit (api::Context &ctx, const std::string &test_file, const InputDIA &input_dia, const Element &weights)
 
template<typename InputDIA >
auto TrainLogit (api::Context &ctx, const InputDIA &input_dia, size_t max_iterations, double gamma, double epsilon)
 

Variables

constexpr size_t dim = 3
 

Macro Definition Documentation

◆ LOGM

#define LOGM   LOGC(debug && ctx.my_rank() == 0)

Definition at line 39 of file logistic_regression.cpp.

Referenced by TestLogit(), and TrainLogit().

Typedef Documentation

◆ DataObject

using DataObject = std::pair<bool, Element>

Definition at line 37 of file logistic_regression.cpp.

◆ Element

using Element = std::array<T, dim>

Definition at line 36 of file logistic_regression.cpp.

◆ T

using T = double

Definition at line 34 of file logistic_regression.cpp.

Function Documentation

◆ GenerateInput()

static auto GenerateInput ( api::Context ctx,
size_t  size 
)
static

Definition at line 66 of file logistic_regression.cpp.

References thrill::api::Generate().

Referenced by main().

◆ GenerateTestData()

static auto GenerateTestData ( api::Context ctx,
size_t  size 
)
static

Definition at line 89 of file logistic_regression.cpp.

References thrill::api::Generate().

Referenced by main().

◆ main()

◆ ReadInputFile()

static auto ReadInputFile ( api::Context ctx,
const Input &  input_path 
)
static

Definition at line 42 of file logistic_regression.cpp.

References die_unless, dim, thrill::api::ReadLines(), and gen_data::value.

Referenced by main().

◆ TestLogit()

void TestLogit ( api::Context ctx,
const std::string &  test_file,
const InputDIA &  input_dia,
const Element weights 
)

Definition at line 131 of file logistic_regression.cpp.

References LOGM.

Referenced by main().

◆ TrainLogit()

auto TrainLogit ( api::Context ctx,
const InputDIA &  input_dia,
size_t  max_iterations,
double  gamma,
double  epsilon 
)

Definition at line 111 of file logistic_regression.cpp.

References dim, and LOGM.

Referenced by main().

Variable Documentation

◆ dim