AI Assignment 2
AI Assignment 2
Assignment no # 2
Submitted by:
Class: BSE 5A
Submitted to: DR RAJA MUHAMMAD SULEMAN
Date: 02-06-2023
Problem:
In a future where intergalactic travel is a reality, a spacecraft named Stellaris embarks on a mission to
explore distant planets. However, due to a technical malfunction, the spacecraft loses power, leaving
the crew stranded. The crew faces numerous challenges as they strive to survive and find their way back
home. The spacecraft is equipped with advanced AI systems that have access to a vast amount of data,
including information about the crew members' skills, experience, and expertise. However, due to the
chaotic nature of the anomaly, vital records and documents have been lost, making it difficult to
determine the crew members' specialized roles and technical skills. This is where the classification task
becomes crucial. Your mission is to use the Decision Tree classifier algorithm on the spacecraft dataset
to predict the crew members' specialized roles based on various attributes.
Solution:
1. Problem Statement: Find the specialized roles of crew members based on various attributes e.g.,
age, gender.
2. Dataset Exploration: The dataset contained information about crew members, their age, gender,
technical skills, and the specialized roles that were assigned to them. We loaded the dataset into
Colab to analyze and understand the dataset. This involved displaying the first and last few rows,
summary of classes, and information about the dataset. We also tried to visualize most of the
information.
3. Data Preprocessing: The we performed data preprocessing and feature engineering. This included
handling missing values by dropping rows with missing values.
4. Splitting the Dataset: We split the dataset into features (X) and the target variable (y), where X
contains all the independent variables except 'specialized_role' and 'crew_member_id', and y
contains the 'specialized_role' column.
5. Model Training: We instantiated a DecisionTreeClassifier and fit it to the training data
6. Model Evaluation: We made predictions on the testing set using the trained model and calculated
various evaluation metrics such as accuracy, precision, recall, and F1-score. These metrics help
assess the performance of the model in predicting the specialized roles.
Colab Link:
https://colab.research.google.com/drive/1eust1C3CDfFEiqc7eQNOsE9X6OxdIz1J?usp=sharing