Skip to content

SumitJ3na/Water-Quality-Prediction-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Water-Quality-Prediction-Project

The model aims to predict the potability of water samples based on various water quality features.

The water quality classification model begins by loading the dataset, 'water_quality_potability.csv', into a pandas DataFrame called 'water_df'. Exploratory data analysis is performed to understand the dataset. Information about the dataset, such as the number of entries and the data types of each column, is displayed using the 'df.info()' function. The first few rows of the dataset are shown using the 'df.head()' function to provide a glimpse of the data. Additionally, a countplot is generated to visualize the distribution of the target variable, 'Potability', which represents whether water samples are suitable for consumption.

The SVM classifier is then trained on the scaled training data using the 'SVC' class from scikit-learn. The accuracy of the SVM classifier is evaluated on the test set using the 'svm_model.score()' function, which calculates the proportion of correctly classified samples. Additionally, cross-validation is performed on the training set using the 'cross_val_predict()' function to generate predicted values for each sample. The confusion matrix is computed using the 'confusion_matrix()' function to provide insights into the performance of the model, including true positive, true negative, false positive, and false negative predictions.

Overall, the water quality classification model leverages data preprocessing, exploratory data analysis, and an SVM classifier to predict the potability of water samples based on various water quality features. By evaluating accuracy and examining the confusion matrix, the model's performance can be assessed in terms of its ability to classify water samples accurately.

About

The model aims to predict the potability of water samples based on various water quality features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors