fork download
  1.  
Success #stdin #stdout 0.03s 63100KB
stdin
df=pd.read_csv('train.csv')

X = df.iloc[:, :-1]
y = df.iloc[:, -1]

my_model = RandomForestClassifier(n_estimators=100, random_state=0)
my_model.fit(X, y)
df1=pd.read_csv('test.csv')
x_test= df1.iloc[:, :-1]
y_test = df1.iloc[:, -1]

    
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_absolute_error


rd_preds =my_model.predict(x_test)
mae = mean_absolute_error(y_test, rd_preds)
print("Mean Absolute Error:", mae)
stdout
Standard output is empty