Python/High_acquisition_rate_TSFRESH/unified_bib.py
def PCA_projection (features):
    ''' Function for ONLINE mode
    This function project the data into a trained PCA.
    
    Parameters:
    ------
    features: dataframe 
        #############################################################
    
    Returns: 
    -------
    dataframe
        contain the output data of PCA, i.e., the dataset with Principal Componentes projected by PCA
    
    '''
    loaded_scaler = pickle.load(open('Kernel/pca_scaler.sav', 'rb'))
    features_padronizadas = loaded_scaler.transform(features)
    #centralizar os dados e colocá-los com desvioPadrão=1
    #scaler = StandardScaler().fit(features)
    #features_padronizadas = scaler.transform(features)

    pca= PCA(n_components = 3)
    pca.fit(features_padronizadas)
    
    variacao_percentual_pca = np.round(pca.explained_variance_ratio_ * 100, decimals = 2)

    print('Variation maintained: %.2f' % variacao_percentual_pca.sum())
    print('                  ')


    features_reduzidas = pca.transform(features_padronizadas)

    """
    # load the model from disk
    loaded_pca = pickle.load(open('Kernel/pca.sav', 'rb'))
    
    scaler = StandardScaler().fit(features)
    features_padronizadas = scaler.transform(features)

    features_padronizadas = scaler.transform(features)
    features_reduzidas = loaded_pca.transform(features_padronizadas)
    """
    
    return features_reduzidas
 Function for ONLINE mode
    This function project the data into a trained PCA.
    
    Parameters:
    ------
    features: dataframe 
        #############################################################
    
    Returns: 
    -------
    dataframe
        contain the output data of PCA, i.e., the dataset with Principal Componentes projected by PCA
    
    
Function for ONLINE mode
This function project the data into a trained PCA.



dataframe



dataframe
contain the output data of PCA, i.e., the dataset with Principal Componentes projected by PCA
Function for ONLINE mode This function project the data into a trained PCA . dataframe dataframe contain the output data of PCA i . e . the dataset with Principal Componentes projected by PCA
def PCA_projection (features):
    loaded_scaler = pickle.load(open('Kernel/pca_scaler.sav', 'rb'))
    features_padronizadas = loaded_scaler.transform(features)
    pca= PCA(n_components = 3)
    pca.fit(features_padronizadas)
    variacao_percentual_pca = np.round(pca.explained_variance_ratio_ * 100, decimals = 2)
    print('Variation maintained: %.2f' % variacao_percentual_pca.sum())
    print('                  ')
    features_reduzidas = pca.transform(features_padronizadas)
    return features_reduzidas
def PCA_projection ( features ) : loaded_scaler = pickle . load ( open ( 'Kernel/pca_scaler.sav' , 'rb' ) ) features_padronizadas = loaded_scaler . transform ( features ) pca = PCA ( n_components = 3 ) pca . fit ( features_padronizadas ) variacao_percentual_pca = np . round ( pca . explained_variance_ratio_ * 100 , decimals = 2 ) print ( 'Variation maintained: %.2f' % variacao_percentual_pca . sum ( ) ) print ( '                  ' ) features_reduzidas = pca . transform ( features_padronizadas ) """
    # load the model from disk
    loaded_pca = pickle.load(open('Kernel/pca.sav', 'rb'))
    
    scaler = StandardScaler().fit(features)
    features_padronizadas = scaler.transform(features)

    features_padronizadas = scaler.transform(features)
    features_reduzidas = loaded_pca.transform(features_padronizadas)
    """ return features_reduzidas
Function for ONLINE mode
This function project the data into a trained PCA.
Function for ONLINE mode This function project the data into a trained PCA .
''' Function for ONLINE mode
    This function project the data into a trained PCA.
    
    Parameters:
    ------
    features: dataframe 
        #############################################################
    
    Returns: 
    -------
    dataframe
        contain the output data of PCA, i.e., the dataset with Principal Componentes projected by PCA
    
    ''' #centralizar os dados e colocá-los com desvioPadrão=1 #scaler = StandardScaler().fit(features) #features_padronizadas = scaler.transform(features) """
    # load the model from disk
    loaded_pca = pickle.load(open('Kernel/pca.sav', 'rb'))
    
    scaler = StandardScaler().fit(features)
    features_padronizadas = scaler.transform(features)

    features_padronizadas = scaler.transform(features)
    features_reduzidas = loaded_pca.transform(features_padronizadas)
    """
features