<commit_before>
import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof

import logging
import logging.config

#logging.config.fileConfig('logging.conf')

logging.basicConfig(level=logging.INFO)


def process_dataset(idataset, debug=False):
    idataset.mFullDataset["orig_" + idataset.mSignalVar] = idataset.mFullDataset[idataset.mSignalVar];

    for i in range(4):
        sig = i/4.0;
        process_dataset_with_noise(idataset, sig , debug);

def process_dataset_with_noise(idataset , sigma, debug=False):
    
    import warnings

    with warnings.catch_warnings():
        warnings.simplefilter("error")
        N = idataset.mFullDataset.shape[0];
        lSignalVar = idataset.mSignalVar + "_" + str(sigma);
        lNoise = np.random.randn(N) * sigma;
        idataset.mFullDataset[lSignalVar] = idataset.mFullDataset["orig_" + idataset.mSignalVar] + lNoise;
        idataset.mPastData = idataset.mFullDataset[:-idataset.mHorizon];
        idataset.mFutureData = idataset.mFullDataset.tail(idataset.mHorizon);
        training_ds = idataset.mPastData
        # #df.to_csv("outputs/rand_exogenous.csv")
    
        H = idataset.mHorizon;
    
        # N = df.shape[0];
        # df1 = df;
        lEngine = autof.cForecastEngine()
        # lEngine.mOptions.mEnableSeasonals = False;
        lEngine.mOptions.mDebug = debug;
        # lEngine.mOptions.enable_slow_mode();
        # mDebugProfile = True;
        # lEngine
        lExogenousData = (idataset.mExogenousDataFrame , idataset.mExogenousVariables) 
        lEngine.train(training_ds , idataset.mTimeVar , lSignalVar, H, lExogenousData);
        lEngine.getModelInfo();
        # lEngine.standrdPlots(name = "outputs/my_exog_" + str(nbex) + "_" + str(n));
        # lEngine.mSignalDecomposition.mBestModel.mTimeInfo.mResolution
        
        dfapp_in = training_ds.copy();<commit_msg>Updated this test<commit_after>
import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof

import logging
import logging.config

#logging.config.fileConfig('logging.conf')

logging.basicConfig(level=logging.INFO)


def process_dataset(idataset, debug=False):
    idataset.mFullDataset["orig_" + idataset.mSignalVar] = idataset.mFullDataset[idataset.mSignalVar];

    for i in range(4):
        sig = (i + 1.0)/4.0;
        process_dataset_with_noise(idataset, sig , debug);

def process_dataset_with_noise(idataset , sigma, debug=False):
    
    import warnings

    with warnings.catch_warnings():
        warnings.simplefilter("error")
        N = idataset.mFullDataset.shape[0];
        lSignalVar = idataset.mSignalVar + "_" + str(sigma);
        lNoise = np.random.randn(N) * sigma;
        idataset.mFullDataset[lSignalVar] = idataset.mFullDataset["orig_" + idataset.mSignalVar] + lNoise;
        idataset.mPastData = idataset.mFullDataset[:-idataset.mHorizon];
        idataset.mFutureData = idataset.mFullDataset.tail(idataset.mHorizon);
        training_ds = idataset.mPastData
        # #df.to_csv("outputs/rand_exogenous.csv")
    
        H = idataset.mHorizon;
    
        # N = df.shape[0];
        # df1 = df;
        lEngine = autof.cForecastEngine()
        # lEngine.mOptions.mEnableSeasonals = False;
        lEngine.mOptions.mDebug = debug;
        # lEngine.mOptions.enable_slow_mode();
        # mDebugProfile = True;
        # lEngine
        lExogenousData = (idataset.mExogenousDataFrame , idataset.mExogenousVariables) 
        lEngine.train(training_ds , idataset.mTimeVar , lSignalVar, H, lExogenousData);
        lEngine.getModelInfo();
        # lEngine.standrdPlots(name = "outputs/my_artificial_" + idataset.mName + "_" + str(sigma));
        # lEngine.mSignalDecomposition.mBestModel.mTimeInfo.mResolution
        
        dfapp_in = training_ds.copy();
{'fraction_non_alphanumeric': 0.11075865715040972, 'fraction_numerical': 0.0037007665873645254, 'mean_word_length': 3.1719955898566705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3392720', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1276, 'n_words': 190}