def success(): DATE = request.args.get( 'DATE') # get the key/value pairs in the URL query string from /form CRS_DEP_TIME = request.args.get('CRS_DEP_TIME') UNIQUE_CARRIER = request.args.get('UNIQUE_CARRIER') FL_NUM = request.args.get('FL_NUM') ORIGIN = request.args.get('ORIGIN') DEST = request.args.get('DEST') df_input = preprocess_input(DATE, CRS_DEP_TIME, UNIQUE_CARRIER, FL_NUM, ORIGIN, DEST, filename_metadata) res = make_prediction(df_input, filename_pickle) return res
def predictor(data, saved_model, labels=False, interactive=False, interactive_x='none'): ''' Function for making predictions on a saved model. NOTE: 1) remember to use the same 'x' as with training 2) call the model by its name ''' pred = make_prediction(data, saved_model, labels=labels, interactive=interactive, interactive_x=interactive_x) return pred
def start(): to_predict = request.json # print(to_predict) pred = make_prediction(to_predict) return jsonify({"Predicted Clusters": pred})
def result(): if request.method == 'POST': form_dict = request.form result = make_prediction(form_dict) return render_template('result.html', result=form_dict, proba=result)
def predict(self): self.predictions = prediction.make_prediction(self.emu_data.values, self.max_predictions) self.mistakes = prediction.calculate_mistake(self.predictions, self.all_squares.values[len(self.emu_data):len(self.emu_data) + self.max_predictions])
# Making dataset that consists of images of selected desks with plants # copy_selected_plant_photos.copy_selected_plant('all_photos', 6) # Importing images from dataset # images = import_images('6_plant') # Calculating areas of plants on the desk # count_area.calculate_squares(images) # Calculating areas of one selected plant on the desk # count_area.calculate_single_plant(images, 2) # Getting raw array with areas of one selected plant # areas = count_area.read_areas_from_file(3, type='array') # show_plots([areas]) # # Getting Pandas.Series with areas of one selected plant # areas = count_area.read_areas_from_file(2) # lag_plot(areas) # plt.show() series = Series.from_csv('2_plant_areas.csv', header=0) # prediction.show_autocorrelation(series) # prediction.show_baseline(series) prediction.make_prediction(series)