Skip to content

Commit 0e053d9

Browse files
authored
os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Social_Network_Ads.csv')
1 parent e80a524 commit 0e053d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

machine_learning/random_forest_classification/random_forest_classification.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Random Forest Classification
22

33
# Importing the libraries
4+
import os
45
import numpy as np
56
import matplotlib.pyplot as plt
67
import pandas as pd
78

89
# Importing the dataset
9-
dataset = pd.read_csv('Social_Network_Ads.csv')
10+
filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Social_Network_Ads.csv')
11+
dataset = pd.read_csv(filename)
1012
X = dataset.iloc[:, [2, 3]].values
1113
y = dataset.iloc[:, 4].values
1214

@@ -66,4 +68,4 @@
6668
plt.xlabel('Age')
6769
plt.ylabel('Estimated Salary')
6870
plt.legend()
69-
plt.show()
71+
plt.show()

0 commit comments

Comments
 (0)