<jupyter_start><jupyter_text>CTDC<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/output_csv_iFeature/CTDC_d.csv')
data.tail()
classModel(data)
accuracy_scores<jupyter_output><empty_output><jupyter_text>CTDT<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/output_csv_iFeature/CTDT_d.csv')
data.tail()
classModel(data)
accuracy_scores<jupyter_output><empty_output><jupyter_text>CTriad<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/output_csv_iFeature/CTriad_d.csv')
data.tail()
classModel(data)
accuracy_scores<jupyter_output><empty_output><jupyter_text>AAC<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/output_csv_iFeature/AAC_d.csv')
data.tail()
classModel(data)
accuracy_scores<jupyter_output><empty_output><jupyter_text>GAAC<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/output_csv_iFeature/GAAC_d.csv')
data.tail()
classModel(data)
accuracy_scores<jupyter_output><empty_output><jupyter_text>Combined Features<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/output_csv_iFeature/Combined_d.csv')
data.tail()
classModel(data)
accuracy_scores

import matplotlib.pyplot as plt
features= ['CTDC','CTDT','CTriad','AAC','GAAC', 'Combined']
accuracy_scores = np.array(accuracy_scores)
accuracy_scores=accuracy_scores*100<jupyter_output><empty_output><jupyter_text>PSSM<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/output_csv_iFeature/output_PSSM.csv')
data.tail()
data = data.drop(data.columns[[0]],axis = 1)
data.tail()
classes = pd.read_csv("/content/drive/MyDrive/Project/classes_d_len80_forpssm2.csv")
classes.tail()
data = pd.concat([data, classes], axis=1)
data.tail()
data.to_csv("/content/drive/MyDrive/Project/output_csv_iFeature/PSSM_d.csv",index=False)
classModel(data)<jupyter_output><empty_output><jupyter_text>PCA Pssm - ncomponent 10<jupyter_code>data = pd.read_csv("/content/drive/MyDrive/Project/output_csv_iFeature/output_pca_pssm_10.csv")
data.tail()
classModel(data)

data = pd.read_csv("/content/drive/MyDrive/Project/output_csv_iFeature/output_pca_pssm_3.csv")
data.tail()
classModel(data)<jupyter_output>/usr/local/lib/python3.7/dist-packages/xgboost/sklearn.py:1224: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].
  warnings.warn(label_encoder_deprecation_msg, UserWarning)<jupyter_text>AAC_PSSM<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/Features_PSSM/AAC_PSSM.csv')
data.tail()
data=data.drop(columns=['d1'],axis=1)
data.info()
classModel(data)<jupyter_output>[14:12:12] WARNING: ../src/learner.cc:1115: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'multi:softprob' was changed from 'merror' to 'mlogloss'. Explicitly set eval_metric if you'd like to restore the old behavior.<jupyter_text>GREY_PSSM<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/Features_PSSM/GREY_PSSM.csv')
data.tail()
classModel(data)<jupyter_output>/usr/local/lib/python3.7/dist-packages/xgboost/sklearn.py:1224: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].
  warnings.warn(label_encoder_deprecation_msg, UserWarning)<jupyter_text>AB_PSSM<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/Features_PSSM/AB_PSSM.csv')
data.tail()
classModel(data)<jupyter_output>/usr/local/lib/python3.7/dist-packages/xgboost/sklearn.py:1224: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].
  warnings.warn(label_encoder_deprecation_msg, UserWarning)<jupyter_text>DISCRETE_COSINE_PSSM<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/Features_PSSM/DISCRETE_COSINE_PSSM.csv')
data.tail()
classModel(data)<jupyter_output>/usr/local/lib/python3.7/dist-packages/xgboost/sklearn.py:1224: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].
  warnings.warn(label_encoder_deprecation_msg, UserWarning)<jupyter_text>PSSM400<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/Features_PSSM/PSSM400.csv')
data.tail()
classModel(data)<jupyter_output>/usr/local/lib/python3.7/dist-packages/xgboost/sklearn.py:1224: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].
  warnings.warn(label_encoder_deprecation_msg, UserWarning)<jupyter_text>RPSSM_PSSM<jupyter_code>data = pd.read_csv('/content/drive/MyDrive/Project/Features_PSSM/RPSSM_PSSM.csv')
data.tail()
classModel(data)
def classModel2(data):
  X= data.iloc[:,:-1].values
  y= data.iloc[:,-1].values
  
  le = LabelEncoder()
  print(y)
  y= le.fit_transform(y) 
  print(y)

  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.30, random_state = 5)

  model = XGBClassifier(objective='multi:softmax')
  print(model.objective)
  model.fit(X_train, y_train)
  y_pred = model.predict(X_test)

  print('\nClassification report:\n', classification_report(y_test,y_pred))
  print('Confusion matrix: \n', confusion_matrix(y_test,y_pred))

  accuracy = accuracy_score(y_test,y_pred)
  # accuracy_scores.append(accuracy)
  print("\n\nAccuracy:",accuracy_score(y_test, y_pred))

  print("\n\nPrecision:",precision_score(y_test, y_pred, average=None))
  print("\nRecall:",recall_score(y_test, y_pred, average=None))
  print("\nF1 score:",f1_score(y_test, y_pred, average=None))
data = pd.read_csv('/content/drive/MyDrive/Project/Features_PSSM/RPSSM_PSSM.csv')
data.tail()
classModel2(data)
!pwd
%cd /content/drive/MyDrive/Project/Features_PSSM
!pwd
files= ['AADP_PSSM.csv', 'DPC_PSSM.csv', 'DFMCA_PSSM.csv', 'LPC_PSSM.csv', 'MBMGAC_PSSM.csv']
def automation(filenames):
  size= len(filenames)
  for i in range(size):
    print()
    print()
    print("Feature Name: ", filenames[i])
    print()
    data = pd.read_csv(filenames[i])
    classModel2(data)
automation(files)
output_files= ['SOMA_PSSM.csv', 'SINGLE_AVERAGE_PSSM.csv', 'SVD_PSSM.csv']
automation(output_files)
files= ['AATP_TPCC.csv',
               'K_SEPERATED_BIGRAME.csv',
               'CS_PSE_PSSM.csv',
               'DWT_PSSM.csv',
               'EDP_MEDP.csv',
               'FPSSM.csv',
               'PSSMBLOCK.csv',
               'SCSH2.csv',
               'TRIGRAME_PSSM.csv'
               ]
automation(files)
df1= pd.read_csv('MBMGAC_PSSM.csv')
df1.tail()
df2= pd.read_csv( 'CS_PSE_PSSM.csv')
df2.tail()
df2=df2.drop(columns=['class'], axis=1)
df2.tail()
df3=pd.concat([df2,df1], axis=1)
df3.tail()
df3.to_csv('combined_CS_PSE_MBMGAC.csv', index=False)
automation(['combined_CS_PSE_MBMGAC.csv'])<jupyter_output>Feature Name:  combined_CS_PSE_MBMGAC.csv

['d' 'd' 'd' ... 'd' 'd' 'b']
[3 3 3 ... 3 3 1]
multi:softmax<jupyter_text>Using combined of some features which gave >=70<jupyter_code>automation(['combined_pssm.csv'])
!pip install -U xgboost
import pickle
data=pd.read_csv('combined_pssm.csv')
data.tail()<jupyter_output><empty_output><jupyter_text>using gpu on combined features<jupyter_code>X= data.iloc[:,:-1].values
y= data.iloc[:,-1].values
  
le = LabelEncoder()
print(y)
y= le.fit_transform(y) 
print(y)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.30, random_state = 5)

model = XGBClassifier(tree_method='gpu_hist',use_label_encoder=False)
model.fit(X_train, y_train)

y_pred = model.predict(X_test)

print('\nClassification report:\n', classification_report(y_test,y_pred))
print('Confusion matrix: \n', confusion_matrix(y_test,y_pred))

accuracy = accuracy_score(y_test,y_pred)
# accuracy_scores.append(accuracy)
print("\n\nAccuracy:",accuracy_score(y_test, y_pred))

print("\n\nPrecision:",precision_score(y_test, y_pred, average=None))
print("\nRecall:",recall_score(y_test, y_pred, average=None))
print("\nF1 score:",f1_score(y_test, y_pred, average=None))<jupyter_output>['d' 'd' 'd' ... 'd' 'd' 'b']
[3 3 3 ... 3 3 1]
[16:27:44] WARNING: ../src/learner.cc:1115: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'multi:softprob' was changed from 'merror' to 'mlogloss'. Explicitly set eval_metric if you'd like to restore the old behavior.

Classification report:
               precision    recall  f1-score   support

           0       0.90      0.89      0.89       772
           1       0.84      0.89      0.86       825
           2       0.92      0.91      0.91      1293
           3       0.79      0.76      0.77      1021

    accuracy                           0.86      3911
   macro avg       0.86      0.86      0.86      3911
weighted avg       0.86      0.86      0.86      3911

Confusion matrix: 
 [[ 686    9   20   57]
 [  13  732    7   73]
 [  15   22 1175   81]
 [  52  111   81  777]]


Accuracy: 0.8616722065967783


Precision: [0.89556136 0.8375286  0.91582229 0.78643725]

Recall: [0.88860104 0.88727273 0.90[...]<jupyter_text>some change  in parameter of model<jupyter_code>accuracy_scores=[]
%cd /content/drive/MyDrive/Project/Features_PSSM
def classModel3(data):
  X= data.iloc[:,:-1].values
  y= data.iloc[:,-1].values
  
  le = LabelEncoder()
  print(y)
  y= le.fit_transform(y) 
  print(y)

  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.30, random_state = 5)

  model = XGBClassifier(tree_method='gpu_hist',use_label_encoder=False)
  model.fit(X_train, y_train)
  y_pred = model.predict(X_test)

  print('\nClassification report:\n', classification_report(y_test,y_pred))
  print('Confusion matrix: \n', confusion_matrix(y_test,y_pred))

  accuracy = accuracy_score(y_test,y_pred)
  accuracy_scores.append(accuracy)
  print("\n\nAccuracy:",accuracy_score(y_test, y_pred))

  print("\n\nPrecision:",precision_score(y_test, y_pred, average=None))
  print("\nRecall:",recall_score(y_test, y_pred, average=None))
  print("\nF1 score:",f1_score(y_test, y_pred, average=None))
def automation(filenames):
  size= len(filenames)
  for i in range(size):
    print()
    print()
    print("Feature Name: ", filenames[i])
    print()
    data = pd.read_csv(filenames[i])
    classModel3(data)
files= ['AADP_PSSM.csv', 'DPC_PSSM.csv', 'DFMCA_PSSM.csv', 'LPC_PSSM.csv', 'MBMGAC_PSSM.csv',
        'SOMA_PSSM.csv', 'SINGLE_AVERAGE_PSSM.csv', 'SVD_PSSM.csv',
        'AATP_TPCC.csv',
               'K_SEPERATED_BIGRAME.csv',
               'CS_PSE_PSSM.csv',
               'DWT_PSSM.csv',
               'EDP_MEDP.csv',
               'FPSSM.csv',
               'PSSMBLOCK.csv',
               'SCSH2.csv',
               'TRIGRAME_PSSM.csv',
                'combined_CS_PSE_MBMGAC.csv',
        'combined_pssm.csv'
               ]
automation(files)
import matplotlib.pyplot as plt
plt.bar(files, accuracy_scores, color ='orange',width = 0.2)
plt.plot(files,accuracy_scores)
plt.scatter(files,accuracy_scores)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup