100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

Data Preprocessing and Regressions(Machine Learning) test questions and answers 2024

Puntuación
-
Vendido
-
Páginas
14
Grado
A+
Subido en
15-11-2024
Escrito en
2024/2025

Data Preprocessing and Regressions(Machine Learning) test questions and answers 2024

Institución
Data Mining
Grado
Data Mining









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Data Mining
Grado
Data Mining

Información del documento

Subido en
15 de noviembre de 2024
Número de páginas
14
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

Data Preprocessing and
Regressions(Machine Learning)
test questions and answers
2024
Numpy package
Allows us to work with arrays
matplotlib package
Allows to make charts and graphs
pandas package
imports and manipulates data
How do you import a csv dataset file
pd.read_csv(~~~~~~~~~~~.csv)
How do you split a dataset up into different variables, with specific rows
and columns
x=dataset.iloc[rows,columns].values
y=dataset.iloc[rows,columns].values
What does iloc do?
locates the columns/rows by its index
What does SimpleInputer from sklearn do?
Find missing values of a variable, and assign it to the mean of the other
values of that variable
What is the code to replace missing values of a dataset from columns 1
and 2 using imputer?
from sklearn.impute import SimpleInputer
imputer=SimpleInputer(missing_values=np.nan,strategy='mean')
imputer.fit(x.iloc[:,1:3]
x.iloc[:,1:3]=imputer.transform(x.iloc[:,1:3])
Why should you never assign 1,2,3,.... to a categorical variable whose
values range is not a boolean?

, The machine might think that there is a pattern. The alternative way is to
use onehotencoding
When encoding categorical data, when should you use np.array and
ColumnTransformer package from sklearn?
When your variable has more than one category ***You never use this for
LabelEncoder
What are all of the sklearn packages to use when doing categorical data
encoding?
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import LabelEncoder
How would you use ColumnTransformer to encode the 1st index of variable
x using OneHotEncoder?
ct=ColumnTransformer(transformers=[('encoding', OneHotEncoding,[0])],
remainder='passthrough')

x=np.array(ct.fit_transform(x))
How would you use ColumnTransformer to encode the 1st index of variable
y using LabelEncoder?
ct=ColumnTransformer(transformers=[('encoding', LabelEncoder(), [0])],
remainder='passthrough')

y=np.array(ct.fit_transform(y))
Why is the idea of training and testing data and why do we do it?
It is a method to measure the accuracy of your model. The dataset is split
randomely from a 80:20 ratio. The trained data is the 80 and that is what
the machine learns. The test is what the machine tests based on what is
learned with the trained data. If the test and trained are similar, that
means the fit of the model is good, otherwise it is not
How do you use sklearn to declare trained and test for 2 variables using
train_test_split?
from sklearn.model_selection import train_test_split

x_train, x_test, y_train, y_test= train_test_split(x,y,test_size=0.2,
random_state=#)
Should you do feature scaling before or after train/test?
After doing train/test
$13.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
BRAINBOOSTERS Chamberlain College Of Nursing
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
654
Miembro desde
2 año
Número de seguidores
250
Documentos
22740
Última venta
14 horas hace

In this page you will find all documents , flashcards and package deals offered by seller BRAINBOOSTERS

4.5

339 reseñas

5
264
4
30
3
21
2
5
1
19

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes