Wraps creation of iterator to an method.

This will allow me to inherit this class. And I also hope that it will
make it more clear.
Change dictionary iteration on sample_params

Just a small change on how to address the value of the dictionary.
It passed the test.
Moves creation of array to function

Instead of creating the arrays with the values to fit, they are now
created inside the `fit` function.
Wraps loop into a function

Then I used a dictionary comprehension to get the values.
Move the code to be iterated to a function

I created a function that contains the code that should be iterated.