MeLOn
Loading...
Searching...
No Matches
svmParser.h
Go to the documentation of this file.
1/**********************************************************************************
2* Copyright (c) 2020 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3*
4* This program and the accompanying materials are made available under the
5* terms of the Eclipse Public License 2.0 which is available at
6* http://www.eclipse.org/legal/epl-2.0.
7*
8* SPDX-License-Identifier: EPL-2.0
9*
10* @file svmParser.h
11*
12* @brief File containing declaration of the support vector machine parser classes.
13*
14**********************************************************************************/
15
16#pragma once
17
18#include <string> // std::string
19#include <vector> // std::vector
20#include <memory> // std::unique_ptr, std::shared_ptr
21
22#include "modelParser.h"
23#include "svmData.h"
24#include "exceptions.h"
25#include "scaler.h"
26
27#include <nlohmann/json.hpp>
28using json = nlohmann::json;
29
30namespace melon {
31
36 class SvmParser : public ModelParser {
37 public:
38
48 std::shared_ptr<ModelData> parse_model(const std::string modelPath, const std::string modelName) override;
49
57 static KERNEL_FUNCTION string_to_kernel_function(const std::string& kernelName);
58
66 static std::shared_ptr<ScalerData> parse_scaler(json scalerJson);
67 };
68
69
75 public:
76
84 std::unique_ptr<ModelParser> create_model_parser(const MODEL_FILE_TYPE fileType) override;
85 };
86}
This class is a abstract parent class for model parser factories implemented in the MeLOn library.
Definition modelParser.h:108
This class is a abstract parent class for model parser implemented in the MeLOn library.
Definition modelParser.h:40
This class is a factory class for creating child instances of SvmParser.
Definition svmParser.h:74
std::unique_ptr< ModelParser > create_model_parser(const MODEL_FILE_TYPE fileType) override
Factory function for creating a instance of a support vector machine parser corresponding to the spec...
Definition svmParser.cpp:58
This class implements a support vector machine file parser.
Definition svmParser.h:36
std::shared_ptr< ModelData > parse_model(const std::string modelPath, const std::string modelName) override
Function for parsing the support vector machine data from a file.
Definition svmParser.cpp:114
static std::shared_ptr< ScalerData > parse_scaler(json scalerJson)
Function for parsing scaler data from json object.
Definition svmParser.cpp:72
static KERNEL_FUNCTION string_to_kernel_function(const std::string &kernelName)
Turns string with kernel name into enum representation.
Definition svmParser.cpp:102
nlohmann::json json
Definition gpParser.cpp:24
Definition kernel.h:21
MODEL_FILE_TYPE
Enum for representing the parsable filetypes.
Definition modelParser.h:30
KERNEL_FUNCTION
enum for representing different kernel functions
Definition svmData.h:31