Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Failures not filtered from data frame when calling fit_surrogate #181

Open
Deathn0t opened this issue Mar 17, 2023 · 1 comment
Open
Labels
bug Something isn't working properly, like a bad convergence

Comments

@Deathn0t
Copy link
Member

Describe the bug

Failures should be filtered otherwise the call fails. The same idea can be followed as done in fit_generative_model:

# check single or multiple objectives
        hp_cols = [k for k in df.columns if "p:" == k[:2]]
        if "objective" in df.columns:
            # filter failures
            if pd.api.types.is_string_dtype(df.objective):
                df = df[~df.objective.str.startswith("F")]
                df.objective = df.objective.astype(float)

            q_val = np.quantile(df.objective.values, q)
            req_df = df.loc[df["objective"] > q_val]
        else:
            # filter failures
            objcol = list(df.filter(regex=r"^objective_\d+$").columns)
            for col in objcol:
                if pd.api.types.is_string_dtype(df[col]):
                    df = df[~df[col].str.startswith("F")]
                    df[col] = df[col].astype(float)
@Deathn0t Deathn0t added the bug Something isn't working properly, like a bad convergence label Mar 17, 2023
@Deathn0t
Copy link
Member Author

Related to #191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly, like a bad convergence
Projects
None yet
Development

No branches or pull requests

1 participant