Replace repetitive code and create variables in a for loop : <p>I have this chunk of code that predicts on a model and I feel that there is a way to write a for loop to shorten it. However, I am not too sure how to do so as I would have to create variables within the for loop. Would it be possible to shorten this code to a for loop:</p>

<pre><code>    #remainder1 through model

    _remainder1FV, _remainder1Out, _remainder1OutID = _detector.get_fv(_deFV, _deMeta['_remainID1'])
    _remainder1PredOut = _detector.classifer_prediction(_remainder1FV, _deMeta)
    _remainder1Result = _detector.result_calculation(_remainder1Out, _remainder1PredOut, _deMeta, tag='_remainID1')


    #remainder2 through model

    _remainder2FV, _remainder2Out, _remainder2OutID = _detector.get_fv(_deFV, _deMeta['_remainID2'])
    _remainder2PredOut = _detector.classifer_prediction(_remainder2FV, _deMeta)
    _remainder2Result = _detector.result_calculation(_remainder2Out, _remainder2PredOut, _deMeta, tag='_remainID2')


    #remainder3 through model

    _remainder3FV, _remainder3Out, _remainder3OutID = _detector.get_fv(_deFV, _deMeta['_remainID3'])
    _remainder3PredOut = _detector.classifer_prediction(_remainder3FV, _deMeta)
    _remainder3Result = _detector.result_calculation(_remainder3Out, _remainder3PredOut, _deMeta, tag='_remainID3')


    #remainder4 through model

    _remainder4FV, _remainder4Out, _remainder4OutID = _detector.get_fv(_deFV, _deMeta['_remainID4'])
    _remainder4PredOut = _detector.classifer_prediction(_remainder4FV, _deMeta)
    _remainder4Result = _detector.result_calculation(_remainder4Out, _remainder4PredOut, _deMeta, tag='_remainID4')
</code></pre>
