분류 전체보기 33

파마 인디언 당뇨병 예측

#피처 데이터 세트 x,레이블 데이터 세트y를 추출 #맨끝이 outcome컬럼으로 레이블 값임. 컬럼 위치-1을 이용해 추출 y=diabetes_data['Outcome']#X=diabetes_data.iloc[:,-1]도 가능함;; X=diabetes_data.loc[:,(diabetes_data.columns!='Outcome')]#Y=diabetes_data.iloc[:,:-1] #학습용 피쳐 데이터 셋, 테스트용 피쳐 데이터 셋 , 학습용 타겟 데이터 셋, 테스트용 타겟 데이터 셋 X_train,X_test,y_train,y_test= train_test_split(X,y,test_size=0.2,random_state=156,stratify=y) # 로지스틱 회귀로 학습,예측 및 평가 수행. l..

프로젝트,실습 2024.01.06

백준 1000번

답 a, b = map(int, input().split()) print(a+b) ​ 쓰인 함수 정리 # map(함수명, 리스트 이름) : 리스트 값 하나하나를 함수명에 대입 문자열로 이루어진 리스트를 숫자로 변환하기 위해 BEFORE = ['2019' , '12' , '31'] AFTER = list ( map ( int,BEFORE)) AFTER [2019, 12, 31] ▶️ int () 함수의 이름을 map() 함수의 매개변수로 사용 = [int('2019'), int( '12') , int('31')] 와 같은 효과를 갖게 됨. 결과값을 다시 list () 함수를 사용해서 리스트 형태로 변환 2.split() : 문자열을 공백이나 다른 문자로 분리해서 리스트를 반환 +splitlines() : ..

chapter 4 orthogonality(수직)

4.1 projections the Gram-Schmidt orthogonalization procedure to obtain an orthogonal basis v, w ∈ Rn. Then the vector p in sp({w}) that is closest to v,, sp({w}) 에 포함된 벡터 p는 v와 제일 가깝다. vector p : the projection of v onto the subspace sp({w}) v = p + v − p and v − p ∈ sp({w})⊥ the decomposition v = p + v − p is unique the concept of projection onto a linear span of a vector to the general subspac..

chapter 2.3 Properties of Linear Transformations

2.3 Properties of Linear Transformations 1) Counterclockwise rotation T : R2 -> R2 는 a mapping which rotates a vector in the plane counterclockwisely by an angle θ 그러면 T는 linear transformation 이다. rotations T(v1) and T(v2) of two vectors v1 and v2은 길이와 두 벡터들의 각도를 보존한다. 그러므로 the rotations of tow vectors preserve the inner product, i.e., =. 그러므로 T(v1 + v2) = T(v1) + T(v2),T(rv) = rT (v)라 볼 수 있고 T는..

chapter 2.2 Rank and Nullity of a Matrix and a Linear Transformation

chapter 2.2 Rank and Nullity of a Matrix and a Linear Transformation three subspaces of Euclidean spaces associated with an m x n matrix: row space, column space and null space of the matrix ->이 세 개의 부분공간에 대한 관계를 알아보자. 그리고 A is an m x n matrix이고 linear transformation T(x) = Ax of Rn into Rm의 선형 변환이 존재. # null space of A/ column space of A/ dimension of he null space of A/ dimension of the range ..

chapter2.1 linear transformation and matrices

chapter 2.1 Linear Transformations of Euclidean Spaces(선형변환함수) linear system of the form Ax = b with an m x n matrix A ->we could regard Ax as a function and view Ax = b as meaning that the function maps the vector x to the vector b. => f(x) = Ax with an m x n matrix A the domain(정의역) of this function should be a subset of Rn, the codomain(공역) be a subset of Rm f(av1 + bv2) = (av1 + bv2) = aAv1 ..

요인 분석 실습(1)

#요소분석 실행 #주축 요소분석 (principal axis), 회전(varimax) 이용한 factor loading 값 factorloading은 변수와 factor 간의 상관관계를 나타냄,상관관계가 가장 높은 곳에 그변수가 facotor에 묶이는것 ->3번째factor는 분위기로 볼 수 잇음 접근성은 1번쨰 factor로 볼 수 잇 ->편의성1은 날라감,가장 높은 factor loading값이 0.5가 안된다. #1번 foctor는 접근성, 2번 factor는 편의성, 3번 factor는 분위기, 4번factor는 친절도 라고 이름을 붙임 #factor요인명은 요인분석을 돌리고 나서 붙이는 것 #4갸의 factor가 사용한 분산은 62.3%이다. 약 40%를 버림-> 요소 분석의 단점 #correl..

요인 분석의 기초- PAF(요인분석)

출처 ; https://youtu.be/n3Sb6lQihPA?si=JQgscbUpi6TNw-XY #상관관계 행렬은 분산 공분산 행렬을 표준화 한 것이므로 상관관계 행렬로 시작해도댐! -> 상관관계 행렬이 매우 중요!! #우리가 갖은 지표 점수(국어, 영어)를 종속 변수로 하고 나머지 지표 변수를 통해 유추 #SSE는 unique variance와 비슷하다고 본다. r스퀘어는 common variance와 비슷하다고 본다. #분산을 r스퀘어로 대체 하는게 가능할까? 회귀분석과 비슷 하다고 본다. #언어 능력은 변수로서 데이터로서 존재하지 않음 , 우리가 가진 지표 변수를 이용하여 한개의 지표 변수를 종속 변수로 하고 나머지 모든 변수를 없지만, 보이지 않지만 언어능력이라는 개념으로 보고 전부다 독립 변수로..

차원축소와 요인 분석-PCA(주성분 분석)

출처: https://youtu.be/TesmO5Sq1YQ?si=WJ7kXEQYR746BJLF 차원축소( demension reduction) #차원 축소-변수를 줄이는 것 #변수를 줄여야 하는 이유 -변수가 너무 많은 경우 이를 다 사용하는 것은 불가능 혹은 불필요 -가능성은 낮으나 변수의 개수가 관찰값의 개수보다 많으면 분석이 거의 불가능 -너무 많은 변수의 사용은 불필요하거나 효율적이지 않음 #차원 축소를 어떻게 할 것인가 -상관관계가 중요(=상관관계가 높은 변수들을 묶어보자) -더 정확하게는 variance-covariance matrix(공분산행렬)을 이용 -covariance matrix는 correlation matrix(상관관계)와 유사 -말 그대로 “co”는 함께(together)의 의미..