def feature_analysis(fname="feature_analysis.png"):
    """
    Create figures for feature analysis
    """

    # Create side-by-side axes grid
    _, axes = plt.subplots(ncols=2, figsize=(18,6))

    # Draw RadViz on the left
    data = load_occupancy(split=False)
    oz = RadViz(ax=axes[0], classes=["unoccupied", "occupied"])
    oz.fit(data.X, data.y)
    oz.finalize()

    # Draw Rank2D on the right
    data = load_concrete(split=False)
    oz = Rank2D(ax=axes[1])
    oz.fit_transform(data.X, data.y)
    oz.finalize()

    # Save figure
    path = os.path.join(FIGURES, fname)
    plt.tight_layout()
    plt.savefig(path)
def feature_analysis ( fname = "feature_analysis.png" ) : _ , axes = plt . subplots ( ncols = 2 , figsize = ( 18 , 6 ) ) data = load_occupancy ( split = False ) oz = RadViz ( ax = axes [ 0 ] , classes = [ "unoccupied" , "occupied" ] ) oz . fit ( data . X , data . y ) oz . finalize ( ) data = load_concrete ( split = False ) oz = Rank2D ( ax = axes [ 1 ] ) oz . fit_transform ( data . X , data . y ) oz . finalize ( ) path = os . path . join ( FIGURES , fname ) plt . tight_layout ( ) plt . savefig ( path )
Create figures for feature analysis