import pandas as pd
import numpy as np
from sklearn.linear_model import LogisticRegression
import pickle

def data_split(data, ratio):
    np.random.seed(42)
    shuffled = np.random.permutation(len(data))
    test_set_size = int(len(data)* ratio)
    test_indices = shuffled[:test_set_size]
    train_indices = shuffled[test_set_size:]
    return data.iloc[train_indices], data.iloc[test_indices]




if __name__ == "__main__":
    data=pd.read_csv(r"C:\Users\hp\Desktop\Cvoid-19\Pdata.csv")
    train, test = data_split(data, 0.2)
    X_train = train[['Fever','BodyPain','Age','RunnyNose','Dry Cough','Difficulty In breathing']].to_numpy()
    X_test = test[['Fever','BodyPain','Age','RunnyNose','Dry Cough','Difficulty In breathing']].to_numpy()

    Y_train = train[['Probability of Covoid19']].to_numpy().reshape(2008,)
    Y_test = test[['Probability of Covoid19']].to_numpy().reshape(501,)


    clf = LogisticRegression()
    clf.fit(X_train, Y_train)

    # open a file, where you ant to store the data
    file = open('model.pkl', 'wb')
    # dump information to that file
    pickle.dump(clf, file)
    

    inputFeatures = [102, 1, 35, 1, 1, 1]
    infProb = clf.predict_proba([inputFeatures])[0][1]
c07f0b832972380966a44d7d7ce870e8d68fb157
<mask token>

<mask token>


def data_split(data, ratio):
    np.random.seed(42)
    shuffled = np.random.permutation(len(data))
    test_set_size = int(len(data) * ratio)
    test_indices = shuffled[:test_set_size]
    train_indices = shuffled[test_set_size:]
    return data.iloc[train_indices], data.iloc[test_indices]


<mask token>

<mask token>


def data_split(data, ratio):
    np.random.seed(42)
    shuffled = np.random.permutation(len(data))
    test_set_size = int(len(data) * ratio)
    test_indices = shuffled[:test_set_size]
    train_indices = shuffled[test_set_size:]
    return data.iloc[train_indices], data.iloc[test_indices]


if __name__ == '__main__':
    data = pd.read_csv('C:\\Users\\hp\\Desktop\\Cvoid-19\\Pdata.csv')
    train, test = data_split(data, 0.2)
    X_train = train[['Fever', 'BodyPain', 'Age', 'RunnyNose', 'Dry Cough',
        'Difficulty In breathing']].to_numpy()
    X_test = test[['Fever', 'BodyPain', 'Age', 'RunnyNose', 'Dry Cough',
        'Difficulty In breathing']].to_numpy()
    Y_train = train[['Probability of Covoid19']].to_numpy().reshape(2008)
    Y_test = test[['Probability of Covoid19']].to_numpy().reshape(501)
    clf = LogisticRegression()
    clf.fit(X_train, Y_train)
    file = open('model.pkl', 'wb')
    pickle.dump(clf, file)
    inputFeatures = [102, 1, 35, 1, 1, 1]
    infProb = clf.predict_proba([inputFeatures])[0][1]

import pandas as pd
import numpy as np
from sklearn.linear_model import LogisticRegression
import pickle


def data_split(data, ratio):
    np.random.seed(42)
    shuffled = np.random.permutation(len(data))
    test_set_size = int(len(data) * ratio)
    test_indices = shuffled[:test_set_size]
    train_indices = shuffled[test_set_size:]
    return data.iloc[train_indices], data.iloc[test_indices]


if __name__ == '__main__':
    data = pd.read_csv('C:\\Users\\hp\\Desktop\\Cvoid-19\\Pdata.csv')
    train, test = data_split(data, 0.2)
    X_train = train[['Fever', 'BodyPain', 'Age', 'RunnyNose', 'Dry Cough',
        'Difficulty In breathing']].to_numpy()
    X_test = test[['Fever', 'BodyPain', 'Age', 'RunnyNose', 'Dry Cough',
        'Difficulty In breathing']].to_numpy()
    Y_train = train[['Probability of Covoid19']].to_numpy().reshape(2008)
    Y_test = test[['Probability of Covoid19']].to_numpy().reshape(501)
    clf = LogisticRegression()
    clf.fit(X_train, Y_train)
    file = open('model.pkl', 'wb')
    pickle.dump(clf, file)
    inputFeatures = [102, 1, 35, 1, 1, 1]
    infProb = clf.predict_proba([inputFeatures])[0][1]

import pandas as pd
import numpy as np
from sklearn.linear_model import LogisticRegression
import pickle

def data_split(data, ratio):
    np.random.seed(42)
    shuffled = np.random.permutation(len(data))
    test_set_size = int(len(data)* ratio)
    test_indices = shuffled[:test_set_size]
    train_indices = shuffled[test_set_size:]
    return data.iloc[train_indices], data.iloc[test_indices]




if __name__ == "__main__":
    data=pd.read_csv(r"C:\Users\hp\Desktop\Cvoid-19\Pdata.csv")
    train, test = data_split(data, 0.2)
    X_train = train[['Fever','BodyPain','Age','RunnyNose','Dry Cough','Difficulty In breathing']].to_numpy()
    X_test = test[['Fever','BodyPain','Age','RunnyNose','Dry Cough','Difficulty In breathing']].to_numpy()

    Y_train = train[['Probability of Covoid19']].to_numpy().reshape(2008,)
    Y_test = test[['Probability of Covoid19']].to_numpy().reshape(501,)


    clf = LogisticRegression()
    clf.fit(X_train, Y_train)

    # open a file, where you ant to store the data
    file = open('model.pkl', 'wb')
    # dump information to that file
    pickle.dump(clf, file)
    

    inputFeatures = [102, 1, 35, 1, 1, 1]
    infProb = clf.predict_proba([inputFeatures])[0][1]