Skip to content

adiiiii13/Rock-Mine-Prediction-Model-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sonar Rock vs. Mine Prediction

Overview

This project uses machine learning to predict whether an object detected by a sonar is a rock or a mine. It utilizes a Logistic Regression model trained on a dataset of sonar signals.

Dataset

The dataset used for this project contains sonar signals and their corresponding labels (Rock or Mine). It is in CSV format and can be found in the file sonar data.csv.

  • Features: 60 numerical features representing the energy within various frequency bands.
  • Target: A categorical label indicating whether the object is a 'R' (Rock) or 'M' (Mine).

Methodology

  1. Data Loading and Preprocessing: The dataset is loaded into a Pandas DataFrame and basic statistical analysis is performed.
  2. Feature Extraction: The dataset is split into features (X) and target (Y).
  3. Data Splitting: The data is split into training and testing sets using train_test_split with a test size of 10% and stratification to ensure balanced class distribution.
  4. Model Training: A Logistic Regression model is trained using the training data.
  5. Model Evaluation: The model's accuracy is evaluated on both the training and testing sets using accuracy_score.
  6. Prediction: A predictive system is created to classify new sonar inputs as Rock or Mine.

Usage

  1. Install Dependencies: Make sure you have the necessary libraries installed: pip install numpy pandas scikit-learn
  2. Run the Code: Execute the provided Python code in a Google Colab environment.
  3. Input Data: Modify the input_data variable with the sonar readings for the object you want to classify.
  4. View Prediction: The code will print the prediction (Rock or Mine) to the console.

Results

The model achieved an accuracy of approximately [insert accuracy scores here] on the training and testing sets, respectively.

Image

[Include an image of the project's workflow or a visualization of the data here. You can use an image hosting service like Imgur or upload it directly to your repository. Example: ![Sonar Prediction](sonar_prediction.png)]

Conclusion

This project demonstrates the application of machine learning for sonar target classification. The Logistic Regression model shows promising results, but further improvements can be explored with different algorithms or feature engineering techniques.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.

License

This project is licensed under the [insert license name here] License.

About

This project was an exciting dive into sonar signal classification, applying data preprocessing, model training, and evaluation techniques.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors