scatter3d

3D Scatterplot with strings in Python

拟墨画扇 提交于 2019-12-01 18:10:12
问题 I tried to do a 3D scatter plot in Python with string categories (i.e. activation functions and solvers for a neural network) on x and y and floating numbers (i.e. accuracy score of NN) on the z axis. The following example raises the error: ValueError: could not convert string to float: 'str1' I followed this documentation for 3D plots: https://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html Any ideas, what might be the problem ? Many thanks in advance! import matplotlib.pyplot as plt from

scatterplot3d: regression plane with residuals

夙愿已清 提交于 2019-11-28 11:38:05
Using scatterplot3d in R, I'm trying to draw red lines from the observations to the regression plane: wh <- iris$Species != "setosa" x <- iris$Sepal.Width[wh] y <- iris$Sepal.Length[wh] z <- iris$Petal.Width[wh] df <- data.frame(x, y, z) LM <- lm(y ~ x + z, df) library(scatterplot3d) G <- scatterplot3d(x, z, y, highlight.3d = FALSE, type = "p") G$plane3d(LM, draw_polygon = TRUE, draw_lines = FALSE) To obtain the 3D equivalent of the following picture: In 2D, I could just use segments : pred <- predict(model) segments(x, y, x, pred, col = 2) But in 3D I got confused with the coordinates. Using

scatterplot3d: regression plane with residuals

非 Y 不嫁゛ 提交于 2019-11-27 06:20:46
问题 Using scatterplot3d in R, I'm trying to draw red lines from the observations to the regression plane: wh <- iris$Species != "setosa" x <- iris$Sepal.Width[wh] y <- iris$Sepal.Length[wh] z <- iris$Petal.Width[wh] df <- data.frame(x, y, z) LM <- lm(y ~ x + z, df) library(scatterplot3d) G <- scatterplot3d(x, z, y, highlight.3d = FALSE, type = "p") G$plane3d(LM, draw_polygon = TRUE, draw_lines = FALSE) To obtain the 3D equivalent of the following picture: In 2D, I could just use segments : pred <