Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 8, 2022 04:45 am GMT

Interesting Machine Learning Projects : Rock Vs Mine Prediction

Suppose there is a war between countries and we have assigned submarines to check whether there is rock or a mine inside water.

Mines are explosives that explode when some object come in contact with it.

And there can be rocks as well in the ocean.

What to build ?
Submarines have to predict whether it is crossing a mine or a rock. So, we have to build a system to predict whether the object beneath the submarine is mine or rock.


How it can be done ?
Submarine uses a sonar that sends sound signal and reviews switch back of the signal. So, this signal is then processed to detect whether the object is mine or just a rock in the ocean.
These sound waves can travel for hundreds of miles under water, and can retain an intensity of 140 decibels as far as 300 miles from their source.


WorkFlow :

WorkFlow

Collect Sonar Data : Laboratory setup experiment can be done where sonar is used to send and receive signals. There is far difference between signals received from mines and rocks. Because mines will be made up of metal.
So, we collect this data which is nothing but the sonar data obtained from a rock and a metal cylinder.
And later, we use this sonar data and feed it to our machine learning model.
and our model will predict whether the object is made up of metal or it is just a rock.
This is the principle we are going to use in our prediction.

Data Preprocessing : We must process data for better results. In preprocessing, we do cleaning, filling missing values etc.

Train Test Split : After that, we will train our model with 80-90% of training-data and 1020% will be used to test-data. And evaluate our model with the help of test-data.

Logistic Regression Model : Why Logistic Regression Model ? Because, this model works very well for Binary Classification Problem. It is a Binary Classification Problem (Rock or a Mine).
This is a Supervised Learning Algorithm.

LogisticRegressionModel

# Importing Dependenciesimport pandas as pdimport numpy as npfrom sklearn.model_selection import train_test_splitfrom sklearn.linear_model import LogisticRegressionfrom sklearn.metrics import accuracy_score# Dataset Readingsonar_data=pd.read_csv("sonardata.csv",header=None)# Check relation between classessonar_data.groupby(60).mean()# Separating input-output columnsX=sonar_data.drop(columns=60,axis=1)y=sonar_data[60]# train_test_splitX_train,X_test,Y_train,Y_test=train_test_split(X,y,test_size=0.1,stratify=y,random_state=1)# Model Buildingmodel=LogisticRegression()# Model Fittingmodel.fit(X_train,Y_train)# accuracy on training dataX_train_pred=model.predict(X_train)training_data_accuracy=accuracy_score(X_train_pred,Y_train)# accuracy on test dataX_test_pred=model.predict(X_test)test_data_accuracy=accuracy_score(X_test_pred,Y_test)# Check Github Link For Full Code And Dataset

Github Link : Click Here


Original Link: https://dev.to/prkskrs/interesting-machine-learning-projects-rock-vs-mine-prediction-2406

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To