from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split target = 'START_POSITION' features = ['FG3A', 'REB', 'BLK'] slim_df = df[features + [target]].dropna() X = slim_df.drop(target, axis=1) y = slim_df[target] X_train, X_test, y_train, y_test = train_test_split(X, y) position_classifier = RandomForestClassifier() position_classifier.fit(X_train, y_train)
Hosted onDeepnote