RabbitRedux / models /model.py
Canstralian's picture
Create models/model.py
588124b verified
raw
history blame contribute delete
421 Bytes
from sklearn.ensemble import RandomForestClassifier
def train_model(X_train, y_train):
"""
Train a Random Forest Classifier.
Args:
X_train (pd.DataFrame): Training features.
y_train (pd.Series): Training labels.
Returns:
model: Trained Random Forest model.
"""
model = RandomForestClassifier(random_state=42)
model.fit(X_train, y_train)
return model