<jupyter_start><jupyter_text><jupyter_code>!pip install tpot
# pandas and numpy for data manipulation
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.preprocessing import Normalizer
from sklearn.preprocessing import Binarizer
from sklearn.decomposition import PCA

# Import the tpot regressor
from tpot import TPOTRegressor
import sklearn.model_selection as model_selection
from sklearn.model_selection import train_test_split
data=pd.read_csv("https://covid19.who.int/WHO-COVID-19-global-data.csv")
data.dtypes
data=data.replace(0, np.nan)
data = data.replace(r'<^\s+$0', np.nan, regex=True)
data.sample(5)
data.columns
tarehe=data.Date_reported = data.Date_reported.astype('int64')
#data=data.loc[:,['Date_reported','New_cases', 'Cumulative_cases','Cumulative_deaths','New_deaths']]
#data=data.loc['R6':'R10', 'C':'E']
data2=data.iloc[:,[4,6]]
data=data2


#data3=data.loc[(data!=0).any(1)]
data3=data.dropna() 
data=data3
type(data)
train, test = train_test_split(data, test_size=0.25, random_state=42, shuffle=True)

train.shape
test.shape
data.columns
X_train=train.iloc[:, 0:1] 
X_test=test.iloc[:, 0:1]
Y_train=train.iloc[:,-1] 
Y_test=test.iloc[:,-1]
X_train.sample(5)
# pandas and numpy for data manipulation
import pandas as pd
import numpy as np

# Import the tpot regressor
from tpot import TPOTRegressor
# Convert to numpy arrays
training_features = np.array(X_train)
testing_features = np.array(X_test)

# Sklearn wants the labels as one-dimensional vectors
training_targets = np.array(Y_train).reshape((-1,))
testing_targets = np.array(Y_test).reshape((-1,))
# Create a tpot object with a few parameters
tpot = TPOTRegressor(scoring = 'neg_mean_absolute_error', 
                    max_time_mins = 240, 
                    n_jobs = -1,
                    verbosity = 2,
                    cv = 5)
# Fit the tpot model on the training data
tpot.fit(training_features, training_targets)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12125824454591577, 'fraction_numerical': 0.020801623541349568, 'mean_word_length': 5.08641975308642, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '117992', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 731, 'n_tokens_neox': 680, 'n_words': 157, 'path': 'covid19Reg3Tpot4.ipynb', 'repo_name': 'dd0me/COVID-19', 'size': '1971'}