This repository contains a machine learning model designed to predict molecular properties like molecular weight and polar surface area from chemical compound data.
1import torch
2import joblib
3import pandas as pd
4from model import DrugPredictionModel # Your PyTorch model class
5
6# Load scaler
7scaler = joblib.load("scaler.pkl")
8
9# Load model
10model = DrugPredictionModel(input_size=11, output_size=2)
11model.load_state_dict(torch.load("drug_prediction_model.pt"))
12model.eval()
13
14# Prepare new input
15new_data = pd.DataFrame({...}) # input feature values
16new_data_scaled = scaler.transform(new_data)
17
18# Convert to tensor and predict
19input_tensor = torch.tensor(new_data_scaled, dtype=torch.float32)
20pred = model(input_tensor).detach().numpy()