from rackio_AI import RackioAI from rackio import Rackio app = Rackio() RackioAI(app) df = RackioAI.load_test_data('Leak') df.info() df2 = RackioAI.load_test_data('Leak', 'Leak111.tpl') df2.info()
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from rackio_AI import Preprocessing, RackioAI from rackio import Rackio app = Rackio() RackioAI(app) "Filename definition where is the data" os.chdir('../..') cwd = os.getcwd() filename = os.path.join(cwd, 'rackio_AI', 'data', 'pkl_files', 'test_data.pkl') "Load Data to RackioAI" RackioAI.load(filename) "Definition of instrument parameters" error = [0.0025, 0.0025, 0.0025, 0.0025] repeteability = [0.001, 0.001, 0.001, 0.001] lower_limit = [0, 0, 400000, 100000] upper_limit = [500, 500, 1200000, 600000] dead_band = [0.001, 0.001, 0.001, 0.001] "Set Options" RackioAI.synthetic_data.set_options(error=error, repeteability=repeteability, lower_limit=lower_limit, upper_limit=upper_limit, dead_band=dead_band)
df = pd.concat(self._df_) return df @ProgressBar(desc="Reading .pkl files...", unit="file") def __read(self, pathname, **pkl_options): """ Read (pkl) file into DataFrame. """ with open(pathname, 'rb') as f: _df = pickle.load(f) if 'remove_initial_points' in pkl_options: _rip = pkl_options['remove_initial_points'] _df.drop(index=_df.iloc[0:_rip, :].index.tolist(), inplace=True) self._df_.append(_df) return if __name__ == "__main__": # import doctest # doctest.testmod() import os from rackio_AI import RackioAI, get_directory filename = os.path.join(get_directory('Leak'), 'Leak01.tpl') df = RackioAI.load(filename)
from rackio import Rackio from rackio_AI import RackioAI app = Rackio() RackioAI(app) "Rackio" print(RackioAI.app.__class__.__name__) print('===================') "RackioAI" print(RackioAI.__class__.__name__)
from rackio_AI import RackioAI, Preprocessing from rackio import Rackio app = Rackio() RackioAI(app) preprocess1 = Preprocessing(name='Preprocess1', description='preprocess for data', problem_type='regression') preprocess2 = Preprocessing(name='Preprocess2', description='preprocess for data', problem_type='classification') RackioAI.append_preprocessing_model(preprocess1) RackioAI.append_preprocessing_model(preprocess2) print(RackioAI.summary())
import os from rackio_AI import RackioAI from rackio import Rackio app = Rackio() RackioAI(app) os.chdir('../..') cwd = os.getcwd() filename = os.path.join(cwd, 'rackio_AI', 'data', 'Leak', 'Leak112.tpl') RackioAI.load(filename) df = RackioAI.reader.tpl.to('dataframe') print(' ') print( '----------------------------------------------------------------------------------------' ) print('DATAFRAME BEFORE PERSISTING') print( '----------------------------------------------------------------------------------------' ) print(' ') df.info() filename = 'test' # Save pkl object RackioAI.save_obj(df, filename) # Load pkl object
import os from rackio_AI import RackioAI from rackio import Rackio app = Rackio() RackioAI(app) base_path = os.path.join('..', 'data') filename = os.path.join(base_path, 'Leak') RackioAI.load(filename) url_to_save = os.path.join(base_path, 'name.csv') RackioAI.reader.tpl.to('csv', filename=url_to_save)
import os import pandas as pd from rackio_AI import RackioAI from rackio import Rackio app = Rackio() RackioAI(app) "Data load" os.chdir('../..') cwd = os.getcwd() filename = os.path.join(cwd, 'rackio_AI', 'data', 'pkl_files', 'test_data.pkl') RackioAI.load(filename) variable_names = RackioAI.data.columns.to_list() "Definition of instrument parameters" error = [0.0025, 0.0025, 0.0025, 0.0025] repeteability = [0.001, 0.001, 0.001, 0.001] lower_limit = [0, 0, 400000, 100000] upper_limit = [500, 500, 1200000, 600000] dead_band = [0.001, 0.001, 0.001, 0.001] "Set Options" RackioAI.synthetic_data.set_options(error=error, repeteability=repeteability, lower_limit=lower_limit, upper_limit=upper_limit, dead_band=dead_band)
import os from rackio_AI import RackioAI from rackio import Rackio app = Rackio() RackioAI(app) filename = os.path.join('..', 'data') data = RackioAI.load(filename) print(data)