Bottom Page

• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Machine Learning Polynomial Regression braveYug Programmer named Tim Posts: 8 Threads: 6 Joined: Nov 2017 Reputation: 0 Likes received: 0 #1 Nov-13-2019, 11:41 AM Hello All, I am facing some problem while implementing polynomial regression for my machine learning module. Part of my code is as below: ```poly = PolynomialFeatures(degree = 4) X_poly = poly.fit_transform(X) lin = LinearRegression() lin.fit(X_poly, Y) y_poly_pred = lin.predict(X_poly) plt.scatter(X['Totalizer'], Y, color='red') plt.plot(X['Totalizer'], y_poly_pred, color='b') plt.title('Polynomial Regression') plt.xlabel('Totalizer') plt.ylabel('Temperature') plt.show() rmse = np.sqrt(mean_squared_error(Y,y_poly_pred)) r2 = r2_score(Y,y_poly_pred) print(rmse) print(r2) ```Please also see attached picture :     My question is that my predicted values are completely in line with output(label) but still rmse and r2 are respectively 10.2 & 0.99. Why this rmse and r2 are showing in opposite direction that model is not tuned well? Am I missing something important? « Next Oldest | Next Newest »

Top Page

 Possibly Related Threads... Thread Author Replies Views Last Post Can I evaluate a Chebyshev polynomial using a function player1681 1 187 Nov-22-2019, 06:33 AM Last Post: scidam Ask for machine learning Python example with 2 data files user5566b 2 243 Sep-05-2019, 12:15 PM Last Post: user5566b Confidence intervals over time with polynomial regression jjameson 0 450 May-16-2019, 02:22 PM Last Post: jjameson Using machine learning kingrayd 1 473 Apr-09-2019, 09:29 AM Last Post: micseydel Python - Database for Machine Learning application braveYug 2 712 Mar-04-2019, 10:30 AM Last Post: Shruti7109162 About Machine Learning rajeev1729 3 1,667 Mar-01-2019, 07:41 AM Last Post: rajeev1729 PyCM 1.8 released: Machine learning library for confusion matrix statistical analysis sepandhaghighi 0 544 Jan-05-2019, 12:36 PM Last Post: sepandhaghighi To draw a polynomial solution pianistseb 2 644 Nov-13-2018, 01:45 PM Last Post: pianistseb Machine Learning errors obi95 1 1,144 Mar-14-2018, 09:17 AM Last Post: buran Machine learning SQL injection detection agocomp 3 2,800 Dec-04-2017, 08:32 AM Last Post: agocomp

Forum Jump:

Users browsing this thread: 1 Guest(s)