Back to Blog
Here I applied the 'cubic' interpolation using scipys interp1d. Another setting that users find useful is Monotonic Top/Bottom Order which provides an extrusion pathway that is smoother. 1 Answer Sorted by: 10 You should apply interpolation on your data and it shouldnt be 'linear'. Settings such as Top/Bottom Patterns and Enable Ironing can help significantly. This is what a graph looks like on my plot. To get the perfect Top & Bottom Layers, you want to have a good Top & Bottom Thickness that’s around 1.2-1.6mm. Plt.plot(range(1,len(cost_history)+1),cost_history) #print("iteration ".format(i,cost,current_m_val,current_b_val)) M_deriv = -(2/n)*sum(x_train*(y_train-y_hypothesis))ī_deriv = -(2/n)*sum(y_train-y_hypothesis)Ĭurrent_z_val = current_z_val - (learning_rate * z_deriv)Ĭurrent_m_val = current_m_val - (learning_rate * m_deriv)Ĭurrent_b_val = current_b_val - (learning_rate * b_deriv)Ĭost = (1/n)*sum(y_train-y_hypothesis)**2 ![]() Z_deriv = -(2/n)*sum(y_train-y_hypothesis) #calculating the derivatives from the image embedded above in code Ive also attached a screenshot of the data. The red color line is drawn by using OpenGL default GLLINESTRIP, while the greenish line is drawn by using the shader program. E.g.: osg:: DisplaySettings:: instance ()-> setNumMultiSamples (4) Results. Two of the lines from the bottom graph are from the same table as the graphs on top so Im not sure how come it shows lines for one chart and not the other. Note: in order to avoid an aliased look of the shadered lines, we have to enable multi-sampling. ![]() Y_hypothesis = (current_z_val * (x_train**2)) + (current_m_val * x_train) + current_b_val I managed to change it to 'both' and it corrected the bottom graph, but it made the lines in the other graphs disappear. #creating the hypothesis using y=z^2 + mx+b form But in the real world, it’s not as simple as it seems: So, using the zig zag indicator, helps you objectively define these market structures with ease. Plt.title("Example data and hypothesis lines") As you know, there are four types of market structure: Higher highs Higher lows Lower lows Lower highs Of course, it makes perfect sense on the schematic because they look like lines. #calculating length of examples for functions used below X_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3) ![]() Y = x + noise + np.random.randn()*2 + x**2 X_train, x_test, y_train, y_test = train_test_split(X, Y, test_size=0.3) Import seaborn as sns sns.set() # just makes your plots look prettier run 'pip install seaborn'įrom import figsizeįrom sklearn.model_selection import train_test_split The equation on desmos looks exactly how I want it to. I've tried restarting and graphing the same equation on desmos. Click the 'File' menus 'Save' command, then type a filename in the 'Name' text box. Click anywhere inside the zigzag shape to fill with the colour you chose. My line in matplotlib is the correct shape, however, it is made up of zig zagging lines. Click a colour from the palette youd like to fill the zigzag with, then click 'OK' to close the palette.
0 Comments
Read More
Leave a Reply. |