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

[New] show cluster map with new method Scenario.corr() #841

Open
lisphilar opened this issue Jun 20, 2021 · 9 comments
Open

[New] show cluster map with new method Scenario.corr() #841

lisphilar opened this issue Jun 20, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@lisphilar
Copy link
Owner

Summary of this new feature

To find useful indicators for ODE parameter prediction, seaborn.clstermap() will be helpful. This shows correlation coefficients and peeform clustering. Results will be shonone figure.

Ne method Scenario.corr() will show cluster map and return correlation coefficients as a dataframe.

@lisphilar lisphilar added the enhancement New feature or request label Jun 20, 2021
@lisphilar
Copy link
Owner Author

Users will specify delay period (lag). Indicator should be delayed.

@lisphilar
Copy link
Owner Author

For more option, seaborn.pairplot() is also useful t check whether values are imbalanced or not with histograms.

Also, sizes (tentative) argument will be added to select the size of groups (hue). We can investigate the difference of train/test data.

If this is implement in RegressionHandler, argument names may be different.

@lisphilar
Copy link
Owner Author

seaborn-analyzer package could be used.
https://github.com/c60evaporator/seaborn-analyzer

@lisphilar
Copy link
Owner Author

To detect non-linear correlation, minepy package can be used.
https://minepy.readthedocs.io/en/latest/

New method should detect non-linear correlation when user need to do (linear=False).

@lisphilar
Copy link
Owner Author

Memo for visualization (seaborn)
https://link.medium.com/lolY32qDDib

@lisphilar
Copy link
Owner Author

lisphilar commented Feb 13, 2022

Memo regarding coding.

X = snl.records(variables="all", show_figure=False)
X = X.drop(["Susceptible", "Confirmed", "Infected", "Recovered", "Fatal", "Date"], axis=1)
X = X.apply(lambda x: (x-x.mean())/ x.std(), axis=0).dropna(axis=1)
Y = snl.track()
Y = Y.loc[Y.Scenario == "Main", ["theta", "kappa", "rho", "sigma"]]
df = pd.concat([Y, X], axis=1)
df.corr().style.background_gradient(cmap="coolwarm")

@lisphilar
Copy link
Owner Author

lisphilar commented Feb 13, 2022

@lisphilar
Copy link
Owner Author

lisphilar commented Feb 19, 2022

Or we can do

import seaborn as sns
df = pd.concat([Y, X], axis=1)
df = df.corr()
mask = np.zeros_like(df)
mask[np.triu_indices_from(mask)] = True
sns.heatmap(df, mask=mask, square=True);

@lisphilar
Copy link
Owner Author

Cliuster map:

df = pd.concat([Y, X], axis=1)
df = df.corr()
sns.clustermap(df, square=True);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant