<jupyter_start><jupyter_text>logml=sm.GLM(y_train,(sm.add_constant(x_train))),family=sm.families.Bionomial())<jupyter_code>logml=sm.GLM(y_train,(sm.add_constant(x_train)),family=sm.families.Binomial())

logml.fit().summary()
df.head()
df1_exp=df
plt.figure(figsize=(30,10))
sns.heatmap(df1_exp["Baseline Features"].corr(),annot=True)
round(df1_exp['Baseline Features'].corr(),3)
form_data=pd.read_csv("pd_speech_features2.csv")
form_data.drop(['id','gender'],axis=1)
form_data.drop(columns=['locAbsJitter','rapJitter','ddpJitter','ppq5Jitter','locShimmer','apq5Shimmer','meanNoiseToHarmHarmonicity','numPeriodsPulses','meanPeriodPulses','apq11Shimmer'],axis=1)
form_data.drop(columns=['GQ_std_cycle_closed','tqwt_medianValue_dec_5','tqwt_medianValue_dec_16','tqwt_medianValue_dec_16','tqwt_medianValue_dec_20',
                        'tqwt_medianValue_dec_24','tqwt_medianValue_dec_25','tqwt_meanValue_dec_5','tqwt_meanValue_dec_5'
                        ,'tqwt_meanValue_dec_30','tqwt_meanValue_dec_35','tqwt_meanValue_dec_23','tqwt_meanValue_dec_27',
                        'tqwt_meanValue_dec_31',
                        'tqwt_meanValue_dec_16','tqwt_meanValue_dec_11'])
plt.figure(figsize=(30,10))
sns.heatmap(df1_exp["Intensity Parameters"].corr(),annot=True)
def normalize_data(x):
    return((x-np.min(x))/max(x)-min(x))
form_data.apply(normalize_data)
data = form_data.to_numpy(dtype=np.float32)
features, labels = data[:, :-1], data[:, -1]
x_train,x_test,y_train,y_test=train_test_split(features,labels,test_size=0.3,random_state=0)
x_train.shape,y_train.shape
from sklearn.linear_model import LogisticRegression
clf=LogisticRegression(tol=0.1)#tolerence is 0.1
clf.fit(x_train,y_train) 
y_pred=clf.predict(x_test)
a=cross_val_score(clf,x_train,y_train,cv=2,scoring="accuracy")#cross_validation
a.mean()*100
print(classification_report(y_test,y_pred))
print(f"confusion_matrix:\n{confusion_matrix(y_test,y_pred)}")

logistic_fpr,logistic_tpr,threshold=roc_curve(y_test,y_pred)
auc_logistic=auc(logistic_fpr,logistic_tpr)
plt.figure(figsize=(5,5),dpi=100)
plt.plot(logistic_fpr,logistic_tpr,marker=".",label="Logistic(auc=%0.3f)"%auc_logistic)
plt.xlabel("False Positive Rate-->")
plt.ylabel("True Positive Rate-->")
plt.legend()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16345311130587203, 'fraction_numerical': 0.030236634531113058, 'mean_word_length': 9.472477064220184, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '557730', 'license': 'MIT', 'n_tokens_mistral': 981, 'n_tokens_neox': 914, 'n_words': 59, 'path': 'Notebooks/logistic_vif.ipynb', 'repo_name': 'CS-savvy/Transformer-for-Parkinsons-disease', 'size': '2282'}