Machine Learning [2]
Classification:Logistic RegressionLet’s talk about the logistic function,and see how we use it to predict a classification problem: For a classification problem,we have Decision Boundaryletso that we have the decision boundary. By replacing the linear with other functions, we can get more complex decision boundaries. Cost Function for Logistic Regression Training Logistic Regression by Gradient Decsent To my surprise, the partial derivatives of the cost function we defined in this wa...
ml Lab[1]
MLLab[1]: Linear RegressionBasic Data Operate12345678%pip install seabornimport pandas as pdimport numpy as npimport matplotlib.pyplot as plt # matplotlib.pyplot是一些命令行风格函数的集合,使matplotlib以类似于MATLAB的方式工作。import seaborn as snssns.set(context="notebook", style="whitegrid", palette="deep")A=np.eye(5) #单位对角矩阵print(A) Output: 1234567df = pd.read_csv('ex1data1.txt',names=['人口','利润']) # header = None表示没有表头#需要注意的是,Jupyter notebook只能打开当前目录下的数据集,如csv,所以需要使用upload把数据集倒导入到当前目录下。 #pd.read_...
Machine Learning [1]
What is Machine Learning? “Field of study that gives computers the ability to learn without being explicitly programmed.” — Arthur Samuel Supervised LearningRefers to “algorithms that learn X to Y, or input to output”, learning from given “right answers”. Regression (predict numeric value) Classification (predict categories) Unsupervised LearningInput x, and no output. Algorithm has to find structure in the data. Clustering algorithm Linear RegressionTraining set is the data used to trai...
