Build a basic Artificial Neural Network (ANN) for binary classification and deploy it using FastAPI. The task involves predicting whether a customer will file a claim based on several features such as age, annual income, health score, etc.
Predicting whether a customer will file a claim (is_claim = 1) or not (is_claim = 0). The dataset contains customer information, and your model will be trained to predict the likelihood of a claim based on these inputs.
Using Keras or PyTorch, build a simple ANN for binary classification:
- Input layer with the same number of nodes as the input features
- At least one hidden layer with ReLU activation
- Output layer with a sigmoid activation for binary classification
Train the model on the given dataset and evaluate its performance.
- Build a FastAPI app that receives the following JSON input:
{ "age": , "annual_income": , "health_score": , "number_of_dependents": , "is_smoker": } - The app returns the predicted probability of filing a claim (
is_claim = 1).
- Tested the model on a separate test set and validate its performance using appropriate metrics
- Making sure to evaluate the FastAPI app to ensure that predictions can be made via API requests.
- Python
- TensorFlow or Keras for building the ANN model
- FastAPI for serving the model via API
- Scikit-learn for scaling the input data
- Joblib to save/load the model and scaler