AMP-Classifier / app.py
nonzeroexit's picture
Upload 3 files
942bf87 verified
raw
history blame
561 Bytes
from fastapi import FastAPI
import joblib
import numpy as np
app = FastAPI()
# Load your trained model
model = joblib.load("SVM.joblib") # Ensure this file is in the correct directory
@app.get("/")
def home():
return {"message": "AMP Classifier API is running!"}
@app.post("/predict")
def predict(sequence: str):
# Convert sequence to features (modify if needed)
features = np.array([len(sequence)]) # Example: length of sequence
prediction = model.predict([features])
return {"sequence": sequence, "is_AMP": bool(prediction[0])}