-5

Consider the following code:

struct TrainingExample
{
    array<double, N> input;
    array<double, M> output;
};

struct Predictor
{
    Predictor(const vector<TrainingExample>& trainingSet);

    array<double, M> predict(const array<double, N>& input);
}

The class is used as follows:

  1. Model some easily measured characteristics of an entity type to an array of N input doubles.
  2. Model some harder to measure characteristics of an entity type to M output doubles.
  3. Sample the universe of entities, measuring both input and output.
  4. This data is then passed to the constructor of Predictor as trainingSet which then "studys" it.
  5. Measure input of a subject entity and pass it to the predict function
  6. Predict will return a guess at the output based on training examples.

My question is, assume this class had to be reused by many different problems/models without modifying the code for each specific problem - which of the machine learning algorithms would be best to implement such a general-purpose Predictor? (If there is no clear best one in your opinion, than what are some of the popular competing algorithms and how do you select between them?)

3
  • 2
    "without further specific information about the nature of the entities and model", this question is thoroughly impossible to answer.
    – Fred Foo
    Mar 10, 2012 at 20:45
  • I've reworded the question to make it clearer. I am interested in a general-purpose machine learning algorithm for the above "class of problems". Mar 10, 2012 at 21:08
  • in such formulation -- most of ML algorithms
    – om-nom-nom
    Mar 11, 2012 at 9:33

2 Answers 2

3

Well, without the general knowledge of the problem it is almost impossible to answer your question. You basically specified the process of machine learning: Take input, study it, and generate some parameters of the model and then predict results for validation set. it is the insight you provide based on the problem itself as to which algo to use.

Usually neural nets generate good results in many different domains (that would be gradient decent learning rule algo). In many cases bayesian models perform really well, case based reasoning is often used for discrete, recurring inputs etc. It is up to you to choose one based on the definition of your problem

0

If I understand what output array is (an array of predicted values) linear regression or any variation on it (like bayesian regression) would fit your approach. You should split your training samples in two distinct sets, a training set with which you actually train your predictor and a test set used to test the performance of your parameters. Having distinct predictor instances for each output value would also be a good move.

2
  • Linear regression works well for regression problems where there's a linear relation between inputs and outputs. The OP hasn't even specified whether they're doing regression or classification; in the latter case, different algorithms apply.
    – Fred Foo
    Mar 10, 2012 at 20:49
  • @larsmans even before the question editing, it was pretty clear it is not a classification problem; method predict() takes the input array (easily measurable parameters) and returns output array (costly measurable in the samples), which is continuous. He wants to predict a set of entities using the same training set, which is not a good idea in general for performance of the parameters and of the prediction, thus my suggestion to split the execution in multiple predictor instances.
    – guido
    Mar 10, 2012 at 22:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.