Skip to content

python random seed fixed when running multiple times in the same script #32

@folivetti

Description

@folivetti

when running EGGP multiple times inside a Python script it will reuse the same random seed. Internally, eggp will ask the system seed which is unchanged while Python is running.

import pandas as pd
import eggp
df = pd.read_csv("dataset.csv")

cols_x = [c for c in df1.columns if c != "target"]

x = df[cols_x].values
y = df["target"].values

for i in range(30):
    np.random.seed(i)
    reg = eggp.EGGP() # internally it will always use the same seed
    reg.fit(x, y)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions