Comments (10)
Thank you for your bug report!
However, I failed in reporducing the error with Google Colab and the same codes.
https://gist.github.com/lisphilar/e25b5ac4d1ac9dcea0f383ead0a4957e
Does the following scpript return empty dataframe?
(If yes, error is in downloading. If no, error is in subsetting.)
import covsirphy as cs
cs.__version__
eng = cs.DataEngineer()
eng.download(country='USA', province='Illinois', databases=["japan", "covid19dh"]);
eng.clean()
eng.transform()
df = eng.all()
df.loc[df['City'] == 'Cook']
from covid19-sir.
Thanks you for replying promptly!
Yes it does return a dataframe. I think I found the issue with my code. I didn't set the layer for the dataengineer
import covsirphy as cs
cs.version
eng = cs.DataEngineer(['ISO3', 'Province', 'City'], complement=True)
eng.download(country='USA', province='Illinois', databases=["japan", "covid19dh", "owid"])
eng.clean()
eng.transform()
eng.layer(geo=("USA", "Illinois",))
actual_df, status, _ = eng.subset(geo=("USA", 'Illinois', 'Cook'), variables="SIRF", complement=True)
print(status)
actual_df.tail()
This gives a subset on city level. However the sample code doesn't add any layers. Therefore eng.subset is acting funny if you provide geo=('Japan', 'Tokyo', ) or any other combination of city and province.
from covid19-sir.
I may not have understood the point correctly, but cs.DataEngineer()
is the same as cs.DataEngineer(layers=None)
and cs.DataEngineer(layers=[“ISO3”, “Province”, “City”])
. Is this making you confused?
from covid19-sir.
I think I was able to solve the confusion.
I am trying to create a phase dependent model (SIRD) for a city in USA.
It seems that value of kappa is 0 for some phases.
I have tried different algo for segments and other arguments too. But still it is 0.
Can you suggest a work around.
Colab link below:
https://colab.research.google.com/drive/1dFKxUWd6L7ek_x1cognX49sChrE5142e#scrollTo=MD7lhKDtG6ZK
from covid19-sir.
Hi @karanjogi
I'm sorry for my very late reply.
I performed additional analysis and found that the number of fatal cases were not changed in the phases with kappa = 0.
https://gist.github.com/lisphilar/d717d73bcb1f5d3e80e79db9bbee4796
If the number of fatal cases is correct, kappa = 0 should be accepted. i.e. We need to fix the ZeroDivisionError
by returning NA when kappa = 0.
from covid19-sir.
Hi @lisphilar ,
Thank you for clearing what the problem is!
Can you please suggest a workaround this error? Or where the code change needs to be done?
I can give it a try and submit a PR if solved.
Thanks!
from covid19-sir.
Thank you for your contribution!
Regarding SIR-D model, the error is raised here. Could you add if statements in "try" block?
covid19-sir/covsirphy/dynamics/sird.py
Lines 138 to 158 in 5eb55ef
The other models (sir.py, sirf.py, sewirf.py) in the directory also have the same issues.
Additionally, please add tests (with pytest
) to https://github.com/lisphilar/covid19-sir/blob/5eb55efc36db79f302c951878d8bd45bf7e6e6dc/tests/test_dynamics/test_model.py so that we can avoid the similar issues.
I look forward to our discussion.
from covid19-sir.
And could you add a title to this issue?
from covid19-sir.
Sure!
I have made the changes in a new branch named develop and will be creating a PR for it.
Could you please review it and let me know if there are any changes needed?
from covid19-sir.
Thank you got your pull request!
As I commented on that, rho_i = 0 and sigma = 0 could be acceptable as well as kappa = 0.
from covid19-sir.
Related Issues (20)
- [Dev] use the latest version of deptry (version 0.8.0) HOT 2
- [Bug] DeprecationWarning with choroplethmap HOT 1
- [Docs] update the last year in citation, 2020-2022 to 2020-2023 HOT 4
- [Docs] fix URL of Monkey Pox data in "Data Preparation"
- [Bug] Wrong vaccination data HOT 5
- [New] (Japan vaccination data) include 4th and 5th
- [Bug] error/warning with 'date_parser' argument of `pandas.read_csv()` and Pandas version 2.0.0
- [New] DataEngineer().subset() convert categorical variable into dummy/indicator variables HOT 1
- [Dev] update version of cancel-workflow-action from 0.10.0 to 0.11.0 to fix warning in workflow
- [Docs] fix "ValueError: cannot insert City, already exists" when running notebook 01_data_preparation.ipynb
- [Data] ValueError when getting vaccination data in Japan
- [Dev] Update test code per deptry version 0.11.0 release
- [Bug] UserWarning when plotting: The figure layout has changed to tight HOT 2
- [Docs] fix URL expiration regarding pepy.tech
- [Docs] show data flow diagram of CovsirPhy on README
- [Bug] FutureWarning with the behavior of DataFrame concatenation with empty or all-NA entries
- [Bug] FutureWarning: Series.__getitem__ treating keys as positions is deprecated
- [Bug] FutureWarning: The default of observed=False is deprecated
- [Bug] FutureWarning: Setting an item of incompatible dtype is deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from covid19-sir.