<jupyter_start><jupyter_text>COVID-19 Data Analysis<jupyter_code>import os
os.chdir("../")
import sys
sys.path.insert(0, ".")
from utils import *
from utils.paths import *
import utils.paths as p
from utils.plot import *
from utils.logistic_curve import *<jupyter_output><empty_output><jupyter_text>Baseline Model: Logistic Regression<jupyter_code>create_paths("DateWorld")
country = "US"
X_FIELD = "tagged_day"
Y_FIELD = "confirmed"
# test_size, percentage of test size
# diff, train_error - test_error
# train_error
# test_error
# a, b,c parameters of logistic curve

# parameters: (country, picture_output_path, X_FIELD, Y_FIELD)
test_size,diff,sol,train_error,test_error,a,b,c = plot_logistic(country, p.LR, X_FIELD, Y_FIELD)
create_paths("DateWorld")
country = "US"
X_FIELD = "tagged_day"
Y_FIELD = "deaths"
test_size,diff,sol,train_error,test_error,a,b,c = plot_logistic(country, p.LR, X_FIELD, Y_FIELD)
create_paths("DateUS")
state = "California"
X_FIELD = "tagged_day"
Y_FIELD = "confirmed"
test_size,diff,sol,train_error,test_error,a,b,c = plot_logistic(state, p.LR, X_FIELD, Y_FIELD)
create_paths("DateUS")
state = "California"
X_FIELD = "tagged_day"
Y_FIELD = "deaths"
test_size,diff,sol,train_error,test_error,a,b,c = plot_logistic(state, p.LR, X_FIELD, Y_FIELD)
create_paths("DateUS")
state = "New York"
X_FIELD = "tagged_day"
Y_FIELD = "confirmed"
test_size,diff,sol,train_error,test_error,a,b,c = plot_logistic(state, p.LR, X_FIELD, Y_FIELD)<jupyter_output>./utils/logistic_curve.py:20: RuntimeWarning: overflow encountered in exp
  return c/(1 + np.exp(-(x-b)/a))
/Users/zhousicheng/Projects/anaconda3/lib/python3.7/site-packages/scipy/optimize/minpack.py:808: OptimizeWarning: Covariance of the parameters could not be estimated
  category=OptimizeWarning)
{'fraction_non_alphanumeric': 0.13028764805414553, 'fraction_numerical': 0.00676818950930626, 'mean_word_length': 7.6536585365853655, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '603969', 'license': 'Unlicense', 'n_tokens_mistral': 695, 'n_tokens_neox': 671, 'n_words': 128, 'path': 'Notebooks/LogisticModel.ipynb', 'repo_name': 'secregister01/2020-04-13_COVID19-N20', 'size': '1773'}