LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
chooseMethod.m
1function solver = chooseMethod(model)
2% This function takes as input a QN model defined in LINE and returns
3% a Solver object with the predicted method loaded
4
5 dataVector = extractFeatures(model);
6 % Add derived features
7 dataVector = [dataVector dataVector(:, 1:3) ./ sum(dataVector(:, 1:3), 2)]; % Percent FCFS, PS, Delay
8 dataVector = [dataVector logical(dataVector(:, 4))]; % Has CS or not
9 dataVector = [dataVector dataVector(:, 5) ./ sum(dataVector(:, 1:2), 2)]; % Avg svrs per Queue
10 dataVector = [dataVector dataVector(:, 7) ./ dataVector(:, 6)]; % Num jobs per chain
11 dataVector = [dataVector dataVector(:, 8:10) ./ sum(dataVector(:, 8:10), 2)]; % Percent distributions
12
13 load('classifier.mat', 'classifier', 'methodNames', 'selected');
14 if isa(classifier, 'cell')
15 chosenMethod = predictEnsemble(classifier, dataVector(selected));
16 else
17 chosenMethod = predict(classifier, dataVector(selected));
18 end
19
20 solver = LINE.load(methodNames(chosenMethod), model);
21end