why! check the codes again please!! the question was utilizing ma.pdf
Prochain SlideShare
Competition 1 (blog 1)Competition 1 (blog 1)
Chargement dans ... 3
1 sur 1

Contenu connexe

Similaire à why! check the codes again please!! the question was utilizing ma.pdf(20)

Plus de amikoenterprises(20)

why! check the codes again please!! the question was utilizing ma.pdf

  1. why?! check the codes again please!! the question was utilizing machine learning in detecting fraud for credit card by logistic regression in artificial intelligence I A Import necessary tibnaries import pandas as pd from sklearn. model_selection import train_test_split from sklearn. linear_ nodel import LogisticRegression from sklearn.metrics import accuracy_score, confusion_matrix * Load the dataset data = pd.read_csv ( "creditcard.csv') * Split the dotoset into training and testing sets X_train, X_test, ( y_{text {_train, }} y_{text {_test = }} ) train_test_split(data.drop ("Class', axise1), data[ Cllass '], test_size-e.3, random_state-42 - Create the Logistic regression model model = Logistichegression( ) * Train the modet on the training data model.fit (x_train, ( y_{text {_train) }} ) N Noke predictions on the testing data ypred= model, predict (xtest ) W Evaluate the performance of the model print ( "Accuracy Score:", accuracy_score (y_test, ( y_{text {_pred) }} ) ) print ("Confusion Matrix: in", confusion_matrix(y_test, ( y_{text {"_pred) }} ) )) FileNotfoundtrror Ce11 In[s], 1ine Traceback (nost recent call last) 5 froe sklearn, netrics import accuracy_score, confusion_natrix 7 ioad the datanet 10 i 5 plit the dataset into training and testing sets -statese42) unents. chocalsi, decorate.clocalis. wrapper (*args, "*kargs) 325 if len(arg5) i num_allow_args: stacklevelwind_stack_level(), uffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle dupe_cols, dtype, ongine, convecters, true values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, heep_default_na, na_filter. verbosa, skip.b FileNotFoundError: [Errno 2] No such file or directory: 'creditcard.csv'