I was given a dataset containing information on Student Academics and was asked to perform 5 machine learning algorithms.
from sklearn.ensemble import RandomForestRegressor
random_forest = RandomForestRegressor(n_estimators=100, random_state=0)
random_forest.fit(X_train, y_train)
try:
Y_prediction = random_forest.predict(X_test)
random_forest.score(X_train, y_train)
acc_random_forest = round(random_forest.score(X_train, y_train) * 100, 2)
print(acc_random_forest)
except ValueError
pass
I keep getting ValueError: could not convert string to float 'Enrolled'