AI/Machine Learning

    Logistic Regression - Cost function / Gradient descent

    Logistic Regression - Cost function / Gradient descent

    Logistic Regression - Cost function / Gradient Descent- 아래 내용은 Andrew Ng 교수님의 강의와 자료를 기반으로 학습한 내용을 정리하여 작성하였습니다. 개인의 학습 내용이기에 잘못 해석 및 이해하고 있는 부분도 있을 수 있으니, 다양한 자료를 기반으로 참고하시는 걸 추천드립니다. Cost functionCost function 은 theta를 선택하기 위해 Hypothesis를 평가하는 방법입니다. Linear regression에서는 Cost function J를 graph로 표현했을 때 Convex 형태의 graph가 그렸졌었음을 기억하시나요? Linear Regression에서 사용했던 Squared error function을 그대로 Logisti..

    Logistic Regression - Model representation / Decision boundary

    Logistic Regression - Model representation / Decision boundary

    Logistic Regression - Model Representation / Decision boundary - 아래 내용은 Andrew Ng 교수님의 강의와 자료를 기반으로 학습한 내용을 정리하여 작성하였습니다. 개인의 학습 내용이기에 잘못 해석 및 이해하고 있는 부분도 있을 수 있으니, 다양한 자료를 기반으로 참고하시는 걸 추천드립니다. 이번 글에서는 Logistic Regression에 대해 확인해보겠습니다.지난 시간 Linear Regression은 continuous한 values에 대해 학습하고, 입력에 대해 예측되는 출력을 제공하기 위한 내용이였습니다. 이번 시간에는 continuous가 아닌 discrete하게 classification(이하 분류)를 위한 Logistic Regress..

    Linear Regression - Gradient Descent

    Linear Regression - Gradient Descent

    Linear Regression(선형 회귀) 아래 내용은 Andrew Ng 교수님의 강의와 자료를 기반으로 학습한 내용을 정리하여 작성하였습니다. 개인의 학습 내용이기에 잘못 해석 및 이해하고 있는 부분도 있을 수 있으니, 다양한 자료를 기반으로 참고하시는 걸 추천드립니다. 앞 글에서 설명했던 Linear Regression의 Model Representation과 Cost function에 이어 Gradient Descent에 대해 알아 보려합니다. 들어가기에 앞서 이 전 글에서 설명했던 우리의 목표에 대해 다시 한번 상기해 보죠. 앞에서 우리는 Model을 1차 방정식으로 선정하였으며, h(x) = theta0 + theta1 * x로 표현을 하였었습니다. 그리고 Cost function 을 이용해서..

    Linear Regression - Model Representation / Cost function

    Linear Regression - Model Representation / Cost function

    Linear Regression(선형 회귀) 아래 내용은 Andrew Ng 교수님의 강의와 자료를 기반으로 학습한 내용을 정리하여 작성하였습니다. 개인의 학습 내용이기에 잘못 해석 및 이해하고 있는 부분도 있을 수 있으니, 다양한 자료를 기반으로 참고하시는 걸 추천드립니다. Machine Learning 중 Supervised Learning에서 가장 기초적으로 다뤄지는 내용이 Linear regression(선형 회귀)입니다.제 개인적인 의견으로 Linear Regression은 모델표현이 쉽고 단순하며 Cost function과 Gradient descent 등을 이해하기 쉽기 때문이라고 생각됩니다. 위의 그래프를 보시면, Portland의 집 크기에 따른 가격 Data를 표현한 그래프입니다. 위 D..

    Loading data from csv file

    1. numpy - loadtxt [source]Load data from a text file.Each row in the text file must have the same number of values.Parameters:fname : file, str, or pathlib.PathFile, filename, or generator to read. If the filename extension is .gz or .bz2, the file is first decompressed. Note that generators should return byte strings for Python 3k.dtype : data-type, optionalData-type of the resulting array; de..

    Linear Regression - Multiple feature

    import tensorflow as tf #Data x_data = [[73., 80., 75.], [93., 88., 93.], [89., 91., 90.], [96., 98., 100.], [73., 66., 70.]] y_data = [[152.], [185.], [180.], [196.], [142.]] # PlaceHolder # shape : None - variable, 3 - data count # 즉 x_data를 보면, List 내에 들어갈 수 있는 List의 개수는 정해지지 않고(None), # List 내의 data는 3개인 x란 이름의 PlaceHolder 생성 x = tf.placeholder(tf.float32, shape=[None, 3]) y = tf.placeholder..