Skip to content

Commit

Permalink
Embed estimator and algo types into jsonized state
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMigda committed Aug 23, 2020
1 parent 3863f2e commit bba0b7b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/src/tsetlini_state_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ std::string to_json_string(ClassifierStateClassic const & state)
{
json js;

js["estimator"] = "classifier";
js["algo"] = "classic";

js["ta_state"] = state.ta_state;
js["igen"] = state.igen;
js["fgen"] = state.fgen;
Expand Down Expand Up @@ -325,6 +328,9 @@ std::string to_json_string(RegressorStateClassic const & state)
{
json js;

js["estimator"] = "regressor";
js["algo"] = "classic";

js["ta_state"] = state.ta_state;
js["igen"] = state.igen;
js["fgen"] = state.fgen;
Expand Down Expand Up @@ -367,6 +373,9 @@ std::string to_json_string(RegressorStateBitwise const & state)
{
json js;

js["estimator"] = "regressor";
js["algo"] = "bitwise";

js["ta_state"] = state.ta_state;
js["igen"] = state.igen;
js["fgen"] = state.fgen;
Expand Down Expand Up @@ -409,6 +418,9 @@ std::string to_json_string(ClassifierStateBitwise const & state)
{
json js;

js["estimator"] = "classifier";
js["algo"] = "bitwise";

js["ta_state"] = state.ta_state;
js["igen"] = state.igen;
js["fgen"] = state.fgen;
Expand Down

0 comments on commit bba0b7b

Please sign in to comment.