Skip to content
Snippets Groups Projects
Commit 983e3b83 authored by AKID HAJER's avatar AKID HAJER
Browse files

Constructing the model and making predictions

parent 52eadcd0
Branches main
No related merge requests found
# Import necessary libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.tree import DecisionTreeRegressor
from sklearn import metrics
# Load the training dataset
train_data = pd.read_csv('train_V110.csv', sep=';', encoding=None)
# Load the testing dataset
test_data = pd.read_csv('test_V110.csv', sep=';', encoding=None)
# Prepare features and target for training
X_train = train_data.drop(['p1', 'p4', 'score_reel'], axis=1)
y_train = train_data['score_reel']
# Prepare features for testing
X_test = test_data.drop(['p1', 'p4'], axis=1)
# Build the Decision Tree Regressor model
clf = DecisionTreeRegressor(random_state=42)
clf.fit(X_train, y_train)
# Make predictions
y_pred = clf.predict(X_test)
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment