Skip to main content
Formatting.
Origen Enlace
fedorqui
  • 16.7k
  • 24
  • 71
  • 134

Al correr este código en jupyter:

def plot_feature_importances_cancer(model):
n_features = cancer.data.shape[1]
plt.barh(range(n_features), model.feature_importances_, align='center')
plt.yticks(np.arange(n_features), cancer.feature_names)
plt.xlabel("Feature importance")
plt.ylabel("Feature")
plot_feature_importances_cancer(tree)

aparece este error:

File "<ipython-input-19-a558f64f826a>", line 2
File "<ipython-input-19-a558f64f826a>", line 2
    n_features = cancer.data.shape[1]
             ^
IndentationError: expected an indented block

Estoy trabajando en windowsWindows 7

Al correr este código en jupyter:

def plot_feature_importances_cancer(model):
n_features = cancer.data.shape[1]
plt.barh(range(n_features), model.feature_importances_, align='center')
plt.yticks(np.arange(n_features), cancer.feature_names)
plt.xlabel("Feature importance")
plt.ylabel("Feature")
plot_feature_importances_cancer(tree)

aparece este error:

File "<ipython-input-19-a558f64f826a>", line 2
    n_features = cancer.data.shape[1]
             ^
IndentationError: expected an indented block

Estoy trabajando en windows 7

Al correr este código en jupyter:

def plot_feature_importances_cancer(model):
n_features = cancer.data.shape[1]
plt.barh(range(n_features), model.feature_importances_, align='center')
plt.yticks(np.arange(n_features), cancer.feature_names)
plt.xlabel("Feature importance")
plt.ylabel("Feature")
plot_feature_importances_cancer(tree)

aparece este error:

File "<ipython-input-19-a558f64f826a>", line 2
    n_features = cancer.data.shape[1]
             ^
IndentationError: expected an indented block

Estoy trabajando en Windows 7

Al correr este código en jupyter:

def plot_feature_importances_cancer(model): n_features = cancer.data.shape[1] plt.barh(range(n_features), model.feature_importances_, align='center') plt.yticks(np.arange(n_features), cancer.feature_names) plt.xlabel("Feature importance") plt.ylabel("Feature") plot_feature_importances_cancer(tree)

def plot_feature_importances_cancer(model):
n_features = cancer.data.shape[1]
plt.barh(range(n_features), model.feature_importances_, align='center')
plt.yticks(np.arange(n_features), cancer.feature_names)
plt.xlabel("Feature importance")
plt.ylabel("Feature")
plot_feature_importances_cancer(tree)

aparece este error: File "", line 2 n_features = cancer.data.shape[1] ^ IndentationError: expected an indented block

File "<ipython-input-19-a558f64f826a>", line 2
    n_features = cancer.data.shape[1]
             ^
IndentationError: expected an indented block

Estoy trabajando en windows 7

Al correr este código en jupyter:

def plot_feature_importances_cancer(model): n_features = cancer.data.shape[1] plt.barh(range(n_features), model.feature_importances_, align='center') plt.yticks(np.arange(n_features), cancer.feature_names) plt.xlabel("Feature importance") plt.ylabel("Feature") plot_feature_importances_cancer(tree)

aparece este error: File "", line 2 n_features = cancer.data.shape[1] ^ IndentationError: expected an indented block

Estoy trabajando en windows 7

Al correr este código en jupyter:

def plot_feature_importances_cancer(model):
n_features = cancer.data.shape[1]
plt.barh(range(n_features), model.feature_importances_, align='center')
plt.yticks(np.arange(n_features), cancer.feature_names)
plt.xlabel("Feature importance")
plt.ylabel("Feature")
plot_feature_importances_cancer(tree)

aparece este error:

File "<ipython-input-19-a558f64f826a>", line 2
    n_features = cancer.data.shape[1]
             ^
IndentationError: expected an indented block

Estoy trabajando en windows 7

Origen Enlace
Jhony
  • 1
  • 1
  • 1

IndentationError: expected an indented block

Al correr este código en jupyter:

def plot_feature_importances_cancer(model): n_features = cancer.data.shape[1] plt.barh(range(n_features), model.feature_importances_, align='center') plt.yticks(np.arange(n_features), cancer.feature_names) plt.xlabel("Feature importance") plt.ylabel("Feature") plot_feature_importances_cancer(tree)

aparece este error: File "", line 2 n_features = cancer.data.shape[1] ^ IndentationError: expected an indented block

Estoy trabajando en windows 7