Exemple #1
0
void
Options::check()
{
    if (static_cast<size_t>(options.rows()) != simulations.size() or
        options.cols() == 0 or simulations.size() != departments.size() or
        simulations.size() != years.size() or
        simulations.size() != observed.size() or
        not(simulations.size() == places.size() or places.empty()) or
        simulations.size() != id_subdataset_reduced.size() or
        subdataset.size() != simulations.size())
        throw solver_error("Options are inconsistent");
}
Exemple #2
0
prediction_evaluator::prediction_evaluator(std::shared_ptr<Context> context,
                                           const Model &model,
                                           const Options &options)
    : m_context(context)
    , m_model(model)
    , m_options(options)
    , m_globalsimulated(options.observed.size(), 0)
    , simulated(options.options.rows())
    , observed(options.options.rows())
    , solver(context, model)
    , kappa_c(model.attributes[0].scale.size())
{
    if (not options.have_subdataset())
        throw solver_error(
            "options does not have enough data to build the training set");
}