• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 5 páginas
Examen

Graphing Programming Assignment Comprehensive Study Guide + Exam Questions & Solutions Graded A+

Document preview thumbnail
Vista previa 2 fuera de 5 páginas

Graphing Programming Assignment Comprehensive Study Guide + Exam Questions & Solutions Graded A+

Vista previa del contenido

Graphing Programming Assignment
1. Find a dataset as you did in the previous assignment (can be the same dataset but
doesn't have to be). Divide it into test and training sets, and then create an Rpart model
on the training set to predict a dependent variable. For this part include just one column
to make the prediction from. (you are using one column to predict another). Include a
picture of the tree, along with 2 measures of error (root mean squared error and
absolute error) on the training and test set.

To check how well the regression tree worked, I used RMSE along with MAE across training
and test data. Training RMSE came out to 122.06 whereas test RMSE reached 123.26 - so
predictions miss actual values by roughly 122 to 123 calories per case. Looking at MAE, it's
96.41 on training but climbs slightly to 98.74 during testing, meaning most mistakes sit near 96–
99 calories. Because gap between training and test scores stays small, no signs point toward
overfitting right now.

, 2. Adjust the complexity parameter (make it lower) of the Rpart model until the training
accuracy stops going up. What is the test accuracy? If done correctly it should now be
lower since your model is overfit. Include the complexity parameter along with pictures
of the tree.

To check overfitting, I reduced the cp value in the rpart model. With cp = 0.001, the tree got
bigger, picking up more splits. Training RMSE dropped - from 122.06 in part 1 before to 113.22
while MAE went from 96.41 down to 88.35, meaning it matched training data closer. Test RMSE
decreased a bit too, falling from 123.26 to 116.27; MAE followed suit, sliding from 98.74 to
91.88. This shows the model is starting to overfit, and lowering cp further would eventually
cause the test error to increase while the training error continues to decrease.

Información del documento

Subido en
4 de abril de 2026
Número de páginas
5
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$16.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

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.
YourExamplug
4.1
(74)
Vendido
226
Seguidores
27
Artículos
18088
Última venta
1 semana hace



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