This project's goal is to create an AI Model capable of predicting watercraft prices based on their composition material, width, length, watercraft type (e.g. yatch, fishing boat), sell type (e.g. new boat, used boat), and manufacture year using a database for the model training.
- sklearn
- pandas
- seaborn
- matplotlib
First we need to import the database, which in this scenario is a .csv file named "barcos_ref.csv". By using the DataFrame.info() method we can observe that no data processing will be necessary in this case.
Watercraft_Values_AI_Prediction/Watercraft_Values_AI_Prediction.py
Lines 10 to 15 in d26e1c7
Now we will analyze the correlation between the price and the other parameters such as length and composition material.
Watercraft_Values_AI_Prediction/Watercraft_Values_AI_Prediction.py
Lines 17 to 21 in d26e1c7
In this scenario we will be using Linear Regression and Random Forest Regressor as Machine Learning Algorithms, thus two models will be generated.
For the AI training process it is necessary to split the database into x_treino, x_teste, y_treino, y_teste where "x" are the parameters used to achieve the "y" which is the price. Both x_treino and y_treino are going to be used for the AI training afterwards x_teste and y_teste will both be used to test the AI Model's accuracy based on the R² Score.
Watercraft_Values_AI_Prediction/Watercraft_Values_AI_Prediction.py
Lines 23 to 38 in d26e1c7
To make it more evident we will plot graphs that compare both the Linear Regression and Random Forest Regressor models to "y_teste".
- Linear Regression X y_teste
- Random Forest Regressor X y_teste
The model with the highest score is the chosen one to predict watercraft prices using a different database called "novos_barcos.csv"
Watercraft_Values_AI_Prediction/Watercraft_Values_AI_Prediction.py
Lines 54 to 58 in d26e1c7
The "nova_previsao" variable contains the respective price values predicted by the AI Model.
Note: this is a project developed for academic purposes, therefore the data contained in "barcos_ref.csv" and "novos_barcos.csv" are fictitious and used only to learn AI model training applications.