노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.
확률형 아이템

몇가지 상품이 나오게 되어 있고, 각 상품이 나올 확률은 내부적으로 정해져 있다.


binominal distribution

이것은 그 결과가 불확실하므로 일정의 trial이다. 결과가 2개가 아니라, 이항분포로
설명할 수 없지만, 원하는 아이템 단 한가지라면, 성공과 실패로 단순화 할 수 있다.

A(0.1%) ~ I(30.0%)에서 플레이어가 원하는 아이템은 A고, 0.1%의 획득 확률로
얻으면 성공이고 아니면 실패라고 정의하면, 0.1% Bernoulli trial이다.

단순하게, 이항분포로 보면, 아이템A가 나올 확률이 0.1%이고, 확률형 아이템 1,000개를 구매했을떄,
아이템 A가 1개 나올 확률은 

R>dbinom(1, 1000, .001)
[1] 0.3680635

약 36%다. 확률 계산은 R을 이용한다.


원문 자료

확률형 아이템을 위한 다항 분포 ,   http://www.boxnwhis.kr/2015/06/04/multinomial_dist_for_gachas.html


블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.



KUKA KR210.URDF에서 DH parameter 추출하기



1. Forward Kinematics에서 정의된 URDF파일의 Δ값을 확인후에


2. 실제 변화된 Difference값을 찾기 


1) Twist Angles -> alpha0 ~ 6

2) Link Offsets -> d1 ~ d7

3) Link Lengths -> a0 ~ a6

4) Joint Angles -> theta1 ~ theta7

 

* 파란색의 a1,a2, a3, d1, d4, d7가 중요



<그림>



블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

100대 국정 과제에서 발견된 문서 오류?



이런 문장의 중복 요소들의 오류를 AI나 머신러닝으로 찾을 수 있을까?




1. 사이트 :


http://www1.president.go.kr/news/newsList4.php?srh%5Bview_mode%5D=detail&srh%5Bseq%5D=822#none



2. 사이트 스크린 샷



3. 문서 내용에서 중복 증상을 보이는 번호들 :

첨 부 국민인수위원회 국민정책제안 국정과제 반영 현황

- 10, 50 

- 91, 92 (유사)

- 14, 76

- 30, 62

- 18, 48

- 5, 82

- 45, 54 (유사)

- 44, 52

- 7, 29

- 28, 53

- 85, 96(유사)


국정운영_5개년_계획_170719-1.pdf


중복 예)


블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.


Tangent 기울기







* delta x = cos(theta)

* delta y = sin(theta)


블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.



RStudio로 Kospi지수 csv를 그래프(plot) 만들기



1. CSV Import

: Kospi지수를 아래 링크에서 다운로드후에 kospi.csv로 저장
( 자료 내용은 편집해서 날짜와 최종 지수와 최저 지수만 남겼다 )
 
: Import Dataset를 통해 로드한다.
( 옵션 : Delimeter-Comma, First Row as Names , Name - kospi )

: 로드되면, kospi라는 data에 할당 된다. (왼쪽 상단 )


2. 날짜열을 rdate로 지정하기

: 함수 As.Date() , https://www.r-bloggers.com/as-date-exercises/

> rdate <- as.Date(kospi$Date,"%yyyy-%m-%d")

: kospi변수내의 컬럼head를 지정하고, 포맷을 정의한다.



3. Plot 'Current Index'  

>plot(kospi$`Current Index`~rdate,type="l",col="red",axes=F)
: kospi변수내의 'Current Index'를 y축, rdate는 x축
: type="l", col="red", x-y축 Line없이 그리기  

: 그래프 외곽선 추가  - box()

: x축에 날짜 표시 하기

- axis(1, rdate, format(rdate,'%m/%d')


: 원본 Data 및 그래프

https://global.krx.co.kr/contents/GLB/05/0502/0502030101/GLB0502030101.jsp?idxCd=1001&addDataYn=&globalYn=#1be3686ec5cb98595cf6179ba66d7a8b=2


참고 자료

R시계열 분석

R Programming: Plotting time-series data (using data.frame)

코스피지수 예측 모델 개발 1편

코스피지수 다운로드


블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.



프로그래밍 R언어, 통합 개발 환경 설치

- OS : Windows 10


1. R 설치

- R Project for Statistical Computing ( r-project.org )

- Korea

-- http://cran.nexr.com/ 

-- http://healthstat.snu.ac.kr/CRAN/

-- http://cran.biodisk.org/

- 설치후 바탕화면의 RGui실행


2. R studio 설치

- R Studio ( rstudio.com )

- Download Free , https://www.rstudio.com/products/rstudio/download/

- 실행 화면

- File -> New File : Script.R (Save)


3. R언어 강좌 ( 따라하기 )

- Free Course , https://www.datacamp.com/courses/free-introduction-to-r


- Intro to basics

> # An addition
> 5 + 5
[1] 10


> # Assign the value 42 to x
> x <- 42
> 
> # Print out the value of the variable x
> x
[1] 42


> # Declare variables of different types
> my_numeric <- 42
>
> # Check class of my_numeric
> class(my_numeric)
[1] "numeric"


-Vectors

# create a vector with the combine function c()
> numeric_vector <- c(1, 10, 49)
> 
> numeric_vector
[1]  1 10 49


> # Roulette winnings from Monday to Friday
> roulette_vector <- c(-24, -50, 100, -350, 10)
> 
> poker_vector
[1]  140  -50   20 -120  240
>
> # Assign days as names of poker_vector
> names(poker_vector) <- c("Monday", "Tuesday", "Wednesday", "Thursday", "Friday")
> 
> poker_vector
   Monday   Tuesday Wednesday  Thursday    Friday 
      140       -50        20      -120       240


> A_vector <- c(1, 2, 3)
> B_vector <- c(4, 5, 6)
> 
> # Take the sum of A_vector and B_vector
> total_vector <- A_vector + B_vector
> 
> # Print out total_vector
> total_vector
[1] 5 7 9
> 
> # Total of A_vector
> total <- sum(A_vector)
> total
[1] 6
> 
> # Define a new variable based on a selection
> selection_vector <- B_vector[c(1:2)]
> selection_vector
[1] 4 5
> 
> # Calculate the average
> mean(A_vector)
[1] 2


-Matrics

> # Construct a matrix with 3 rows that contain the numbers 1 up to 9
> matrix(1:9, byrow=TRUE, nrow=3)
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    4    5    6
[3,]    7    8    9


> # Box office Star Wars (in millions!)
> new_hope <- c(460.998, 314.4)
> empire_strikes <- c(290.475, 247.900)
> return_jedi <- c(309.306, 165.8)
> 
> # Create box_office
> box_office <- c( new_hope, empire_strikes, return_jedi )
> 
> # Construct star_wars_matrix
> star_wars_matrix <- matrix( box_office, byrow=TRUE, nrow =3)
> # Box office Star Wars (in millions!)
> new_hope <- c(460.998, 314.4)
> empire_strikes <- c(290.475, 247.900)
> return_jedi <- c(309.306, 165.8)
> 
> # Create box_office
> box_office <- c( new_hope, empire_strikes, return_jedi )
> 
> # Construct star_wars_matrix
> star_wars_matrix <- matrix( box_office, byrow=TRUE, nrow =3)
> star_wars_matrix
        [,1]  [,2]
[1,] 460.998 314.4
[2,] 290.475 247.9
[3,] 309.306 165.8


> # Box office Star Wars (in millions!)
> new_hope <- c(460.998, 314.4)
> empire_strikes <- c(290.475, 247.900)
> return_jedi <- c(309.306, 165.8)
> 
> # Construct matrix
> star_wars_matrix <- matrix(c(new_hope, empire_strikes, return_jedi), nrow = 3, byrow = TRUE)
> star_wars_matrix
        [,1]  [,2]
[1,] 460.998 314.4
[2,] 290.475 247.9
[3,] 309.306 165.8
> 
> # Vectors region and titles, used for naming
> region <- c("US", "non-US")
> titles <- c("A New Hope", "The Empire Strikes Back", "Return of the Jedi")
> 
> # Name the columns with region
> colnames(star_wars_matrix) <- region
> star_wars_matrix
          US non-US
[1,] 460.998  314.4
[2,] 290.475  247.9
[3,] 309.306  165.8
> 
> # Name the rows with titles
> rownames(star_wars_matrix) <- titles
> 
> # Print out star_wars_matrix
> star_wars_matrix
                             US non-US
A New Hope              460.998  314.4
The Empire Strikes Back 290.475  247.9
Return of the Jedi      309.306  165.8





* R언어 사용 사례
- 16개월 간의 몸무게 변화 그래프,  http://printhelloworld.tistory.com/88



* 참조




블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.


Hello World를 Perl로 작성하기


1. 설치된 perl 위치 찾기

$ which perl
/usr/bin/perl


2. hello.pl 작성하기

#!/usr/bin/perl # 위치, Full Path # hello.pl # perl program name print "Hello World\n";

* #는 주석문 , ;(semi colon)는 명령문장의 끝


3. hello.pl 실행하기

$ ./hello.pl
Hello World
$ perl hello.pl
Hello World



* Perl은
Larry Wall이 만든 Practical Extraction and Report Language라는 언어로 문서 형태의 데이터로 부터 필요한 정보들을 추출(Extraction), 그 정보를 바탕으로 새로운 문서를 구성(Report)하는데 아주 잘 맞는 언어입니다.  http://www.perl.or.kr/perl_iyagi/intro



변수 $(일반변수) 


1. 작성하기
#!/usr/bin/perl
# hello.pl

$price=1000;
print "$price\n";

$price="1000" * 2;
print "$price\n";

print "Hello World\n";

$price="Very expensive.";
print "$price\n";

* 모든 숫자는 실수형( 정수형이 아니라)으로 저장 , 문자열로 재할당도 가능

2. 실행하기
$ ./hello.pl
1000
2000
Hello World
Very expensive.


블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.


머신러닝, 게임 지표 분석 따라하기


머신러닝 피드백을 이용한 게임 지표 분석(https://goo.gl/6MQUbe)에서 참조한 Discovering Ketosis : how to effectively lose weight(https://github.com/arielf/weight-loss)를 따라 해 보기




"Ariel이 Github에 올린 머신러닝을 이용한 다이어트 방법은 얼마 전 해커 뉴스에 소개되면서 주목받았는데 발상의 전환이라 할 만 하다. 매번 식사를 하거나 운동을 할 때 칼로리를 신경쓰지 않고 그 날 자신이 한 행동 중 체중에 영향을 주었다고 생각하는 것들을 기록한다. 그리고 이렇게 일정량 쌓인 데이타를 일부 가공해 vowpal-wabbit에 쓸 수 있는 트레이닝셋을 만든 뒤 이를 이용해 훈련시킨 손실함수 계산으로 어떤 행동이 체중의 변화에 어떻게 기여하는지를 귀납적으로 추론한 것이다."


"개별 아이템의 가격이나 밸런스 조정에서 각 스킬의 수치 조정 부분은 사실상 이해 할 수 없는 블랙박스다"

"머신러닝을 이용하여 이 개별 수치 X를 조사하여 어떤 아이템이 매출의 증대에 도움이 되었고 어떤 것이 오히려 마이너스인지 분류하는 방법을 도입한다면 개별 수정사항이나 추가 아이템에 대한 객관적 평가가 가능해지고 매출이나 유저 만족도 평가를 더 개선하는 방향으로 이후 계획을 세우기 더 쉬워지지 않을까."



1. git clone하기


$ git clone https://github.com/arielf/weight-loss


- git clone해서 make 실행( 이에 대한 설명은 HOWTO.md를 참조 할 것 )



- make sc는 스코어에 관한 차트를 만들어 준다.

* 그래프는 위아래가 바뀌어서 나오네요.


- make시에 주의할 점은 ariel.csv를 계정명.csv로 변경해주면 됩니다.

    ( ariel.csv : vowpal-wabbit용 스크립트에 필요한 훈련용 데이터셋 )


* Vowpal Wabbit ( VW) project

is a fast out-of-core learning system sponsored by Microsoft Research and (previously) Yahoo! Research.




2. 게임 지표 분석 따라하기


1) 매출 엑셀 작성

* 동일하게 작성하고, date_iid_price_purchases_users.csv로 저장


2) perl 스크립터 작성

* 위의 코드는 convert.perl로 일단 저장


3) 변환 시키기


$ ./convert.perl date_iid_price_purchase_users.csv > data.csv

* data.csv는 위의 ariel.csv와 같이 계정명.csv로 변환해서 사용

* date_iid_price_purchases_users.csv는 샘플의 1일치보다 많게 작성할 것

* 위의 결과 화면은 화면상에 보이는 예제 엑셀만을 변환한 결과이며, 실제로 많은 데이타를
변환한다면, 좀 더 복잡한 결과가 나온다. 1줄의 길이가 터미널 전체가 될 수도 있다.


3. game-sales-item 데이타를 weight-loss에 적용하기


상위 data.csv에 2번째 column부분에 daily total sales를 추가 후에

$ cp data.csv vagrant.csv  // 계정명.csv
$ make
$ make sc

* 최종적으로 일자별로 총매출을 2번째 컬럼에 추가하면, ariel.csv와 유사 해 진다.

* 아래 data는 자세히 보이지 않지만, 의미적으로 이해하기에는 충분

* 결과 : Weight Gain ( Sales Gain ), Weight Loss ( Sales Loss )



* 16개월 간의 몸무게 변화 그래프

    - requires : R and ggplot2
    - script : date-weight.r  ( 10분만에 살펴보는 R 기초 문법, http://dev.epiloum.net/1546 )
    - data-set : weight.2015.csv





블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,