text_html_output_1.png
from sklearn.ensemble import RandomForestRegressor

import numpy as np

import pandas as pd

import pandas as pd
features = pd.read_csv('../input/tempscsv/temps.csv')

features = pd.get_dummies(features)

import numpy as np
labels = np.array(features['actual'])
features = features.drop('actual', axis=1)
feature_list = list(features.columns)
features = np.array(features)

from sklearn.ensemble import RandomForestRegressor
rf = RandomForestRegressor(n_estimators=1000, random_state=42)
rf.fit(train_features, train_labels)

predictions = rf.predict(test_features)
errors = abs(predictions - test_labels)

mape = 100 * (errors / test_labels)
accuracy = 100 - np.mean(mape)
print('Accuracy:', round(accuracy, 2), '%.')