cavalab / ellyn

python-wrapped version of ellen, a linear genetic programming system for symbolic regression and classification.
http://cavalab.org/ellyn
Other
54 stars 12 forks source link

Problem with random_state #18

Closed augmentedme closed 10 months ago

augmentedme commented 10 months ago

I really like your project and implementation. I wanted to use ellyn as a Classifier as below: learner = ellyn(classification=True, random_state=101, class_m4gp=True, prto_arch_on=True, selection='lexicase', fit_type='F1' # can be 'F1' or 'F1W' (weighted F1) )

However, everytime, I am getting different result, so I am getting different y_pred each time. Could you please clarify where am doing it wrong?

lacava commented 10 months ago

did you figure it out? could be because of parallelism. first thing I would try is running on a single thread.

augmentedme commented 10 months ago

Hi,

Many thanks for coming back to me.

I couldn't figured it out yet. I am running on CPU and didn't set multi-threading. Would love see the solution with single thread.

Could you please check in your free time and share the findings. You response would be highly appreciated.

Regards, Abdullah

On Tue, Nov 14, 2023, 03:05 William La Cava @.***> wrote:

did you figure it out? could be because of parallelism. first thing I would try is running on a single thread.

— Reply to this email directly, view it on GitHub https://github.com/cavalab/ellyn/issues/18#issuecomment-1808226761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZL7WRHXELIVXOKMRDJLN3YEISJNAVCNFSM6AAAAAA7EIL6MCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYGIZDMNZWGE . You are receiving this because you modified the open/close state.Message ID: @.***>

lacava commented 10 months ago

try passing islands=False. multithreading can make the results impossible to reproduce, even with fixed seeds.

augmentedme commented 10 months ago

Hi William,

Even after setting the islands=False flag, still getting the random results.

I also made sure I am running on single thread.

"import threading print(threading.active_count())"

This returns as 1.

Regards, Abdullah

On Tue, Nov 14, 2023, 03:44 William La Cava @.***> wrote:

try passing islands=False. multithreading can make the results impossible to reproduce, even with fixed seeds.

— Reply to this email directly, view it on GitHub https://github.com/cavalab/ellyn/issues/18#issuecomment-1808296998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZL7WXYH3ZO27NKYJBURFLYEIW3TAVCNFSM6AAAAAA7EIL6MCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYGI4TMOJZHA . You are receiving this because you modified the open/close state.Message ID: @.***>