-
Notifications
You must be signed in to change notification settings - Fork 0
/
Physicochemical Properties of Protein Tertiary Structure Data Set.py
148 lines (69 loc) · 2.14 KB
/
Physicochemical Properties of Protein Tertiary Structure Data Set.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/usr/bin/env python
# coding: utf-8
# In[44]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
import seaborn as sns
# In[45]:
np.set_printoptions(suppress=True)
pd.set_option('display.max_columns',8000)
pd.set_option('display.max_rows',7000)
# In[46]:
train=pd.read_csv('C:/Users/user/Desktop/IVY WORK BOOK/CASP.csv')
# In[47]:
train.head()
# In[48]:
train.isnull().sum()
# In[49]:
pd.plotting.scatter_matrix(train,figsize=(15,10))
# In[50]:
train.columns
# In[51]:
Predictors=['RMSD', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8']
Target=['F9']
X=train[Predictors].values
y=train[Target].values
# In[52]:
from sklearn.preprocessing import StandardScaler
PredictorScaler=StandardScaler()
TargetVarScaler=StandardScaler()
# In[53]:
X=PredictorScaler.fit_transform(X)
y=TargetVarScaler.fit_transform(y)
# In[54]:
X[:]
# In[55]:
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
# In[56]:
print(X_train.shape)
print(y_train.shape)
print(X_test.shape)
print(y_test.shape)
# In[58]:
from keras.models import Sequential
from keras.layers import Dense
# In[92]:
model = Sequential()
model.add(Dense(units=500, input_dim=9, kernel_initializer='normal', activation='relu'))
model.add(Dense(units=100, kernel_initializer='normal', activation='sigmoid'))
model.add(Dense(units=40, kernel_initializer='normal', activation='relu'))
model.add(Dense(units=1, kernel_initializer='normal', activation='relu'))
model.compile(loss='mean_squared_error', optimizer='adam')
# In[93]:
model.fit(X_train, y_train ,batch_size = 10, epochs = 10, verbose=1)
# In[94]:
Predictions=model.predict(X_test)
Predictions=TargetVarScaler.inverse_transform(Predictions)
y_test_orig=TargetVarScaler.inverse_transform(y_test)
Test_Data=PredictorScaler.inverse_transform(X_test)
TestingData=pd.DataFrame(data=Test_Data, columns=Predictors)
TestingData['Price']=y_test_orig
TestingData['PredictedPrice']=Predictions
TestingData.head()
# In[95]:
model.history.history.values()
# In[ ]: