November 2017
Intermediate to advanced
374 pages
10h 19m
English
Load the breast cancer dataset from scikit learn:
import numpy as npimport pandas as pdfrom sklearn.datasets import load_breast_cancerbc = load_breast_cancer() new_feature_names = ['_'.join(ele.split()) for ele in bc.feature_names]X = pd.DataFrame(bc.data,columns = new_feature_names)y = bc.target
Split the data into training and testing sets:
from sklearn.model_selection import train_test_splitX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=7, stratify = y)
Read now
Unlock full access