nonzeroexit commited on
Commit
0f341b0
·
verified ·
1 Parent(s): 6be178f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -11,16 +11,10 @@ scaler = MinMaxScaler()
11
  def extract_features(sequence):
12
  """Calculate AAC, Dipeptide Composition, and normalize features."""
13
  # Calculate Amino Acid Composition (AAC) and convert to array
14
- aac = np.array(list(AAComposition.CalculateAAC(sequence).values()))
15
-
16
- # Calculate Dipeptide Composition and convert to array
17
- dipeptide_comp = np.array(list(AAComposition.CalculateAADipeptideComposition(sequence).values()))
18
-
19
- # Combine both features (AAC and Dipeptide Composition)
20
- features = np.concatenate((aac, dipeptide_comp))
21
-
22
  # Normalize using the pre-trained scaler (Ensure the scaler is loaded correctly)
23
- normalized_features = scaler.transform([features]) # Don't use fit_transform(), only transform()
24
 
25
  return normalized_features
26
 
 
11
  def extract_features(sequence):
12
  """Calculate AAC, Dipeptide Composition, and normalize features."""
13
  # Calculate Amino Acid Composition (AAC) and convert to array
14
+ aac = np.array(list(AAComposition..CalculateAADipeptideComposition(sequence)))
15
+
 
 
 
 
 
 
16
  # Normalize using the pre-trained scaler (Ensure the scaler is loaded correctly)
17
+ normalized_features = scaler.transform([aac]) # Don't use fit_transform(), only transform()
18
 
19
  return normalized_features
20