diff --git a/.gitignore b/.gitignore index 3a14dca..386306c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ PEL208-Special_Learning_Topics/least_squares_data/.idea PEL208-Special_Learning_Topics/pca_data/.idea PEL208-Special_Learning_Topics/lda_data/.idea PEL208-Special_Learning_Topics/kmeans_data/.idea -Python_Assignments/__pycache__ \ No newline at end of file +Python_Assignments/__pycache__ +Python_Assignments/naive_bayes/__pycache__ \ No newline at end of file diff --git a/Python_Assignments/NaiveBayes.py b/Python_Assignments/naive_bayes/NaiveBayes.py similarity index 100% rename from Python_Assignments/NaiveBayes.py rename to Python_Assignments/naive_bayes/NaiveBayes.py diff --git a/Python_Assignments/ex1.py b/Python_Assignments/naive_bayes/ex1.py similarity index 91% rename from Python_Assignments/ex1.py rename to Python_Assignments/naive_bayes/ex1.py index 4299369..8d78f30 100644 --- a/Python_Assignments/ex1.py +++ b/Python_Assignments/naive_bayes/ex1.py @@ -1,4 +1,4 @@ -import Python_Assignments.NaiveBayes as naive +import NaiveBayes as naive import pandas as pd df = pd.read_csv('ex1.txt', index_col=0) diff --git a/Python_Assignments/ex1.txt b/Python_Assignments/naive_bayes/ex1.txt similarity index 100% rename from Python_Assignments/ex1.txt rename to Python_Assignments/naive_bayes/ex1.txt diff --git a/Python_Assignments/gaussianExample.py b/Python_Assignments/naive_bayes/gaussianExample.py similarity index 92% rename from Python_Assignments/gaussianExample.py rename to Python_Assignments/naive_bayes/gaussianExample.py index 1a1e573..1db73fc 100644 --- a/Python_Assignments/gaussianExample.py +++ b/Python_Assignments/naive_bayes/gaussianExample.py @@ -1,4 +1,4 @@ -import Python_Assignments.NaiveBayes as naive +import NaiveBayes as naive import pandas as pd df = pd.read_csv('gaussianExample.txt') diff --git a/Python_Assignments/gaussianExample.txt b/Python_Assignments/naive_bayes/gaussianExample.txt similarity index 100% rename from Python_Assignments/gaussianExample.txt rename to Python_Assignments/naive_bayes/gaussianExample.txt diff --git a/Python_Assignments/inClassExample.py b/Python_Assignments/naive_bayes/inClassExample.py similarity index 91% rename from Python_Assignments/inClassExample.py rename to Python_Assignments/naive_bayes/inClassExample.py index 7255228..0e5e2cc 100644 --- a/Python_Assignments/inClassExample.py +++ b/Python_Assignments/naive_bayes/inClassExample.py @@ -1,4 +1,4 @@ -import Python_Assignments.NaiveBayes as naive +import NaiveBayes as naive import pandas as pd df = pd.read_csv('playTennis.txt', index_col=0) diff --git a/Python_Assignments/iris.py b/Python_Assignments/naive_bayes/iris.py similarity index 92% rename from Python_Assignments/iris.py rename to Python_Assignments/naive_bayes/iris.py index 95a5500..f6e75f4 100644 --- a/Python_Assignments/iris.py +++ b/Python_Assignments/naive_bayes/iris.py @@ -1,7 +1,8 @@ -import Python_Assignments.NaiveBayes as naive +import NaiveBayes as naive import pandas as pd +import os -df = pd.read_csv('iris.txt') +df = pd.read_csv(os.path.join('..', 'iris.txt')) target_feature = 'class' n_bayes = naive.NaiveBayes(df, target_feature) diff --git a/Python_Assignments/playTennis.txt b/Python_Assignments/naive_bayes/playTennis.txt similarity index 100% rename from Python_Assignments/playTennis.txt rename to Python_Assignments/naive_bayes/playTennis.txt diff --git a/Python_Assignments/pred_ex1.txt b/Python_Assignments/naive_bayes/pred_ex1.txt similarity index 100% rename from Python_Assignments/pred_ex1.txt rename to Python_Assignments/naive_bayes/pred_ex1.txt diff --git a/Python_Assignments/pred_gaussianExample.txt b/Python_Assignments/naive_bayes/pred_gaussianExample.txt similarity index 100% rename from Python_Assignments/pred_gaussianExample.txt rename to Python_Assignments/naive_bayes/pred_gaussianExample.txt diff --git a/Python_Assignments/pred_playTennis.txt b/Python_Assignments/naive_bayes/pred_playTennis.txt similarity index 100% rename from Python_Assignments/pred_playTennis.txt rename to Python_Assignments/naive_bayes/pred_playTennis.txt diff --git a/Python_Assignments/requirements.txt b/Python_Assignments/naive_bayes/requirements.txt similarity index 100% rename from Python_Assignments/requirements.txt rename to Python_Assignments/naive_bayes/requirements.txt diff --git a/Python_Assignments/seeds.py b/Python_Assignments/naive_bayes/seeds.py similarity index 92% rename from Python_Assignments/seeds.py rename to Python_Assignments/naive_bayes/seeds.py index 215bc63..ecd3704 100644 --- a/Python_Assignments/seeds.py +++ b/Python_Assignments/naive_bayes/seeds.py @@ -1,7 +1,8 @@ -import Python_Assignments.NaiveBayes as naive +import NaiveBayes as naive import pandas as pd +import os -df = pd.read_csv('seeds.txt') +df = pd.read_csv(os.path.join('..', 'seeds.txt')) target_feature = 'class' n_bayes = naive.NaiveBayes(df, target_feature) diff --git a/Python_Assignments/wine.py b/Python_Assignments/naive_bayes/wine.py similarity index 92% rename from Python_Assignments/wine.py rename to Python_Assignments/naive_bayes/wine.py index 77f4b38..2725d75 100644 --- a/Python_Assignments/wine.py +++ b/Python_Assignments/naive_bayes/wine.py @@ -1,7 +1,8 @@ -import Python_Assignments.NaiveBayes as naive +import NaiveBayes as naive import pandas as pd +import os -df = pd.read_csv('wine.txt') +df = pd.read_csv(os.path.join('..', 'wine.txt')) target_feature = 'class' n_bayes = naive.NaiveBayes(df, target_feature)