728x90
반응형
1. Selecting Data for Modeling
data = pd.read_csv( filename )
data.columns
data = data.dropna(axis=0)
- Selecting The Prediction Target:
- Dot-notation: 필요한 column 추출
- prediction target(y)
y = data.Price
2. Choosing "Features" (X)
data_features = ['Rooms', 'Bathroom', 'Landsize', 'Lattitude', 'Longtitude']
X = data[data_features]
3. Building My Model
- Define: model의 타입은?( 결정트리? 다른 거?)
- Fit: data의 패턴을 포착해라
- predict
- evaluate
from sklearn.tree imoprt DecisionTreeRegressor
data_model = DecisionTreeRegressor(random_state=1)
data_model.fit(X,y)
# data_model.predict(X.head())
# data_model.predict(X)
728x90
반응형
'Machine Learning > [Kaggle Course] ML (+ 딥러닝, 컴퓨터비전)' 카테고리의 다른 글
Random Forest (0) | 2020.09.28 |
---|---|
[Kaggle Courses] UnderFitting vs OverFitting (0) | 2020.09.27 |
[Kaggle Courses] What is Model Validation (Evaluating) (0) | 2020.09.26 |
[Kaggle Courses] Basic Data Exploration - Ex.MelbourneHomePrice (0) | 2020.09.22 |
[Kaggle Courses] How Models Works (0) | 2020.09.22 |