[ML lec] Linear Regression 개념
* ML ?
=Machine Learning
- 정확한 프로그래밍의 한계 (너무 많은 룰 등)
- Arthur Samuel , 어떤 자료나 현상에서 자동으로 배우는 것을 제안.
- 개발자가 일일이 하지 않고 데이터를 보고 학습해서 배우는 것.
* Supervised/uUnsuperviesed learning
- Supervised learning : 데이터를 갖고 학습 (ex. 이미지를 갖고 자동으로 알아내는 것, label을 만들어줌.)
: image labeling, email spam filter, predicting exam score
: training data set : 머신러닝 모델, 답(label)이 정해진 Y,
ex. 고양이 사진을 모아서 준다 = 학습, 개 사진을 모아서 준다. = 학습.
- Unsupervised learning : 자동적으로 유사한 것을 그룹핑 (google news grouping, word clustering)
[Types of supervised learning]
https://www.youtube.com/watch?v=qPMeuL2LIqY
- regression : 결과값을 예측하는 것. ex) predicting final exam score based on time spent
- bianry classification : 두가지로 판단 ex) Pass/non-pass based on time spent.
- multi-label classification : Letter grade (A,B,C,E, and F)
[Cost Function]
EX) H(x) = 1X + 0일때, H1(x) = 0.5X + 2 와 H2(X) = 0.5X - 1 라고 하자.
이때 Cost Function은 위 그림의 점선의 거리를 나타낸다.
[TensorFlow 흐름]
1. 텐서플로를 이용해 그래프를 빌드
node1 = tf.constant(3.0, tf.float32)
node2 = tf.constant(4.0)
node3 = tf.add(node1, node2)
2. 데이터를 넣어서 그래프를 실행
session.run(op)
3. 값들 update, 실행
sess = tf.Session()
print("sess.run(node1, node2): ", sess.run([node1, node2]))
print("sess.run(node3): ", sess.run(node3))
[Placeholder]
학습용 데이타를 위한 데이타 타입. 학습용 데이타를 담는 그릇을 플레이스홀더(placeholder)
참고 : https://bcho.tistory.com/1150 [조대협의 블로그]
[Rank]
0 : scalar ex. s= 483
1 : vector ex. v=[1.1, 2.2, 3.3]
2 : matrix ex. m=[[1,2,3],[4,5,6],[7,8,9]]
3 : 3-tensor ex. t=[[[2],[4],[6]],[[8],[10],[12]],[[14],[16],[18]]]
[shape] :몇개씩 들어있나?
[3,3]
[Types] : float32 사용 , int32 사용