function [hit_rate, false_alarm_rate, thresholds] = two_class_calc_roc(M, fm1, fm2)

%function [hit_rate, false_alarm_rate, thresholds] = two_class_calc_roc(M, fm1, fm2)
%
% TWO_CLASS_CALC_ROC -- Calculates hit and false alarm rates for a two-class
%                       classifier over a range of thresholds
%
% Input Parameters:
%   M    --  Classifier matrix as produces by train_classifier
%   fm1  --  Feature matrix with testing instances from the first class
%   fm2  --  Feature matrix with testing instances from the second class
%
% Output Parameters:
%   hit_rate         -- Vector of hit rates, one per threshold
%   false_alarm_rate -- Vector of false alarm rates, one per threshold
%   thresholds       -- thresholds used to calculate hit and FA rates
%

if size(M,1) > 2
    error('This function only accepts two-class classifiers.');
end

% These are the thresholds that we'll use... these numbers give us nice
%  ROC curves for our assignment.
thresholds = -5:.2:5;

i = 1;
for th = thresholds
    
    % First, we test the classifier 'M' on instances in 'fm1' with threshold 'th'  
    labels1 = ?
    
    % Then, we use the classification in 'labels1' to calculate the hit rate
    hit_rate(i) = ?
    
    
    % Now, we test the classifier 'M' on instances in 'fm2' with threshold 'th'  
    labels2 = ?

    % Finally, we use the classification in 'labels2' to calculate the false alarm rate
    false_alarm_rate(i) = ?
    
    i = i+1;
end
