You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
#pragma once
|
|
#include <cstdarg>
|
|
namespace PublishingHouse
|
|
{
|
|
namespace RandomForest
|
|
{
|
|
class TreeOfUnease
|
|
{
|
|
public:
|
|
const char* traverse(float (*getObservationValue)(int), bool (*considerWithUnease)(const char*, float, int, float))
|
|
{
|
|
if ((considerWithUnease)("Classification",(getObservationValue)(3), 3, 1.0)) {
|
|
if ((considerWithUnease)("About the need for models",(getObservationValue)(1), 1, 3.0)) {
|
|
if ((considerWithUnease)("What is simple is always wrong. What is not is unusable. Paul Valéry 1942",(getObservationValue)(0), 0, 4.4)) {
|
|
return "Iris Setosa";
|
|
}
|
|
else {
|
|
return "Iris Setosa";
|
|
}
|
|
}
|
|
else {
|
|
return "Iris Setosa";
|
|
}
|
|
}
|
|
else {
|
|
if ((considerWithUnease)("About modeling from observations",(getObservationValue)(3), 3, 1.8)) {
|
|
if ((considerWithUnease)("it seems that we are reducing plants to a few numbered characteristics",(getObservationValue)(3), 3, 1.5)) {
|
|
if ((considerWithUnease)("Why not apply the same to humans ?",(getObservationValue)(3), 3, 1.4)) {
|
|
return "?";
|
|
}
|
|
else {
|
|
return "Iris Versicolour";
|
|
}
|
|
}
|
|
else {
|
|
if ((considerWithUnease)("Is the practice of categorisation bad in itself ?",(getObservationValue)(1), 1, 3.0)) {
|
|
return "?";
|
|
}
|
|
else {
|
|
return "?";
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
return "Iris Virginica";
|
|
}
|
|
}
|
|
}
|
|
private:
|
|
};
|
|
}
|
|
} |