nonzeroexit commited on
Commit
2ef6d0c
·
verified ·
1 Parent(s): 13ecc1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -47,7 +47,7 @@ def extract_features(sequence):
47
  selected_feature_values = [all_features[feature] for feature in selected_features if feature in all_features]
48
 
49
  # Convert to NumPy array for normalization
50
- feature_array = np.array(selected_feature_values).reshape(-1,1)
51
  # Min-Max Normalization
52
  scaler = MinMaxScaler()
53
  normalized_features = scaler.fit_transform(feature_array).flatten()
@@ -59,7 +59,7 @@ def predict(sequence):
59
  """Predict AMP vs Non-AMP"""
60
  features = extract_features(sequence)
61
  prediction = model.predict(features)[0]
62
- return "AMP" if prediction == 1 else "Non-AMP"
63
 
64
  # Create Gradio interface
65
  iface = gr.Interface(
 
47
  selected_feature_values = [all_features[feature] for feature in selected_features if feature in all_features]
48
 
49
  # Convert to NumPy array for normalization
50
+ feature_array = np.array(selected_feature_values).reshape(1,-1)
51
  # Min-Max Normalization
52
  scaler = MinMaxScaler()
53
  normalized_features = scaler.fit_transform(feature_array).flatten()
 
59
  """Predict AMP vs Non-AMP"""
60
  features = extract_features(sequence)
61
  prediction = model.predict(features)[0]
62
+ return "AMP" if prediction == 0 else "Non-AMP"
63
 
64
  # Create Gradio interface
65
  iface = gr.Interface(