plt.subplot(1, 2, 2) plt.barh(pos, feature_importance[sorted_idx], align='center') plt.yticks(pos, header[sorted_idx]) # boston.feature_names[sorted_idx]) plt.xlabel('Relative Importance') plt.title('Variable Importance') plt.show(block=False) return header[sorted_idx], feature_importance[sorted_idx] csvfile = 'rentList_All_final.csv' # adding attributes did not make a difference #csvfile = 'rentList_All_withAllAttr_trimmed.csv' #csvfile = 'rentList_E_EC_N_final.csv' data = readCsvIntoPandasDataframe(csvfile) X, y, X_scaler, y_scaler, header = preprocessData(data) #print "header type:" #print type(header).__name__ #print header #X, y = preprocessDataWithoutScale(data) joblib.dump(X_scaler, 'pickle/X_scaler.pkl') joblib.dump(y_scaler, 'pickle/y_scaler.pkl') estimators = [] # K-Nearest Neighbors estimators.append({ "name": "KNN",
plt.subplot(1, 2, 2) plt.barh(pos, feature_importance[sorted_idx], align='center') plt.yticks(pos, header[sorted_idx]) # boston.feature_names[sorted_idx]) plt.xlabel('Relative Importance') plt.title('Variable Importance') plt.show(block=False) return header[sorted_idx], feature_importance[sorted_idx] csvfile = 'HousePriceList_All_Train.csv' # adding attributes did not make a difference #csvfile = 'rentList_All_withAllAttr_trimmed.csv' #csvfile = 'rentList_E_EC_N_final.csv' data = readCsvIntoPandasDataframe(csvfile) X, y, X_scaler, y_scaler, header, imp, vec = preprocessData(data) #print "header type:" #print type(header).__name__ #print header #X, y = preprocessDataWithoutScale(data) joblib.dump(X_scaler, 'pickle-house/X_scaler.pkl') joblib.dump(y_scaler, 'pickle-house/y_scaler.pkl') joblib.dump(imp, 'pickle-house/Imputer.pkl') joblib.dump(vec, 'pickle-house/Vector.pkl') estimators = [] # K-Nearest Neighbors
plt.subplot(1, 2, 2) plt.barh(pos, feature_importance[sorted_idx], align='center') plt.yticks(pos, header[sorted_idx]) # boston.feature_names[sorted_idx]) plt.xlabel('Relative Importance') plt.title('Variable Importance') plt.show(block=False) return header[sorted_idx], feature_importance[sorted_idx] csvfile = 'rentList_All_final.csv' # adding attributes did not make a difference #csvfile = 'rentList_All_withAllAttr_trimmed.csv' #csvfile = 'rentList_E_EC_N_final.csv' data = readCsvIntoPandasDataframe(csvfile) X, y, X_scaler, y_scaler, header, imp, vec = preprocessData(data) #print "header type:" #print type(header).__name__ #print header #X, y = preprocessDataWithoutScale(data) joblib.dump(X_scaler, 'pickle-final/X_scaler.pkl') joblib.dump(y_scaler, 'pickle-final/y_scaler.pkl') joblib.dump(imp, 'pickle-final/Imputer.pkl') joblib.dump(vec, 'pickle-final/Vector.pkl') estimators = [] # K-Nearest Neighbors estimators.append({
plt.subplot(1, 2, 2) plt.barh(pos, feature_importance[sorted_idx], align='center') plt.yticks(pos, header[sorted_idx]) # boston.feature_names[sorted_idx]) plt.xlabel('Relative Importance') plt.title('Variable Importance') plt.show(block=False) return header[sorted_idx], feature_importance[sorted_idx] csvfile = 'rentList_All_final.csv' # adding attributes did not make a difference #csvfile = 'rentList_All_withAllAttr_trimmed.csv' #csvfile = 'rentList_E_EC_N_final.csv' data = readCsvIntoPandasDataframe(csvfile) X, y, X_scaler, y_scaler, header = preprocessData(data) #print "header type:" #print type(header).__name__ #print header #X, y = preprocessDataWithoutScale(data) joblib.dump(X_scaler, 'pickle/X_scaler.pkl') joblib.dump(y_scaler, 'pickle/y_scaler.pkl') estimators = [] # K-Nearest Neighbors estimators.append( {"name": "KNN", "model": neighbors.KNeighborsRegressor(