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

model overfitting #195

Open
tkisss opened this issue Apr 27, 2024 · 0 comments
Open

model overfitting #195

tkisss opened this issue Apr 27, 2024 · 0 comments

Comments

@tkisss
Copy link

tkisss commented Apr 27, 2024

Hi, I noticed that CellOracle utilizes regression models like BaggingRegressor to fit gene expression based on transcription factor expression without dividing the data into training and testing sets. Can I infer that in this scenario, the model is prone to overfitting? Does this strategy provide any benefits for gene expression regulation?

if scaling:
    data = gem_scaled[reg_all]
else:
    data = gem[reg_all]
label = gem[target_gene]

try: # For sklearn version 1.2 or later
    model = BaggingRegressor(estimator=Ridge(alpha=alpha,
                                                 solver=solver,
                                                 random_state=123),
                                n_estimators=bagging_number,
                                bootstrap=True,
                                max_features=0.8,
                                n_jobs=n_jobs,
                                verbose=False,
                                random_state=123)
 except: # For old version of sklearn
    model = BaggingRegressor(base_estimator=Ridge(alpha=alpha,
                                                  solver=solver,
                                                  random_state=123),
                                n_estimators=bagging_number,
                                bootstrap=True,
                                max_features=0.8,
                                n_jobs=n_jobs,
                                verbose=False,
                                random_state=123)
model.fit(data, label)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant