This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting data | |
import pandas as pd | |
from sklearn.datasets import load_breast_cancer | |
cancer = load_breast_cancer() | |
df = pd.DataFrame(cancer.data, columns=cancer.feature_names) | |
X = df | |
y = cancer.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting data | |
import pandas as pd | |
df = pd.read_csv('Advertising.csv') | |
X = df[['TV', 'Radio', 'Newspaper']] | |
y = df['Sales'] | |
# Importing CooksDistance visualizer | |
from yellowbrick.regressor import CooksDistance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting data | |
import pandas as pd | |
df = pd.read_csv('Advertising.csv') | |
X = df[['TV']] | |
y = df['Sales'] | |
# Create the train and test data | |
from sklearn.model_selection import train_test_split | |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting data | |
import pandas as pd | |
df = pd.read_csv('Advertising.csv') | |
X = df[['TV']] | |
y = df['Sales'] | |
# Create the train and test data | |
from sklearn.model_selection import train_test_split | |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting data | |
from sklearn.datasets import load_breast_cancer | |
cancer = load_breast_cancer() | |
classes=cancer.target_names | |
X = cancer.data | |
y = cancer.target | |
# Importing ClassBalance visualizer | |
from yellowbrick.target import ClassBalance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting data | |
from sklearn.datasets import load_iris | |
iris = load_iris() | |
classes=iris.target_names | |
X = iris.data | |
y = iris.target | |
# Importing SilhouetteVisualizer | |
from yellowbrick.cluster import SilhouetteVisualizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting data | |
from sklearn.datasets import load_iris | |
iris = load_iris() | |
classes=iris.target_names | |
X = iris.data | |
y = iris.target | |
# Importing KElbowVisualizer | |
from yellowbrick.cluster import KElbowVisualizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting data | |
from sklearn.datasets import load_breast_cancer | |
cancer = load_breast_cancer() | |
classes=cancer.target_names | |
X = cancer.data | |
y = cancer.target | |
# Importing learning curve visualizer | |
from yellowbrick.model_selection import LearningCurve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting data | |
from sklearn.datasets import load_breast_cancer | |
cancer = load_breast_cancer() | |
classes=cancer.target_names | |
X = cancer.data | |
y = cancer.target | |
# Importing PCA visualizer | |
from yellowbrick.model_selection import ValidationCurve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
visualizer = PCA(scale=True, projection=3, | |
classes=classes) | |
visualizer.fit_transform(X, y) | |
visualizer.show(outpath="PC_Plot_3D.png") |
NewerOlder