<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/resources/xsl/jats-html.xsl"?>
<article article-type="research-article" dtd-version="1.1" xml:lang="ko" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<front>
	<journal-meta>
		<journal-id journal-id-type="publisher-id">jkits</journal-id>
		<journal-title-group>
		<journal-title>한국지식정보기술학회 논문지</journal-title>
		<journal-title xml:lang="en">Journal of Knowledge Information Technology and Systems</journal-title>
		</journal-title-group>
		<issn pub-type="ppub">1975-7700</issn>
		<publisher>
		<publisher-name>한국지식정보기술학회</publisher-name>
		<publisher-name xml:lang="en">Korea Knowledge Information Technology Society</publisher-name>
		</publisher>
	</journal-meta>
	<article-meta>
		<article-id pub-id-type="publisher-id">jkits_2019_14_04_381</article-id>
		<article-id pub-id-type="doi">10.34163/jkits.2019.14.4.007</article-id>
		<article-categories>
			<subj-group>
				<subject>Research Article</subject>
			</subj-group>
		</article-categories>
		<title-group>
			<article-title>선형회귀분석 기법을 이용한 고교야구투수의 투구속도 예측</article-title>
			<trans-title-group xml:lang="en">
				<trans-title>High-School Baseball Pitcher’s Pitching Speed Prediction Using Linear Regression Analysis Method</trans-title>
			</trans-title-group>
		</title-group>
		<contrib-group>
			<contrib contrib-type="author" xlink:type="simple">
				<name-alternatives>
					<name name-style="eastern">
						<surname>오</surname><given-names>영환</given-names>
					</name>
					<name name-style="western" xml:lang="en">
						<surname>Oh</surname><given-names>Young-Hwan</given-names>
					</name>
					</name-alternatives>
					<xref ref-type="aff" rid="A1"></xref>
					<xref ref-type="fn" rid="fn001"><sup>*</sup></xref>
			</contrib>
					</contrib-group>
		<aff-alternatives id="A1">
			<aff><italic>나사렛대학교 IT융합학부 교수</italic></aff>
			<aff xml:lang="en"><italic>Division of IT Convergency, Korea Nazarene University</italic></aff>
		</aff-alternatives>
				<author-notes>
			<fn id="fn001"><label>*</label><p>Corresponding author is with the Division of IT Convergency, Korea Nazarene University, 456 Wolbong-ro Seobuk-gu Cheonan, 31172, KOREA. </p>
			<p><italic>E-mail address</italic>: <email>yhoh@kornu.ac.kr</email></p></fn>
		</author-notes>
		<pub-date pub-type="ppub">
			<month>8</month>
			<year>2019</year>
		</pub-date>
		<volume>14</volume>
		<issue>4</issue>
		<fpage>381</fpage>
		<lpage>390</lpage>
		<history>
			<date date-type="received">
				<day>1</day>
				<month>7</month>
				<year>2019</year>
			</date>
			<date date-type="rev-recd">
				<day>23</day>
				<month>7</month>
				<year>2019</year>
			</date>
			<date date-type="accepted">
				<day>9</day>
				<month>8</month>
				<year>2019</year>
			</date>
		</history>
		<permissions>
			<copyright-statement>&#x00A9; 2019 KKITS All rights reserved</copyright-statement>
			<copyright-year>2019</copyright-year>
		</permissions>
		<abstract>
			<title>요약</title>
			<p>최근에 알파고(AlphaGo)와 같은 인공 지능(Artificial Intelligence)과 기계 학습(Machine Learning)에 대한 연구가 매우 활발히 진행되고 있다. 통계학에서 선형회귀(Linear Regression)는 종속 변수 y와 한 개 이상의 독립 변수 y와의 선형 상관관계를 모델링하는 회귀분석 기법으로 일반적으로 최소제곱법(Least Square Method)을 사용해 선형 회귀 모델을 정립한다. 즉, 선형회귀 분석은 독립변수와 종속변수, 상수항 사이의 관계를 모델링하는 방법으로 두 변수 사이의 관계를 모델링하는 단순 선형회귀 방법과 둘 이상의 독립 변수에 기반하는 다중 선형회귀 방법이 있다. 야구 경기에서 투수는 타자와 상대할 시에 좋은 결과를 내기위해서 투구 스피드와 제구, 투구 밸런스 등이 좋아야 한다. 고교야구 선수가 훌륭한 투수로 성장하기 위한 중요한 요소는 투구 스피드이다. 또한 투수의 볼 스피드는 야구 경기의 승과 패를 나눌 수 있는 중요한 요소 중의 하나이다. 본 논문에서는 딥러닝 프레임워크(Deep Learning Framework)인 텐서플로우(Tensorflow)를 이용하여 고교야구 선수중 투수의 볼 스피드를 측정하여 선수의 운동과 훈련재활을 위해 사용하고자 한다. 본 연구에서는 투수의 보폭과 스피드에 대한 학습데이터를 생성하고 최적화 알고리즘인 경사 하강법을 이용하여 선형회귀 예측기법을 수행한다.</p>
		</abstract>
		<trans-abstract xml:lang="en">
			<title>ABSTRACT</title>
			<p>Recently, studies on artificial intelligence such as AlphaGo and machine learning have been actively conducted. In statistics, linear regression is a regression method that models the linear correlation between dependent variable y and one or more independent variables y. Generally, a linear regression model is established using least square method. In other words, linear regression analysis is a method of modeling the relationship between independent variables, dependent variables, and constant terms. There is a simple linear regression method that models the relationship between two variables and a multiple linear regression method based on two or more independent variables. In a baseball game, the pitcher must be good at ball speed, pitching control, pitching balance, etc., in order to get good results when dealing with batter. High school baseball player’s pitching speed is important factor to grow as excellent pitcher. Also, pitcher's ball speed is one of the important factors that determine the winning or defeat of the baseball game. In this paper, we use the Deep Learning Framework(Tensorflow) to measure ball speed of pitcher among high school baseball players and use it for athlete 's exercise and training rehabilitation. In this study, we generate training data about stride and speed of the pitcher and perform the linear regression prediction method using the gradient-descent method which is the optimization algorithm.</p>
		</trans-abstract>
		<kwd-group kwd-group-type="author" xml:lang="en">
			<kwd>Artificial intelligence</kwd>
			<kwd>Machine-learning</kwd>
			<kwd>Linear regression</kwd>
			<kwd>Tensorflow</kwd>
			<kwd>Gradient descent</kwd>
		</kwd-group>
	</article-meta>
</front>
<body>
<sec id="sec001" sec-type="intro">
	<title>1. 서 론</title>
<p>최근에 알파고(AlphaGo)와 이세돌의 경기를 알파고가 이기면서 전 세계의 인공 지능(Artificial Intelligence)에 대한 높은 관심이 있다<xref ref-type="bibr" rid="B001">[1]</xref>. 그 후 인공 지능에 관한 연구가 활발히 진행 중이고, 연구자와 학자들이 인간을 넘어서는 인공지능을 제작하기 위해 끊임없이 노력 중이다. 인공 지능이라는 학문적 개념은 1956년 미국 다트머스 대학(Dartmouth college)에 있던 존 매카시(John McCarthy) 교수가 개최한 다트머스 회의(Dartmouth Conference)에서 처음 등장하였으며<xref ref-type="bibr" rid="B002">[2]</xref>, 근래에 들어서 폭발적으로 성장하고 있는 중이다. 특히 2015년 이후 빠른 속도의 병렬 처리 성능을 지원하는 GPU(Graphics Processing Unit)의 도입으로 더욱 가속화되고 있다.</p>
<p>한편, 머신 러닝은 기본적인 알고리즘을 이용해 데이터를 예측하고, 분석하고, 학습한다. 이 학습한 내용을 기반으로 판단이나 의사 결정을 한다. 그러나 최종적으로는 코딩 소프트웨어에 최적 알고리즘을 직접 기술해 넣는 것이 아니고 대용량의 데이터와 학습 알고리즘을 이용하여 전자기기 그 자체를 학습하도록 하여 작업 수행능력을 만드는 것을 목표로 한다<xref ref-type="bibr" rid="B003">[3]</xref>. 최근에는 인간의 뇌가 가진 생물학적 특성, 특히 뉴런 연결 구조를 기반으로 하는 인공 신경망(Artificial neural network) 연구에 박차를 가하고 있다. 딥 러닝(Deep learning)은 뇌의 뉴런과 유사한 정보 입출력 방법을 활용하여 방대한 양의 데이터를 학습하고 재생산하여 기존의 인공 신경망에서 발전한 다른 형태의 인공 지능 기법이다.</p>
<p>야구 경기는 투수가 공을 던지는 것으로부터 시작된다. 투수(Pitcher)의 송구와 포수(Catcher)의 포구는 야구 경기에서 차지하는 비중은 매우 크다<xref ref-type="bibr" rid="B004">[4]</xref>. 투수는 좋은 성적을 내기 위해서 투구 스피드(Ball speed)와 제구(Ball control), 다양한 변화구(Change-up)를 가져야 한다. 훌륭한 투수의 기본요소는 제구력과 스피드, 투구 밸런스(Pitching balance)이다. 투수의 볼 스피드가 약 140km인 공을 던질 경우 투수의 손으로부터 홈플레이트를 지나는 시간은 약 0.4∼0.5초이다. 좋은 투수로 성장하기 위한 중요한 요소는 투구의 스피드이다.</p>
<p>빠르고 정확한 투구과정을 위해서는 다음과 같은 과정이 필수적이다. 즉, 빠르고 정확한 투구 속도를 내기 위해서는 공을 던지는 동안 투수의 신체 분절의 원할한 협동동작이 필요하다<xref ref-type="bibr" rid="B005">[5]</xref>. 투수의 투구모션은 와인드업(Wind-up), 스트라이드(Stride), 팔코킹(Arm cocking), 팔가속(Arm acceleration), 팔감속(Arm deceleration), 팔로우 드로우(Follow-through)까지 총 6단계로 구분된다<xref ref-type="bibr" rid="B006">[6]</xref>.</p>
<fig id="f001" orientation="portrait" position="float">
	<label>그림 1.</label>
	<caption>
		<title>투구 단계</title>
		<p>Figure 1. Pitching Phases</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f001.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>이와 같이 투구 동작 중 발생나는 근육 운동은 발바닥에서부터 다리, 허리, 몸통, 팔, 손목까지의 신체의 전반적인 근육 협동작용이 만들어지기 때문에 모든 신체 관절을 이용한 단계적이면서 동시적인 동작이라 할 수 있다<xref ref-type="bibr" rid="B007">[7]</xref>. 투수의 안정된 투구자세와 빠른 투구 스피드를 위해서는 팔과 허리의 강한 회전 동작과 손목, 팔목의 신속한 코킹을 통하여 야구공에 큰 에너지를 전달할 수 있어야 한다. 또한 강한 하체의 힘과 빠른 상체의 회전, 안정적인 넓은 보폭은 공의 힘과 속도를 높이는 데 꼭 필요하다<xref ref-type="bibr" rid="B008">[8]</xref>.</p>
<p>2019년 현재 대한야구소프트볼협회(Korea Baseball Softball Association)에 등록된 고교야구는 80개팀이 있으며 고교야구 주말리그, 전국대회 등 많은 경기를 소화하고 있다. 고교야구 주말리그제는 문화체육관광부, 대한야구소프트볼협회가 2011년부터 시행한 제도로서 ‘공부하는 엘리트 학생 스포츠’라는 취지를 가지고, 전국을 10-12개 권역으로 나눠 6-8개 팀을 배정하여 주중을 제외한 주말리그로 열리고 있다<xref ref-type="bibr" rid="B009">[9]</xref>. 고교야구 선수와 KBO 프로선수들과는 체력, 기술, 체격적인 면에서 큰 차이가 있기 때문에 이를 줄이기 위한 다양한 시도와 노력을 하고 있다. 야구 선수의 기초데이터가 되는 운동능력, 순발력, 지구력 등의 경기력을 위한 평가와 기준에 대한 연구들이 프로야구와 대학야구 선수를 대상으로 국한되어 왔으며, 고교야구 선수들에 대한 기본적인 연구들은 거의 없는 실정이다. 야구운동평가에 있어 투수의 제구력과 투구 스피드는 감독이나 코치, 트레이너에게 투수 훈련 계획을 수립하고 재활훈련을 하는 데 있어 매우 중요한 데이터로서 활용될 수 있다.</p>
<p>좋은 투수로 성장하기 위해서는 자신이 던질 수 있는 구종에 대한 제구와 구속, 투구 밸런스가 중요하다. 제구를 잡기 위해서는 강한 집중력과 든든한 하체가 필수적이다. 또한 투구 밸런스는 홈플레이트를 향하여 중심 이동을 하는 경우 하체, 상체, 팔움직임, 머리 모양이 홈플레이트와 일직선상에 놓여야 한다. 그리고 투수의 중요한 요소는 볼 스피드에 있다. 투구 모션과 손가락 형태, 유연성 그리고 몸통 회전과 보폭의 상관성이 투구 스피드를 올리는 중요한 인자이다. 오른손 투수 인 경우 공을 던지기 위해서 왼발을 앞으로 쭉 내밀게 되는 데 이때 멀리 디딜 수 있다면 그만큼 타자와 투수의 간격을 좁힐 수 있고 야구공에 더욱 큰 힘을 줄 수 있으므로 볼 스피드가 늘어나는 효과를 줄 수 있다. 특히 보폭의 크기는 투수의 몸의 아크를 크게 만들기 때문에 투구 스피드 큰 영향을 미치게 된다. 본 논문에서는 딥 러닝을 이용하여 고등학교 투수의 속구 스피드를 예측하기 위한 선형회귀분석기법을 연구한다. 이를 위하여 텐서플로우(Tensorflow)를 이용하며 예측모델을 구현하고 성능을 평가한다.</p>
<p>본 논문의 구성은 다음과 같다. 제 2장에서는 관련 연구, 제 3장에서는 야구선수의 모형분석, 제4장에서는 예측모델과 학습데이터를 기술한다. 제5장에서는 구현 및 실험결과를 설명한다. 마지막으로 제6장에서 결론을 맺는다.</p>
</sec>
<sec id="sec002">
<title>2. 관련 연구</title>
<sec id="sec002-1">
<title>2.1 선형회귀 분석</title>
<p>선형회귀 분석(Linear Regression Analysis)은 변수들 사이의 상관 관계를 분석하는 데 사용하는 통계학적 방법이다<xref ref-type="bibr" rid="B010">[10]</xref>. 선형회귀 분석은 독립변수 X, 종속변수 y, 상수항 b 사이의 관계를 모델링하는 방법이다. 두 변수 사이의 관계일 경우 단순 선형회귀(Simple Linear Regression)라고 하며, 여러 개의 변수를 다루는 다중 선형회귀(Multiple Linear Regression)도 있다<xref ref-type="bibr" rid="B011">[11]</xref>.</p>
</sec>
<sec id="sec002-2">
<title>2.2 텐서플로우(Tensorflow)</title>
<p>텐서플로우는 구글이 2011년에 개발을 시작하여 2015년에 오픈 소스(Open source)로 공개한 기계학습 라이브러리로 딥러닝과 기계학습 분야를 일반인들도 사용하기 쉽도록 다양한 기능들을 제공한다. 2016년 알파고와 함께 한국에서도 관심이 높아진 추세이다. 고수준의 프로그래밍 언어로 알려진 Python을 활용하여 연산처리를 작성할 수 있다<xref ref-type="bibr" rid="B012">[12]</xref>.</p>
<fig id="f002" orientation="portrait" position="float">
	<label>그림 2.</label>
	<caption>
		<title>텐서플로우</title>
		<p>Figure 2. Tensorflow</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f002.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
</sec>
</sec>
<sec id="sec003">
<title>3. 야구선수의 모형분석</title>
<p>야구선수의 투수 능력은 속구 스피드(Straight speed), 제구(Ball control), 집중력(Concentration)이 이를 결정한다. 특히 속구 스피드는 투수의 보폭과 몸통 회전량에 따라 다르다. 본 연구에서는 각 투수의 보폭을 측정하여 예측모델에 학습데이터(Training data)로 한다.</p>
<sec id="sec003-1">
<title>3.1 실험 방법</title>
<p>본 실험의 참여자는 P고등학교 야구부에서 운동하고 있는 투수 8명을 임의로 선택하여 속구 스피드 측정을 위한 실험을 하였다. 이들의 평균 나이는 17.4세이고, 평균 키는 177.4cm 그리고 평균 몸무게는 76.7kg이었다. 측정된 속구 스피드는 코치로 하여금 투수들의 운동량과 훈련재활에 도움을 주는 목적이 있음을 알려주었다. 아래 &lt;<xref ref-type="table" rid="t001">표 1</xref>&gt;는 투수의 보폭과 속구 스피드의 측정값을 나타낸다. 3회 측정하여 이중 최고 구속(종속)을 채택하였다.</p>
<table-wrap id="t001">
<label>표 1.</label>
<caption>
<title>투수의 신체적 특성값</title>
<p>Table 1. The physical characteristics of the pitcher</p>
</caption>
<table frame="box" rules="all" width="100%">
<tbody>
<tr align="center">
<td>선수</td>
<td>키
(cm)</td>
<td>몸무게
(kg)</td>
<td>보폭
(cm)</td>
<td>볼스피드
(km)</td>
</tr>
<tr align="center">
<td>1</td>
<td>183</td>
<td>83</td>
<td>162</td>
<td>134.5</td>
</tr>
<tr align="center">
<td>2</td>
<td>181</td>
<td>74</td>
<td>167</td>
<td>127.3</td>
</tr>
<tr align="center">
<td>3</td>
<td>173</td>
<td>76</td>
<td>163</td>
<td>125.7</td>
</tr>
<tr align="center">
<td>4</td>
<td>187</td>
<td>85</td>
<td>174</td>
<td>138.3</td>
</tr>
<tr align="center">
<td>5</td>
<td>184</td>
<td>79</td>
<td>171</td>
<td>127.4</td>
</tr>
<tr align="center">
<td>6</td>
<td>174</td>
<td>73</td>
<td>161</td>
<td>121.7</td>
</tr>
<tr align="center">
<td>7</td>
<td>178</td>
<td>74</td>
<td>166</td>
<td>132.8</td>
</tr>
<tr align="center">
<td>8</td>
<td>185</td>
<td>79</td>
<td>172</td>
<td>139.1</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="sec003-2">
<title>3.2 측정 요소</title>
<p>투수에게 있어 보폭(스트라이드)은 투구 스피드와 상관하여 매우 중요한 요인이다. 개인의 신장과 하체 길이, 투구 동작, 투구 형태에 따라 차이가 있지만 대략 스트라이드는 150cm∼175cm 이다. 보폭이 넓어질 경우 스피드 향상은 물론 제구(볼컨트롤)에도 도움을 준다.</p>
</sec>
</sec>
<sec id="sec004">
<title>4. 예측모델과 학습데이터</title>
<p>본 장에서는 고교야구 투수의 보폭과 관련되어 투구 스피드를 텐서플로우를 이용하여 예측모델을 산정한다. 먼저 학습데이터를 정하고 최소제곱법(Least squares method)을 이용하여 학습률(Learning rate)을 구한다<xref ref-type="bibr" rid="B013">[13]</xref>.</p>
<sec id="sec004-1">
<title>4.1 학습데이터</title>
<p>학습은 기본적으로 지도 학습(Supervised learning)과 비지도 학습(Unsupervised learning)으로 구분되며, 지도 학습은 이미 정해진 데이터를 사용하여 학습을 한다. 이 때 기초가 되는 데이터를 학습데이터라고 한다<xref ref-type="bibr" rid="B014">[14]</xref>. 본 연구에서는 첫 번째 변수 x로부터 두 번째 변수 y를 예측하려고 한다. 다음 &lt;<xref ref-type="table" rid="t002">표 2</xref>&gt;는 독립 변수와 종속 변수를 보여 준다.</p>
<table-wrap id="t002">
<label>표 2.</label>
<caption>
<title>독립변수와 종속변수</title>
<p>Table 2. Independent and dependent variables</p>
</caption>
<table frame="box" rules="all" width="100%">
<tbody>
<tr align="center">
<td>x(보폭)</td>
<td>y(볼 스피드)</td>
</tr>
<tr align="center">
<td>162</td>
<td>134.5</td>
</tr>
<tr align="center">
<td>167</td>
<td>127.3</td>
</tr>
<tr align="center">
<td>163</td>
<td>125.7</td>
</tr>
<tr align="center">
<td>174</td>
<td>138.3</td>
</tr>
<tr align="center">
<td>171</td>
<td>127.4</td>
</tr>
<tr align="center">
<td>161</td>
<td>121.7</td>
</tr>
<tr align="center">
<td>166</td>
<td>132.8</td>
</tr>
<tr align="center">
<td>172</td>
<td>139.1</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>여기에서 x 데이터는 보폭, y 데이터는 볼 스피드이다. 이러한 데이터를 학습데이터라고 한다. 위의 표를 그래프로 나타내면 다음 &lt;<xref ref-type="fig" rid="f003">그림 3</xref>&gt;과 같다.</p>
<fig id="f003" orientation="portrait" position="float">
	<label>그림 3.</label>
	<caption>
		<title>학습데이터(x:보폭, y:볼스피드)</title>
		<p>Figure 3. Training data(x:stride, y:ball speed)</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f003.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>보폭과 볼 스피드의 상관관계를 표현할 수 있는 하나의 직선을 만들어 보면 다음 &lt;<xref ref-type="fig" rid="f004">그림 4</xref>&gt;와 같다. Y = X 라는 직선함수를 그리면 좌표 평면에 위치하는 데이터를 볼 수 있다. 선형회귀 알고리즘의 목표는 학습데이터를 관통하는 하나의 직선을 찾아내는 것이다. 일단 Y = X 인 일차함수를 검색하면 이 함수를 이용하여 예측할 수 있다.</p>
<fig id="f004" orientation="portrait" position="float">
	<label>그림 4.</label>
	<caption>
		<title>선형회귀 일차함수</title>
		<p>Figure 4. Linear regression linear function</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f004.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
</sec>
<sec id="sec004-2">
<title>4.2 가설 방정식</title>
<p>4.1 절에서 언급한 보폭과 볼 스피드 학습데이터를 가지고 학습을 진행하면 하나의 직선 방정식이 표현된다.</p>
<table-wrap id="t003">
	<table width="100%">
	<tbody>
		<tr>
		<td align="center"><italic>H</italic>(<italic>x</italic>)=<italic>Wx</italic>+<italic>b</italic></td>
		</tr>
	</tbody>
	</table>
</table-wrap>
<p>이 방정식을 가설(Hypothesis)라고 한다. 선의 모양은 W(wight)와 b(bias)에 따라서 다르게 나타나며 어떤 그래프가 가장 정확한 값을 예측할 수 있을지 알아내는 방법이 중요하게 된다. W는 직선의 기울기가 되고, b는 y축을 지나는 y절편이 된다. 여기서 x값은 독립변수이고, y값은 종속변수이다. 즉, x값에 따라 y값은 반드시 다르게 된다. 다만, 이 방정식의 값을 정확하게 계산하려면 상수 W와 b의 값을 알아야 한다. 즉, 직선을 정확하게 표현하려면 직선의 기울기 a값과 y절편 b값을 정확히 예측해 내야 한다. 이러한 학습 데이터를 바탕으로 정확한 직선을 만들어 낸다면 투수의 보폭에 대한 볼 스피드를 예측할 수 있다.</p>
</sec>
<sec id="sec004-3">
<title>4.3 최소 제곱법</title>
<p>본 연구에서는 여러 개의 가설 중에서 가장 적합한 가설을 구하기 위하여 최소 제곱법을 이용한다. 즉, 가설과 학습데이터 사이에 오차가 크지 않다면 적합한 가설이 된다. 다음 &lt;<xref ref-type="fig" rid="f005">그림 5</xref>&gt;는 최소제곱법을 이용한 예이다.</p>
<fig id="f005" orientation="portrait" position="float">
	<label>그림 5.</label>
	<caption>
		<title>최소 제곱법</title>
		<p>Figure 5. Least squares method</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f005.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>H(x) - y가 실제 데이터와 가설로 나온 데이터 간의 차이가 된다. 이 데이터는 +, -값이 둘 다 나오기 때문에 제곱을 해준다.</p>
<table-wrap id="t004">
	<table width="100%">
	<tbody>
		<tr>
		<td align="center">(<italic>H</italic>(<italic>x</italic>)-<italic>y</italic>)<sup>2</sup></td>
		</tr>
	</tbody>
	</table>
</table-wrap>
<p>비용(cost)은 아래 수식과 같이 정의할 수 있다. m개의 학습데이터가 주어졌을 때, 각각의 학습데이터에서 그려진 직선이 예측한 값(H(x) = 보폭)과 실제 학습데이터에서의 값(y = 볼스피드)의 차이를 제곱한 값의 평균이다.</p>
<disp-formula-group>
	<disp-formula id="dm01">
<mml:math id="dm01-1"><mml:mi>c</mml:mi><mml:mi>o</mml:mi><mml:mi>s</mml:mi><mml:mi>t</mml:mi><mml:mfenced><mml:mrow><mml:mi>W</mml:mi><mml:mo>,</mml:mo><mml:mo>&#xA0;</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mi>m</mml:mi></mml:mfrac><mml:munderover><mml:mo>&#x2211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>m</mml:mi></mml:munderover><mml:msup><mml:mfenced><mml:mrow><mml:mi>H</mml:mi><mml:mfenced><mml:msup><mml:mi>x</mml:mi><mml:mfenced><mml:mi>i</mml:mi></mml:mfenced></mml:msup></mml:mfenced><mml:mo>-</mml:mo><mml:msup><mml:mi>y</mml:mi><mml:mfenced><mml:mi>i</mml:mi></mml:mfenced></mml:msup></mml:mrow></mml:mfenced><mml:mn>2</mml:mn></mml:msup></mml:math>
	</disp-formula>
</disp-formula-group>
<p>즉, 선형회귀 알고리즘은 이러한 학습데이터가 주어졌을 때, 비용값을 최소화하는 가설의 파라미터(W, b)를 찾는 알고리즘이다. 즉, cost를 가장 작게 만드는 W와 b를 구하는 것이 선형회귀분석의 목표가 된다. 이 때, 일반적으로 경사하강(Gradient descent) 알고리즘을 이용하여 최저값을 검색한다.</p>
</sec>
<sec id="sec004-4">
<title>4.4 경사 하강법</title>
<p>경사 하강법은 미분의 기울기를 이용하여 그래프의 차이를 비교한 후 가장 작은 방향으로 이동시키는 방법이다.</p>
<disp-formula-group>
	<disp-formula id="dm02">
<mml:math id="dm02-1"><mml:mi>c</mml:mi><mml:mi>o</mml:mi><mml:mi>s</mml:mi><mml:mi>t</mml:mi><mml:mfenced><mml:mi>W</mml:mi></mml:mfenced><mml:mo>=</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mrow><mml:mn>2</mml:mn><mml:mi>m</mml:mi></mml:mrow></mml:mfrac><mml:munderover><mml:mo>&#x2211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>m</mml:mi></mml:munderover><mml:msup><mml:mfenced><mml:mrow><mml:mi>W</mml:mi><mml:msup><mml:mi>x</mml:mi><mml:mfenced><mml:mi>i</mml:mi></mml:mfenced></mml:msup><mml:mo>-</mml:mo><mml:msup><mml:mi>y</mml:mi><mml:mfenced><mml:mi>i</mml:mi></mml:mfenced></mml:msup></mml:mrow></mml:mfenced><mml:mn>2</mml:mn></mml:msup></mml:math>
	</disp-formula>
	<disp-formula id="dm03">
<mml:math id="dm03-1"><mml:mi>W</mml:mi><mml:mo>&#xA0;</mml:mo><mml:mo>:</mml:mo><mml:mo>=</mml:mo><mml:mi>W</mml:mi><mml:mo>-</mml:mo><mml:mi>&#x3B1;</mml:mi><mml:mfrac><mml:mi>&#x2202;</mml:mi><mml:mrow><mml:mi>&#x2202;</mml:mi><mml:mi>W</mml:mi></mml:mrow></mml:mfrac><mml:mi>c</mml:mi><mml:mi>o</mml:mi><mml:mi>s</mml:mi><mml:mi>t</mml:mi><mml:mfenced><mml:mi>W</mml:mi></mml:mfenced></mml:math>
	</disp-formula>
</disp-formula-group>
<p>즉, 미분은 순간변화율을 의미하고 한 점에서의 기울기를 뜻한다. 임의의 점에서 미분을 구하면 그래프(가설)의 기울기를 알 수 있다. 여기서 구하고자 하는 값은 오차가 가장 작을 때의 기울기 0을 의미한다. 경사 하강법에서 미분 값이 0을 찾는 경우 기울기가 양수와 음수를 번갈아 반복됨으로 기울기의 부호를 바꿀 때 이동거리를 정해주는 것이 중요하다. 이를 학습률(learning rate)라고 한다.</p>
<fig id="f006" orientation="portrait" position="float">
	<label>그림 6.</label>
	<caption>
		<title>경사 하강법</title>
		<p>Figure 6. Gradient descent method</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f006.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
</sec>
</sec>
<sec id="sec005">
<title>5. 구현 및 실험결과</title>
<sec id="sec005-1">
<title>5.1 텐서플로우를 이용한 선형회귀분석</title>
<p>본 논문에서는 텐서플로우를 이용하여 y = W*x + b 형태의 단순한 선형회귀분석 모델을 작성한다<xref ref-type="bibr" rid="B015">[15]</xref>. 먼저 2차원 좌표계에 학습데이터를 생성하고 데이터에 맞는 최적의 직선을 텐서플로우를 이용하여 실행한다.</p>
<p>&lt;<xref ref-type="fig" rid="f007">그림 7</xref>&gt;에서는 투수의 측정한 학습 데이터를 이용하여 데이터셋(Data set)을 지정한다. 그 다음에 W값과 b값을 지정하여 학습을 위해 임의의 값을 할당한다. 텐서플로우에서는 가중치와 바이어스에 해당하는 변수를 Variable로 이용하여 나타낸다. 그리고 텐서플로우는 그 값을 자동으로 조절하여 주며 비용함수가 최소화가 되도록 가중치와 바이어스 값을 조정하게 된다.</p>
<fig id="f007" orientation="portrait" position="float">
	<label>그림 7.</label>
	<caption>
		<title>학습데이터 정의</title>
		<p>Figure 7. Definition of training data</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f007.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>다음 &lt;<xref ref-type="fig" rid="f008">그림 8</xref>&gt;에서 비용 함수(cost function)는 위와 같이 가설 데이터와 학습데이터의 뺀 값의 자승의 합을 구해 데이터의 개수만큼 나누도록 한다.</p>
<fig id="f008" orientation="portrait" position="float">
	<label>그림 8.</label>
	<caption>
		<title>가설과 비용함수</title>
		<p>Figure 8. Hypothesis and cost function</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f008.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>이를 위하여 텐서플로우의 tf.square() 함수와 tf.reduce_mean() 함수를 사용한다. 텐서플로우에서는 비용값을 최소화하기 위해 최적화 알고리즘인 경사 하강법을 활용한다. 여기에서는 학습도를 0.1로 하여 경사 하강법 알고리즘을 실행한다.</p>
<p>다음 &lt;<xref ref-type="fig" rid="f009">그림 9</xref>&gt;는 텐서플로우의 변수값을 초기화하기 위해 global_variables_initializer() 함수를 사용한다. 최종적으로 그래프가 구현한다. 본 연구에서는 최적화를 위하여 100번을 수행하여 학습을 진행한다.</p>
<fig id="f009" orientation="portrait" position="float">
	<label>그림 9.</label>
	<caption>
		<title>세션 생성과 최적화</title>
		<p>Figure 9. Session creation and optimization</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f009.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
</sec>
<sec id="sec005-2">
<title>5.2 실행 결과</title>
<p>선형회귀 학습을 실행하면 cost의 값이 점점 최소화되고 이에 따라 hypothesis의 W와 b의 값을 조정하게 된다. W와 b의 값에 무작위 데이터 값을 주게 되고, 아래의 학습모델로 봤을 때 W와 b가 수렴하는지 지켜보면 된다. 그 결과 값으로 각 열은 트레이닝 횟수, cost, W, b의 값을 나타낸다. 다음 &lt;<xref ref-type="fig" rid="f010">그림 10</xref>&gt;은 실행 결과를 나타낸다.</p>
<fig id="f010" orientation="portrait" position="float">
	<label>그림 10.</label>
	<caption>
		<title>실험 결과</title>
		<p>Figure 10. Experiment results</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f010.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>결과적으로 학습 데이터를 이용한 선형회귀분석을 통하여 한 투수의 보폭이 160cm인 경우 볼 스피드는 123.7km, 또 다른 투수의 보폭이 177cm인 경우 볼 스피드는 140.8km 로 예측할 수 있다.</p>
<fig id="f011" orientation="portrait" position="float">
	<label>그림 11.</label>
	<caption>
		<title>선형회귀분석을 통한 예측값 결과</title>
		<p>Figure 11. Linear regression analysis results</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f011.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>다음 &lt;<xref ref-type="fig" rid="f012">그림 12</xref>&gt;은 matplotlib 라이브러리를 이용하여 예측된 선형 방정식을 구한 후 그래프를 그려낸다. 빨간 점들은 학습데이터 점(x, y) 이고 그어진 직선은 선형회귀를 통해 구한 모델이다. 녹색점은 각각 X값이 1.60, 1.77일 경우 예측된 값을 나타낸다.</p>
<fig id="f012" orientation="portrait" position="float">
	<label>그림 12.</label>
	<caption>
		<title>matplotlib 라이브러리를 이용한 선형방정식</title>
		<p>Figure 12. Linear equation using matplotlib library</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f012.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
</sec>
</sec>
<sec id="sec006" sec-type="conclusions">
<title>6. 결 론</title>
<p>본 논문에서는 고등학교 투수의 속구 스피드를 예측하기 위한 선형회귀 분석기법을 연구하였다. 이를 위하여 딥러닝 프레임워크인 텐서플로우를 이용하며 예측모델을 구현하고 성능을 평가하였다. 야구 경기에서 투수의 투구 스피드는 경기의 승과 패를 나눌 수 있는 중요한 요소 중의 하나이다. 그중 투수의 보폭은 투구 스피드와 제구, 밸런스와 밀접한 관계가 있다. 본 연구에서는 투수의 보폭과 투구 스피드에 대한 학습데이터를 생성하고 최적화 알고리즘인 경사 하강법을 이용하여 선형회귀 예측모델을 수행하였다. 이를 통하여 고교야구 선수에 대한 훈련과 평가, 재활에 대해서 도움을 준다.</p>
</sec>
</body>
<back>
<ref-list>
<title>References</title>
<!-- [1] AlphaGo versus Lee Sedol, https://en.wikipedia.org/wiki/AlphaGo_versus_Lee_Sedol, May 2019.-->
<ref id="B001">
<label>[1]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2019</year>
<month>May</month>
<source>AlphaGo versus Lee Sedol, <uri>https://en.wikipedia.org/wiki/AlphaGo_versus_ Lee_Sedol</uri></source>
</element-citation>
</ref>
<!-- [2] J. Moore, The dartmouth college artificial intelligence conference: the next fifity years, AI Magazines, Vol. 27, No. 4, pp. 87-91, 2006.-->
<ref id="B002">
<label>[2]</label>
<element-citation publication-type="journal">
<person-group>
<name><surname>Moore</surname><given-names>J.</given-names></name>
</person-group>
<year>2006</year>
<article-title>The dartmouth college artificial intelligence conference: the next fifity years</article-title>
<source>AI Magazines</source>
<volume>27</volume><issue>4</issue>
<fpage>87</fpage><lpage>91</lpage>
</element-citation>
</ref>
<!-- [3] J. Nilsson, Introduction to machine learning, Robotics Laboratory, Department of Computer Science, Stanford University, CA, 1998.-->
<ref id="B003">
<label>[3]</label>
<element-citation publication-type="thesis">
<person-group>
<name><surname>Nilsson</surname><given-names>J.</given-names></name>
</person-group>
<year>1998</year>
<source>Introduction to machine learning</source>
<comment>Robotics Laboratory, Department of Computer Science</comment>
<publisher-loc>CA</publisher-loc>
<publisher-name>Stanford University</publisher-name>
</element-citation>
</ref>
<!-- [4] J-W. Kim, and S-H. Park, The effect of 6-week training program on knees to increase ball speed among collegiate baseball pitchers, Journal of The Korean Society of Sports Science, Vol. 20, No. 2. pp. 917-934, 2011.-->
<ref id="B004">
<label>[4]</label>
<element-citation publication-type="journal">
<person-group>
<name><surname>Kim</surname><given-names>J-W.</given-names></name>
<name><surname>Park</surname><given-names>S-H.</given-names></name>
</person-group>
<year>2011</year>
<article-title>The effect of 6-week training program on knees to increase ball speed among collegiate baseball pitchers</article-title>
<source>Journal of The Korean Society of Sports Science</source>
<volume>20</volume><issue>2</issue>
<fpage>917</fpage><lpage>934</lpage>
</element-citation>
</ref>
<!-- [5] Y-J. Lee, and J-T. Kim, The kinematic analysis of the pitching motion for the straight and curve ball, Journal of The Korean Society of Sports Biomechanics, Vol. 12, No. 2, pp. 109-130, 2002.-->
<ref id="B005">
<label>[5]</label>
<element-citation publication-type="journal">
<person-group>
<name><surname>Lee</surname><given-names>Y-J.</given-names></name>
<name><surname>Kim</surname><given-names>J-T.</given-names></name>
</person-group>
<year>2002</year>
<article-title>The kinematic analysis of the pitching motion for the straight and curve ball</article-title>
<source>Journal of The Korean Society of Sports Biomechanics</source>
<volume>12</volume><issue>2</issue>
<fpage>109</fpage><lpage>130</lpage>
</element-citation>
</ref>
<!-- [6] G. S. Fleisig, and R. F. Escamilla, Kinematic and kinetic comparison between baseball pitching and football passing, Journal of Applied Biomechanics, Vol. 12, No. 2, pp. 207-224, May 1996.-->
<ref id="B006">
<label>[6]</label>
<element-citation publication-type="journal">
<person-group>
<name><surname>Fleisig</surname><given-names>G. S.</given-names></name>
<name><surname>Escamilla</surname><given-names>R. F.</given-names></name>
</person-group>
<year>1996</year>
<month>May</month>
<article-title>Kinematic and kinetic comparison between baseball pitching and football passing</article-title>
<source>Journal of Applied Biomechanics</source>
<volume>12</volume><issue>2</issue>
<fpage>207</fpage><lpage>224</lpage>
<pub-id pub-id-type="doi">10.1123/jab.12.2.207</pub-id>
</element-citation>
</ref>
<!-- [7] R. Whiteley, Baseball throwing mechanics as they relate to pathology and performance - A review, Journal of Sports Science and Medicine, Vol. 6, pp. 1-20, 2007.-->
<ref id="B007">
<label>[7]</label>
<element-citation publication-type="journal">
<person-group>
<name><surname>Whiteley</surname><given-names>R.</given-names></name>
</person-group>
<year>2007</year>
<article-title>Baseball throwing mechanics as they relate to pathology and performance - A review</article-title>
<source>Journal of Sports Science and Medicine</source>
<volume>6</volume>
<fpage>1</fpage><lpage>20</lpage>
</element-citation>
</ref>
<!-- [8] D. W. Altchek, and W. R. Hobbs, Evaluation and management of shoulder instability in the elite overhead thrower, Journal of Orthopedic Clinics of North America, Vol. 32, pp. 423-430, 2001.-->
<ref id="B008">
<label>[8]</label>
<element-citation publication-type="journal">
<person-group>
<name><surname>Altchek</surname><given-names>D. W.</given-names></name>
<name><surname>Hobbs</surname><given-names>W. R.</given-names></name>
</person-group>
<year>2001</year>
<article-title>Evaluation and management of shoulder instability in the elite overhead thrower</article-title>
<source>Journal of Orthopedic Clinics of North America</source>
<volume>32</volume>
<fpage>423</fpage><lpage>430</lpage>
<pub-id pub-id-type="doi">10.1016/s0030-5898(05)70211-x</pub-id>
</element-citation>
</ref>
<!-- [9] Korea Baseball Softball Association, http://www.korea-baseball.com/, Jun. 2019.-->
<ref id="B009">
<label>[9]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2019</year>
<month>Jun.</month>
<source>Korea Baseball Softball Association, <uri>http://www.korea-baseball.com/</uri></source>
</element-citation>
</ref>
<!-- [10] C. J. Peng, K. L. Lee, and G. M. Ingersoll, An introduction to logistic regression analysis and reporting, The Journal of Educational Research, Vol. 96, No. 1. pp. 1-15, 2002.-->
<ref id="B010">
<label>[10]</label>
<element-citation publication-type="journal">
<person-group>
<name><surname>Peng</surname><given-names>C. J.</given-names></name>
<name><surname>Lee</surname><given-names>K. L.</given-names></name>
<name><surname>Ingersoll</surname><given-names>G. M.</given-names></name>
</person-group>
<year>2002</year>
<article-title>An introduction to logistic regression analysis and reporting</article-title>
<source>The Journal of Educational Research</source>
<volume>96</volume><issue>1</issue>
<fpage>1</fpage><lpage>15</lpage>
</element-citation>
</ref>
<!-- [11] Simple and Multiple Linear Regression in Python, https://towardsdatascience.com/simple-and-multiple-linear-regression-in-python-c928425168f9, May 2017.-->
<ref id="B011">
<label>[11]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2017</year>
<month>May</month>
<source>Simple and Multiple Linear Regression in Python,  <uri>https://towardsdatascience.com/simple-and-multiple-linear-regression-in-python-c928425168f9</uri></source>
</element-citation>
</ref>
<!-- [12] Tesorflow Tutorials, https://gist.github.com/haje01/202ac276bace4b25dd3f, Jun. 2018.-->
<ref id="B012">
<label>[12]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2018</year>
<month>Jun.</month>
<source>Tesorflow Tutorials, <uri>https://gist.github.com/haje01/202ac276bace4b25dd3f</uri></source>
</element-citation>
</ref>
<!-- [13] S. J. Miller, The method of least squares, Mathematics Department, Brown University, Rhode Island, 2006.-->
<ref id="B013">
<label>[13]</label>
<element-citation publication-type="thesis">
<person-group>
<name><surname>Miller</surname><given-names>S. J.</given-names></name>
</person-group>
<year>2006</year>
<article-title></article-title>
<source>The method of least squares</source>
<comment>Mathematics Department</comment>
<publisher-loc>Rhode Island</publisher-loc>
<publisher-name>Brown University</publisher-name>
</element-citation>
</ref>
<!-- [14] J. Dougherty, R. Kohavi, and M. Sahami, Supervised and unsupervised discretization of continuous features, Proceeding of the Twelfth International Conference on Machine Learning, pp. 194-202, 1995.-->
<ref id="B014">
<label>[14]</label>
<element-citation publication-type="paper">
<person-group>
<name><surname>Dougherty</surname><given-names>J.</given-names></name>
<name><surname>Kohavi</surname><given-names>R.</given-names></name>
<name><surname>Sahami</surname><given-names>M.</given-names></name>
</person-group>
<year>1995</year>
<article-title>Supervised and unsupervised discretization of continuous features</article-title>
<conf-name>Proceeding of the Twelfth International Conference on Machine Learning</conf-name>
<fpage>194</fpage><lpage>202</lpage>
<pub-id pub-id-type="doi">10.1016/b978-1-55860-377-6.50032-3</pub-id>
</element-citation>
</ref>
<!-- [15] Tensorflow, https://www.tensorflow.org/, Jun. 2019.-->
<ref id="B015">
<label>[15]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2019</year>
<month>Jun.</month>
<source>Tensorflow, <uri>https://www.tensorflow.org/</uri></source>
</element-citation>
</ref>
</ref-list>
<ack>
<title>감사의 글</title>
<p>본 논문은 2019년 나사렛대학교 학술연구비 지원에 의해 연구되었음</p>
</ack> 
<bio>
	<p><graphic xlink:href="../ingestImageView?artiId=ART002496996&amp;imageName=jkits_2019_14_04_381_f013.jpg"></graphic><bold>Young Hwan Oh</bold> received the bachelor’s degree in the Department of Computer Engineering from the Inha University in 1991. He received the M.S. degree and the Ph.D. degree in the Department of Computer Science and Engineering from Inha University in 1997 and 2001, respectively. From 1992 to 1994, he was a researcher at Korea Power Corporation. He has been a professor in the Department of Information and Communication at Korea Nazarene University since 2002. His current research interests include artificial intelligence, big data, database system. He is a member of the KKITS.</p>
<p><italic>E-mail address</italic>: <email>yhoh@kornu.ac.kr</email></p>
</bio>
</back>
</article>
