preprocessing.py
def modeling_prep():
    '''
    This function prepares the data for modeling
    '''
    # all local csv data compiled into a dataframe
    df = concat_csv_files()
    # adds new features, handles nulls, fixes data types, 
    # set the index to track_id, and fixes the tempo feature
    df = create_features(df)
    df = prepare_df(df)
    df = df.drop(columns='album')
    #encode album_type
    album_dummies = pd.get_dummies(df.album_type, drop_first=False).astype('int')
    df = pd.concat([df, album_dummies], axis=1)

    # drop any columns that won't contribute to modeling

    df = df.drop(columns=['album_popularity','label', 'artist', 
                        'release_date', 'track_name', 'album_id', 'album_type',
                        'release_year', 'release_month', 'release_day', 'duration_minutes', 
                        'duration_seconds', 'decade', 'is_top_billboard_label'])
    return df

    This function prepares the data for modeling
    
This function prepares the data for modeling
This function prepares the data for modeling
def modeling_prep():
    df = concat_csv_files()
    df = create_features(df)
    df = prepare_df(df)
    df = df.drop(columns='album')
    album_dummies = pd.get_dummies(df.album_type, drop_first=False).astype('int')
    df = pd.concat([df, album_dummies], axis=1)
    df = df.drop(columns=['album_popularity','label', 'artist', 
                        'release_date', 'track_name', 'album_id', 'album_type',
                        'release_year', 'release_month', 'release_day', 'duration_minutes', 
                        'duration_seconds', 'decade', 'is_top_billboard_label'])
    return df
def modeling_prep ( ) : df = concat_csv_files ( ) df = create_features ( df ) df = prepare_df ( df ) df = df . drop ( columns = 'album' ) album_dummies = pd . get_dummies ( df . album_type , drop_first = False ) . astype ( 'int' ) df = pd . concat ( [ df , album_dummies ] , axis = 1 ) df = df . drop ( columns = [ 'album_popularity' , 'label' , 'artist' , 'release_date' , 'track_name' , 'album_id' , 'album_type' , 'release_year' , 'release_month' , 'release_day' , 'duration_minutes' , 'duration_seconds' , 'decade' , 'is_top_billboard_label' ] ) return df
This function prepares the data for modeling
This function prepares the data for modeling
'''
    This function prepares the data for modeling
    ''' # all local csv data compiled into a dataframe # adds new features, handles nulls, fixes data types,  # set the index to track_id, and fixes the tempo feature #encode album_type # drop any columns that won't contribute to modeling