Advertisement

机器学习入门 | 决策树

阅读量:
复制代码
    import numpy as np
    import matplotlib
    import matplotlib.pyplot as plt
    
    %matplotlib
    %matplotlib inline
    %config InlineBackend.figure_format = 'retina'
    
    
      
      
      
      
      
      
      
    
复制代码
    Using matplotlib backend: MacOSX
    
    
      
    
复制代码
    def plot_decision_boundary(model, axis):
    
    x0, x1 = np.meshgrid(
        np.linspace(axis[0], axis[1], int((axis[1]-axis[0])*100)).reshape(-1, 1),
        np.linspace(axis[2], axis[3], int((axis[3]-axis[2])*100)).reshape(-1, 1),
    )
    X_new = np.c_[x0.ravel

全部评论 (0)

还没有任何评论哟~