Skip to content

Commit f585620

Browse files
committed
Updated data.
1 parent 02d4b62 commit f585620

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Age,Attrition,TravelForWork,SalaryLevel,JobFunction,CommuteLength,EducationalLevel,EducationField,Directs,EmployeeNumber,EnvironmentSatisfaction,Gender,HourlyRate,JobInvolvement,JobLevel,JobRole,JobSatisfaction,MaritalStatus,MonthlyIncome,MonthlyRate,NumCompaniesWorked,Over18,OverTime,PercentSalaryHike,PerformanceRating,RelationshipSatisfaction,WeeklyWorkedHours,StockOptionLevel,YearsinIndustry,TrainingTimesLastYear,WorkLifeBalance,YearsOnJob,YearsAtCurrentLevel,YearsSinceLastPromotion,YearsWithCurrManager
2+
42,Yes,infrequent,5054,Product Management,2,L2,Life Sciences,1,1,2,Female,94,3,2,Sales Executive,4,Single,5993,19479,8,Y,Yes,11,3,1,80,0,8,0,1,6,4,0,5
3+
50,No,often,1278,Software Developer,9,L1,Life Sciences,1,2,3,Male,61,2,2,Research Scientist,2,Married,5130,24907,1,Y,No,23,4,4,80,1,10,3,3,10,7,1,7
4+
38,Yes,infrequent,6296,Software Developer,3,L2,Other,1,4,4,Male,92,2,1,Laboratory Technician,3,Single,2090,2396,6,Y,Yes,15,3,2,80,0,7,3,3,0,0,0,0
5+
34,No,often,6384,Software Developer,4,L4,Life Sciences,1,5,4,Female,56,3,1,Research Scientist,3,Married,2909,23159,1,Y,Yes,11,3,3,80,0,8,3,3,8,7,3,0
6+
28,No,infrequent,2710,Software Developer,3,L1,Medical,1,7,1,Male,40,3,1,Laboratory Technician,2,Married,3468,16632,9,Y,No,12,3,4,80,1,6,3,3,2,2,2,2
7+
33,No,often,4608,Software Developer,3,L2,Life Sciences,1,8,4,Male,79,3,1,Laboratory Technician,4,Single,3068,11864,0,Y,No,13,3,3,80,0,8,2,2,7,7,3,6
8+
60,No,infrequent,6072,Software Developer,4,L3,Medical,1,10,3,Female,81,4,1,Laboratory Technician,1,Married,2670,9964,4,Y,Yes,20,4,1,80,3,12,3,2,1,0,0,0
9+
31,No,infrequent,6228,Software Developer,25,L1,Life Sciences,1,11,4,Male,67,3,1,Laboratory Technician,3,Divorced,2693,13335,1,Y,No,22,4,2,80,1,1,2,3,1,0,0,0

tests/unitary/with_extras/dataset/test_dataset_dataset.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_TargetVariable_with_scipy_uninstalled(self):
5757

5858
def test_initialize_dataset(self):
5959
employees = ADSDataset(
60-
df=pd.read_csv("oci://hosted-ds-datasets@bigdatadatasciencelarge/synthetic/orcl_attrition.csv"),
60+
df=pd.read_csv(self.get_data_path()),
6161
name="test_dataset",
6262
description="test_description",
6363
storage_options={'config':{},'region':'us-ashburn-1'}
@@ -72,7 +72,7 @@ def test_initialize_dataset(self):
7272

7373
def test_from_dataframe(self):
7474
employees = ADSDataset.from_dataframe(
75-
df=pd.read_csv("oci://hosted-ds-datasets@bigdatadatasciencelarge/synthetic/orcl_attrition.csv"),
75+
df=pd.read_csv(self.get_data_path()),
7676
name="test_dataset",
7777
description="test_description",
7878
storage_options={'config':{},'region':'us-ashburn-1'}
@@ -84,3 +84,7 @@ def test_from_dataframe(self):
8484
assert employees.description == "test_description"
8585
assert "type_discovery" in employees.init_kwargs
8686
assert isinstance(employees.transformer_pipeline, TransformerPipeline)
87+
88+
def get_data_path(self):
89+
current_dir = os.path.dirname(os.path.abspath(__file__))
90+
return os.path.join(current_dir, "data", "orcl_attrition.csv")

tests/unitary/with_extras/dataset/test_dataset_target.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Copyright (c) 2023 Oracle and/or its affiliates.
44
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
55

6+
import os
67
from typing import Tuple
78
import pandas as pd
89
from ads.dataset.classification_dataset import BinaryClassificationDataset
@@ -14,7 +15,7 @@
1415
class TestADSDatasetTarget:
1516
def test_initialize_dataset_target(self):
1617
employees = ADSDatasetWithTarget(
17-
df=pd.read_csv("oci://hosted-ds-datasets@bigdatadatasciencelarge/synthetic/orcl_attrition.csv"),
18+
df=pd.read_csv(self.get_data_path()),
1819
target="Attrition",
1920
name="test_dataset",
2021
description="test_description",
@@ -33,7 +34,7 @@ def test_initialize_dataset_target(self):
3334

3435
def test_dataset_target_from_dataframe(self):
3536
employees = ADSDatasetWithTarget.from_dataframe(
36-
df=pd.read_csv("oci://hosted-ds-datasets@bigdatadatasciencelarge/synthetic/orcl_attrition.csv"),
37+
df=pd.read_csv(self.get_data_path()),
3738
target="Attrition",
3839
storage_options={'config':{},'region':'us-ashburn-1'}
3940
).set_positive_class('Yes')
@@ -45,3 +46,7 @@ def test_dataset_target_from_dataframe(self):
4546
assert employees.target.type["type"] == "categorical"
4647
assert "type_discovery" in employees.init_kwargs
4748
assert isinstance(employees.transformer_pipeline, TransformerPipeline)
49+
50+
def get_data_path(self):
51+
current_dir = os.path.dirname(os.path.abspath(__file__))
52+
return os.path.join(current_dir, "data", "orcl_attrition.csv")

0 commit comments

Comments
 (0)