all. Currently I am working in a regressor to predict the median house value using 1990 census as a dataset (the same on Aurélien Géron used on his book).
My best result so far has been a score of ~0.96 for the training set and ~0.80 and for the test set with a bagging regressor. Here's how I had been doing:
precisao_treino = clf.score(dados_treino_feat,dados_treino_targ) #training score precisao_valid = clf.score(dados_valid_feat,dados_valid_targ) #test score (0.9698880465469455, 0.8087685894971024)
But here is where I get confused. That very high training score indicate that there is a potential overfit on my model. However, the test score is maintained a relative good score. So I don't know if my model is overfitting or if doing well at predicting. Could someone explain to me whether this a bad or good model?
Here's how my final dataset looks like, with one-hot-encoding:
['longitude', 'latitude', 'housing_median_age', 'total_rooms', 'total_bedrooms', 'population', 'households', 'median_income', 'median_house_value', '<1H OCEAN', 'INLAND', 'ISLAND', 'NEAR BAY', 'NEAR OCEAN']
My solution to removing outliers:
df = df[(np.abs(zscore(df)) < 6).all(axis=1)]
clf = ensemble.BaggingRegressor(n_estimators=20)