This is taken from Investopidia since they did an excellent job of describing Profit Factor
The profit factor is defined as the gross profit divided by the gross loss (including commissions) for the entire trading period. This performance metric relates the amount of profit per unit of risk, with values greater than one indicating a profitable system. As an example, the Ultra portfolio strategy performance report shows Gross Profit $1,314,735 and Gross Losses $843,940 so:
$1,314,735/$843,940 = 1.5578 or 1.56