World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITians, only for AI Learners.
Import the boston housing dataset, but while importing change the 'medv' (median house value) column so that values < 35 becomes ‘Low’ and > 35 becomes ‘High’.
import csv with open('BostonHousing.csv', 'r') as f: reader = csv.reader(f) out =  for i, row in enumerate(reader): if i > 0: row = 'High' if float(row) > 35 else 'Low' out.append(row) df = pd.DataFrame(out[1:], columns=out) print(df.head())
Running random forest algorithm with one variable