What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-04 18:20:02
train test split sklearn
from sklearn.model_selection import train_test_split X = df.drop(['target'],axis=1).values # independant features y = df['target'].values # dependant variable # Choose your test size to split between training and testing sets: X_train, X_test, y_t... Add solution -
Other 2022-03-03 15:50:03
naive bayes classifier sklearn
from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.naive_bayes import GaussianNB X, y = load_iris(return_X_y=True) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=... Add solution -
Python 2022-02-28 15:50:09
how to find the accuracy of linear regression model
# Simple Linear Regression # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Salary_Data.csv') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, 1].values # Sp... Add solution -
Python 2021-11-05 22:24:07
sklearn train test split
from sklearn.model_selection import train_test_split X = df.drop(['target'],axis=1).values # independant features y = df['target'].values # dependant variable # Choose your test size to split between training and testing sets: X_train, X_test, y_t... Add solution -
Python 2021-10-16 20:19:03
train test split
from sklearn.model_selection import train_test_split X = df.drop(['target'],axis=1).values # independant features y = df['target'].values # dependant variable # Choose your test size to split between training and testing sets: X_train, X_test, y_t... Add solution -
Python 2021-10-02 01:21:04
train-test split code in pandas
from sklearn.model_selection import train_test_split X = df.drop(['target'],axis=1).values # independant features y = df['target'].values # dependant variable # Choose your test size to split between training and testing sets: X_train, X_test, y_t... Add solution -
Python 2021-09-25 18:15:07
write a Program in Python/R to Demonstrate naive bayes classification
>>> from sklearn.naive_bayes import GaussianNB >>> from sklearn.naive_bayes import MultinomialNB >>> from sklearn import datasets >>> from sklearn.metrics import confusion_matrix >>> from sklearn.model_selectio... Add solution -
Python 2021-09-18 04:31:02
Lazy Predict Classification Auto SkLearn
from lazypredict.Supervised import LazyClassifier from sklearn.datasets import load_breast_cancer from sklearn.model_selection import train_test_split data = load_breast_cancer() X = data.data y= data.target X_train, X_test, y_train, y_test = train_test... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5