def run_pipeline(data_folder): """Main function. Run the full pipeline from the data loading to evaluation. """ print("Loading dataset...\n") processor = process.Processor() dl = load.Loader(data_folder, processor) x_train = dl.get_x_train() y_train = dl.get_y_train() print("Training size: " + str(len(x_train)) + " examples.") print("Train Model...\n") model = BestModel() model.train(x_train, y_train) print("\nEvaluating training set...\n") predictions = model.predict(x_train) evaluate.evaluate_set(y_train, predictions) print("\nEvaluating test set...\n") x_test = dl.get_x_test() y_test = dl.get_y_test() predictions = model.predict(x_test) evaluate.evaluate_set(y_test, predictions)
def __init__(self, filename, pressure=1e-5, feedback=False): self.filename = filename f_nopath = filename.split('/')[-1] self.loader = saving.Loader(logger_name="Saving_" + f_nopath) self.processer = process.Processor(logger_name="Processing_" + f_nopath) self.plotter = myplots.Plotter() self.x, self.y = self.loader.load_data(self.filename) self.fs = len(self.x) / (2 * self.x[-1]) self.pressure = pressure self.feedback = feedback self._creation_time = datetime.datetime.now() self.xpsd = [] self.ypsd = [] self.centers = dict() self.filtered = dict() self.filter_response = dict() self.filtered_psd = dict() self.phase_space = dict() self.cuts = dict() self.fit_parms = {'z': [], 'x': [], 'y': []} self.fit_errors = {'z': [], 'x': [], 'y': []} self.fit_data = dict() self.noise = dict()
#!/usr/bin/env python # -*- coding: utf-8 -*- # Project: Выгрузка слоя из OSM в NGW # Author: Artem Svetlov <*****@*****.**> # Copyright: 2016, NextGIS <*****@*****.**> import process import os # Все функции обработки записаны в файле process.py # Для работы: запускается python main.py а в этом файле расскоментируются строки запуска отдельных функций #Этот скрипт запускается из верхней папки processor = process.Processor() processor.osmimport('data') processor.postgis2geojson('planet_osm_point') os.system('python update_ngw_from_geojson.py --ngw_url ' + processor.ngw_url + ' --ngw_resource_id ' + processor.ngw_res_id + ' --ngw_login ' + processor.ngw_login + ' --ngw_password ' + processor.ngw_password + ' --check_field osm_id --filename tree/planet_osm_point.geojson')
def main(bucket, filter, error, no_dl): if not no_dl: dl = download.Downloader(bucket, filter) dl.run() process.Processor(error).run()