def _generic_fit(fqdn, result, scorer, yP=None, *argl, **argd):
out = None<EOL>if len(argl) > <NUM_LIT:0>:<EOL><INDENT>machine = argl[<NUM_LIT:0>]<EOL>out = {}<EOL>if hasattr(machine, "<STR_LIT>"):<EOL><INDENT>out["<STR_LIT>"] = machine.best_score_<EOL><DEDENT>yL = _do_auto_predict(*argl[<NUM_LIT:0>:<NUM_LIT:2>])<EOL>yscore = scorer(fqdn, yL, yP, *argl, **argd)<EOL>if yscore is not None:<EOL><INDENT>out.update(yscore)<EOL><DEDENT><DEDENT>return out<EOL>
Performs the generic fit tests that are common to both classifier and
    regressor; uses `scorer` to score the predicted values given by the machine
    when tested against its training set.

    Args:
    scorer (function): called on the result of `machine.predict(Xtrain,
      ytrain)`.