What do you want to save?
Add Code snippet
New code examples
-
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-11-04 11:19:10
torch timeseries
# Load dependencies from sklearn.preprocessing import MinMaxScaler # Instantiate a scaler """ This has to be done outside the function definition so that we can inverse_transform the prediction set later on. """ scaler = Min... Add solution -
Other 2021-11-02 17:42:07
tfidfvectorizer code
# TF-IDF vectorizer >>> Logistic Regression from sklearn.feature_extraction.text import TfidfVectorizer vectorizer = TfidfVectorizer() Vec = vectorizer.fit_transform(df['text_column_name_after_preprocessing']) print(vectorizer.get_feature_names... Add solution -
Python 2021-11-01 23:34:15
Como crear rnn en keras
import numpy import matplotlib.pyplot as plt import pandas import math from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from keras.layers import Reshape from sklearn.preprocessing import MinMaxScaler... 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-03 06:06:05
svd movielens data train and test
from surprise import Dataset, Reader, SVD, accuracy from surprise.model_selection import train_test_split # instantiate a reader and read in our rating data reader = Reader(rating_scale=(1, 5)) data = Dataset.load_from_df(ratings_f[['userId','movie... 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