0% found this document useful (0 votes)
3 views19 pages

Final Practical File 28p Structured

This practical file outlines the AI lifecycle for predicting growth and disease risk, including data preprocessing, model training using Random Forest, and evaluation metrics. It emphasizes the importance of feature selection, anomaly detection, and model interpretability while acknowledging limitations and ethical considerations. Future enhancements may involve deep learning and real-time predictions.

Uploaded by

rajghosh97351
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views19 pages

Final Practical File 28p Structured

This practical file outlines the AI lifecycle for predicting growth and disease risk, including data preprocessing, model training using Random Forest, and evaluation metrics. It emphasizes the importance of feature selection, anomaly detection, and model interpretability while acknowledging limitations and ethical considerations. Future enhancements may involve deep learning and real-time predictions.

Uploaded by

rajghosh97351
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ARTIFICIAL INTELLIGENCE PRACTICAL FILE

AI-Based Growth / Disease Risk Prediction

Student: Ratnadip Ghosh | Class XII Humanities | KV No.2 Kanchrapara


Project Introduction
This practical file documents the full AI lifecycle including preprocessing, model training, evaluation, anomaly
detection, and automated reporting.

Figure: Visualization generated to support model interpretation.


Setup & Imports
These libraries enable machine learning, evaluation, and visualization.

import pandas as pd
import numpy as np
import [Link] as plt
from sklearn.model_selection import train_test_split
from [Link] import RandomForestClassifier
from [Link] import LabelEncoder
from [Link] import accuracy_score, confusion_matrix, classification_report

Figure: Visualization generated to support model interpretation.


Load Dataset
The dataset is loaded and categorical columns are encoded for model compatibility.

df = pd.read_csv("merged_ai_dataset.csv")

le_id = LabelEncoder()
le_y = LabelEncoder()

df["ID_risk"] = le_id.fit_transform(df["ID_risk"])
df["Growth_Status_enc"] = le_y.fit_transform(df["Growth_Status"])

Figure: Visualization generated to support model interpretation.


Feature Selection
Relevant predictors are selected to improve training efficiency.

X = df[["Age_months","Height_z","Weight_z","BMI_z","ASD_score","ID_risk"]]
y = df["Growth_Status_enc"]

Figure: Visualization generated to support model interpretation.


Train-Test Split
Splitting ensures unbiased evaluation.

X_train, X_test, y_train, y_test = train_test_split(


X, y, test_size=0.2, random_state=42, stratify=y
)

Figure: Visualization generated to support model interpretation.


Model Training
Random Forest builds multiple trees and aggregates predictions.

model = RandomForestClassifier(n_estimators=300, random_state=42)


[Link](X_train, y_train)

Figure: Visualization generated to support model interpretation.


Prediction
The trained model predicts unseen data.

y_pred = [Link](X_test)

Figure: Visualization generated to support model interpretation.


Evaluation
Accuracy and confusion matrix validate performance.

acc = accuracy_score(y_test, y_pred)


cm = confusion_matrix(y_test, y_pred)
print("Accuracy:", acc)

Figure: Visualization generated to support model interpretation.


Anomaly Detection
Z-score rule identifies abnormal growth patterns.

df["Anomaly_Flag"] = ((df["Height_z"].abs() > 3) |


(df["Weight_z"].abs() > 3)).astype(int)

Figure: Visualization generated to support model interpretation.


Feature Importance
Explains which variables influence prediction.

importances = model.feature_importances_

Figure: Visualization generated to support model interpretation.


Automation
Images are saved automatically for documentation.

import os
[Link]("project_results_images", exist_ok=True)

Figure: Visualization generated to support model interpretation.


System Architecture
The system follows a structured supervised learning pipeline from data ingestion to automated reporting.

Figure: Visualization generated to support model interpretation.


Model Reliability
Reliability depends on training data quality, feature relevance, and validation strategy.

Figure: Visualization generated to support model interpretation.


Interpretability
Understanding model decisions is critical in AI projects to ensure transparency.

Figure: Visualization generated to support model interpretation.


Limitations
The model performance is dataset-dependent and may vary with new data.

Figure: Visualization generated to support model interpretation.


Ethical AI
This project is strictly academic and does not replace professional diagnosis.

Figure: Visualization generated to support model interpretation.


Future Scope
Future upgrades may include deep learning and real-time prediction systems.

Figure: Visualization generated to support model interpretation.


Learning Outcomes
This project strengthened knowledge of ML workflows, evaluation metrics, and documentation.

Figure: Visualization generated to support model interpretation.

You might also like