Answered step by step
Verified Expert Solution
Question
1 Approved Answer
How to convert this onehotencoder so it can run on scikitlearn 0.22.1 import numpy as np import pandas as pd from sklearn.metrics import confusion_matrix, accuracy_score
How to convert this onehotencoder so it can run on scikitlearn 0.22.1
import numpy as np
import pandas as pd
from sklearn.metrics import confusion_matrix, accuracy_score
from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_absolute_error
from sklearn.metrics import r2_score
dataset = pd.read_csv(‘heart.csv’)
X = dataset.iloc[:,:-1].values
y = dataset.iloc[:,-1].values
because the new version of sklearn onehotencoder doesnt have categorical_features attribute please help
Step by Step Solution
★★★★★
3.44 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
In the sklearn 022 the categoricalfeatures were deprecated So ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started