Menu

[Solved] Leave Email Send Csv File Cant Upload Q37289451

Read the following two data files from the internet directly into your notebook using pd.read cs You will have to specify the

leave your email i will send the csv file. I cant upload ithere

Read the following two data files from the internet directly into your notebook using pd.read cs You will have to specify the option sep=”; ” because in these files the numbers are separated by semi-colons instead of commas https://archive.ics.uci.edu/ml/machine-learning-databases/wine- quality/winequality-red.csv https://archive.ics.uci.edu/ml/machine-learning-databases/wine- quality/winequality-white.csv From each file, extract the column labeled “sulphates”, and create a single-dimensional X array that has the red wine data followed by white wine data Create a Y array that is the same length as X that has a 1 if the corresponding X value is a red wine and a zero if the corresponding X value is a white wine. Your Y array should be a lot of 1’s followed by a lot of zeros Perform logistic regression on this data set to determine if a wine is either red or white based on chemicals. Print out: the confusion matrix, the accuracy score, and the ROC curve Hints (a) Remember to reshape the X data using .reshape (-1,1) (b) Do a train/test split with sklearn.model.selection.train.test.split (c) Use the training data to fit the model (d) Make a prediction with the test x-values (e) The input to the accuracy and confusion matrix are the y-test values and the predicted y-values (f) The ROC curve must be square; should have a grid; and should also have the 45 degree line from (0,0) to (1,1) plotted on it Show transcribed image text Read the following two data files from the internet directly into your notebook using pd.read cs You will have to specify the option sep=”; ” because in these files the numbers are separated by semi-colons instead of commas https://archive.ics.uci.edu/ml/machine-learning-databases/wine- quality/winequality-red.csv https://archive.ics.uci.edu/ml/machine-learning-databases/wine- quality/winequality-white.csv From each file, extract the column labeled “sulphates”, and create a single-dimensional X array that has the red wine data followed by white wine data Create a Y array that is the same length as X that has a 1 if the corresponding X value is a red wine and a zero if the corresponding X value is a white wine. Your Y array should be a lot of 1’s followed by a lot of zeros Perform logistic regression on this data set to determine if a wine is either red or white based on chemicals. Print out: the confusion matrix, the accuracy score, and the ROC curve Hints (a) Remember to reshape the X data using .reshape (-1,1) (b) Do a train/test split with sklearn.model.selection.train.test.split (c) Use the training data to fit the model (d) Make a prediction with the test x-values (e) The input to the accuracy and confusion matrix are the y-test values and the predicted y-values (f) The ROC curve must be square; should have a grid; and should also have the 45 degree line from (0,0) to (1,1) plotted on it

Expert Answer


Answer to leave your email i will send the csv file. I cant upload it here… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *