Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON QUESTION I am running this code to answer this question using theparkingson data. I get the error below. can someone help me troubleshoot 1.

PYTHON QUESTION

I am running this code to answer this question using theparkingson data. I get the error below. can someone help me troubleshoot 1. Use cross-validation to build a linear regression model topredict total_UPDRS #################### import os import pandas aspd from sklearn.model_selection import train_test_split importsklearn.metrics as metrics import matplotlib.pyplot as plt############################################################################## Regression models path =r"C:UsersrobrDesktopSchoolweek9"os.chdir(path) parking =pd.read_csv("parking.csv") parking.head() parking.sex.describe() #Train_test split X = parking.loc[:,['subject#', 'age', 'sex','test_time', 'Jitter(%)', 'Jitter(Abs)','Jitter:RAP', 'Jitter:PPQ5', 'Jitter:DDP', 'Shimmer', 'Shimmer(dB)', 'Shimmer:APQ3', 'Shimmer:APQ5','Shimmer:APQ11', 'Shimmer:DDA', 'NHR','HNR', 'RPDE', 'DFA', 'PPE']] y = parking.total_UPDRS X.describe()y.describe() X_train, X_test, y_train, y_test = train_test_split(X,y, test_size = 0.3, random_state = 123) from sklearn import linear_modellreg = linear_model.LinearRegression().fit(X_train, y_train)lreg.score(X_train, y_train) lreg.score(X_test, y_test)################### #cross validation from sklearn.model_selectionimport cross_val_score # Use linear Reg as the classifier lreg =linear_model.LinearRegression() accuracies = cross_val_score(lreg,X_train, y_train, cv = 10) accuraciespd.Series(accuracies).describe() ################### fromsklearn.model_selection import cross_validate scoring =['accuracy'] scores = cross_validate(lreg, X_train, y_train,scoring = scoring, cv = 10, return_train_score =True) ########################## ERROR RETURNED File"C:Usersrobanaconda3libsite-packagessklearnmetricsclassification.py",line 88, in _check_targets raise ValueError("{0} isnot supported".format(y_type)) ValueError: continuous is notsupported

Step by Step Solution

3.44 Rating (170 Votes )

There are 3 Steps involved in it

Step: 1

Answer It seems that the values being passed to the scorer in here are y and cvvaluesi are passed as ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

What is a self-concept? What are the four types of self-concept?

Answered: 1 week ago