Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- mysql
- 외부접속허용
- D2E8DA72
- 오류
- 아나콘다
- split
- 파이썬
- 에러
- putty
- SQL
- TabPy
- safe mode 해제
- 살려줘
- 전처리
- 정제
- 북마크
- random.uniform
- Delete
- 이전날짜제거
- vlookup
- 맵차트
- Tableau
- 함수
- 데이터전처리
- 태블로퍼블릭
- concat
- 태블로
- Join
- Def
- trim
Archives
- Today
- Total
무던히 하다보면 느는
[파이썬/Python] 파이프라인 본문
X_features = df.iloc[:,:-1]
y_target = df.iloc[:,-1]
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X_features, y_target, test_size=0.3, random_state=1, stratify=y_target)
scaler = MinMaxScaler()
base_model = SVC(random_state=1)
pipe = Pipeline([('scaler',scaler),
('base_model',base_model)])
# 그리드 서치
from sklearn.model_selection import KFold, GridSearchCV
kfold=KFold(n_splits=3,shuffle=True,random_state=1)
param_grid = {'base_model__C':[0.03,0.05,10],
'base_model__gamma':[0.03,0.05,10],
'base_model__degree':[1,2,3,4,5,6,7,8,9,10]}
pipe = Pipeline([('scaler',scaler),
('base_model',base_model)])
grid_model=GridSearchCV(estimator=pipe,
param_grid=param_grid,
cv=kfold,
#iid=True,
n_jobs=-1).fit(X_train,y_train)
'파이썬' 카테고리의 다른 글
[파이썬/Python] (0) | 2022.07.12 |
---|---|
[파이썬/Python] 파이프라인(2) (2) | 2022.07.12 |
[파이썬/Python] 리샘플링 (Resampling) (0) | 2022.07.10 |
[파이썬/Python] numpy array와 list 차이점 (0) | 2022.07.10 |
[파이썬/Python] 여러개의 데이터프레임 concat으로 결합 (0) | 2022.06.21 |