classdef ratio < featlearn.operator.internal.binaryNumeric
    properties

    end
    methods
        function [this,T] = ratio(T)
            % construct base class
            this = this@featlearn.operator.internal.binaryNumeric(T);
            this = setOutputVarNames(this,T,'%s./%s');
            % apply transfomation to data
            T = apply(this,T);
            % Remove features with NaNs (due to 0/0) 
            idx = any(isnan(T{:,:}),1);
            T(:,idx) = [];
            this = removeVars(this,idx);
        end
        
        function T = apply(this,T)
            T = applyVec(this,T,@rdivide);
        end
        
        function str = details(this)
           str = this.InputVarNames{1} + " ./ " + this.InputVarNames{2};
        end  
    end
        
end