tensorflow_decision_forests/keras/wrapper/wrapper.cc
// Converts a learner name into a python class name.
// e.g. RANDOM_FOREST -> RandomForestModel
Converts a learner name into a python class name.
Converts a learner name into a python class name .
std::string LearnerKeyToClassName(absl::string_view key) {
  std::string value(key);
  for (auto it = value.begin(); it != value.end(); ++it) {
    if (it == value.begin() || !absl::ascii_isalpha(*(it - 1))) {
      *it = absl::ascii_toupper(*it);
    } else {
      *it = absl::ascii_tolower(*it);
    }
  }
  return absl::StrCat(absl::StrReplaceAll(value, {{"_", ""}}), "Model");
}
std :: string LearnerKeyToClassName ( absl :: string_view key ) { std :: string value ( key ) ; for ( auto it = value . begin ( ) ; it != value . end ( ) ; ++ it ) { if ( it == value . begin ( ) || ! absl :: ascii_isalpha ( * ( it - 1 ) ) ) { * it = absl :: ascii_toupper ( * it ) ; } else { * it = absl :: ascii_tolower ( * it ) ; } } return absl :: StrCat ( absl :: StrReplaceAll ( value , { { " " , " " } } ) , " " ) ; }
Converts a learner name into a python class name.
Converts a learner name into a python class name .