Posts by Pedro Miguel • 61 points
4 posts
-
1
votes2
answers53
viewsA: Regression curve with x-axis equal to 0
In addition to the approach with intercept_, it is possible to do it the way you wrote it. However, I will raise some incorrect points in your code. In lm.fit, the format of the x_train. Then the…
-
0
votes1
answer47
viewsA: Problems with input_shape using Keras
The problem is in model.fit, as the target variable is expected to have the same format as defined in Sequential(). So when does hist = model.fit( x_train, x_train, batch_size=32, epochs=100,…
-
1
votes1
answer54
viewsA: Step error in np.arange
This is because Python uses floating-point arithmetic, which cannot represent exactly some numbers, and np.arange works by repeatedly adding the step value to the initial value, and this leads to…
numpyanswered Pedro Miguel 61 -
1
votes1
answer251
viewsA: Additional filter for groupby
The solution to this case doesn’t need a condition. You can simply add one more grouping method in this groupby, in this case, the 'sum' for the 'Value' column'. Also, to return a dataframe, simply…