regression(2)
-
[머신러닝] Logistic Regression
import numpy as np import pandas as pd import matplotlib.pylab as plt dfLoad=pd.read_csv('https://sites.google.com/site/vlsicir/testData_workHour_vs_passFail.txt', sep="\s+"); xxRaw=np.array(dfLoad.values[:,0]) yyRaw=np.array(dfLoad.values[:,1]) plt.plot(xxRaw, yyRaw, "k.") def sigmoid(x): return 1.0/(1+np.exp(-x)) #xxTest=np.linspace(-10, 10, num=101) #plt.plot(xxTest, sigmoid(xxTest), "k-") N=..
2020.07.18 -
[머신러닝] Linear Regression
import numpy as np import pandas as pd import matplotlib.pylab as plt dfLoad=pd.read_csv('https://sites.google.com/site/vlsicir/testData_LinearRegression.txt', sep="\s+"); xxRaw=dfLoad["xx"] yyRaw=dfLoad["yy"] plt.plot(xxRaw, yyRaw, "r. ") N=len(xxRaw) X=np.c_[np.ones([N, 1]), xxRaw] y=np.array(yyRaw).reshape(N, 1) wOLS=np.linalg.inv(X.T.dot(X)).dot(X.T).dot(y) xSample=np.arange(0, 2, 0.01) xSam..
2020.07.12