diff --git a/src/python/05.Logistic/core/com/apachecn/logistic/logRegression.py b/src/python/05.Logistic/core/logRegression01.py similarity index 100% rename from src/python/05.Logistic/core/com/apachecn/logistic/logRegression.py rename to src/python/05.Logistic/core/logRegression01.py diff --git a/src/python/05.Logistic/core/com/apachecn/logistic/test_logRegression.py b/src/python/05.Logistic/core/test_logRegression.py similarity index 91% rename from src/python/05.Logistic/core/com/apachecn/logistic/test_logRegression.py rename to src/python/05.Logistic/core/test_logRegression.py index c40c630e..c7d5d50d 100644 --- a/src/python/05.Logistic/core/com/apachecn/logistic/test_logRegression.py +++ b/src/python/05.Logistic/core/test_logRegression.py @@ -3,14 +3,9 @@ import os import sys sys.path.append("C:\Python27") - from numpy import * - - -import matplotlib.pyplot as plt - -from logRegression import * +from logRegression01 import * """ @version: @author: yangjf @@ -31,7 +26,7 @@ def loadData(): # 截取字符串至项目名:Test\ project_dir = project_dir[:project_dir.find("MachineLearning\\") + 15] print project_dir - fileIn = open("%s/testData/testSet.txt" % project_dir) + fileIn = open("%s/testData/Logistic_testdata.txt" % project_dir) for line in fileIn.readlines(): lineArr = line.strip().split() train_x.append([1.0, float(lineArr[0]), float(lineArr[1])]) diff --git a/src/python/Logistic.py b/src/python/Logistic.py index dc6bc345..c59e022d 100644 --- a/src/python/Logistic.py +++ b/src/python/Logistic.py @@ -117,7 +117,7 @@ def plotBestFit(dataArr, labelMat, weights): def main(): project_dir = os.path.dirname(os.path.dirname(os.getcwd())) # 1.收集并准备数据 - dataMat, labelMat = loadDataSet("%s/testData/testSet.txt" % project_dir) + dataMat, labelMat = loadDataSet("%s/testData/Logistic_testdata.txt" % project_dir) # print dataMat, '---\n', labelMat # 2.训练模型, f(x)=a1*x1+b2*x2+..+nn*xn中 (a1,b2, .., nn).T的矩阵值 diff --git a/src/python/apriori.py b/src/python/apriori.py index ee6af908..98112685 100644 --- a/src/python/apriori.py +++ b/src/python/apriori.py @@ -73,7 +73,7 @@ def apriori(dataSet, minSupport = 0.5): def main(): # project_dir = os.path.dirname(os.path.dirname(os.getcwd())) # 1.收集并准备数据 - # dataMat, labelMat = loadDataSet("%s/resources/testSet.txt" % project_dir) + # dataMat, labelMat = loadDataSet("%s/resources/Logistic_testdata.txt" % project_dir) # 1. 加载数据 diff --git a/testData/testSet.txt b/testData/Logistic_testdata.txt similarity index 100% rename from testData/testSet.txt rename to testData/Logistic_testdata.txt