Ejemplo n.º 1
0
 def plot_learning_curves(self):
     warnings.filterwarnings("ignore")
     title = "Learning Curves NeuralNetwork"
     cv = ShuffleSplit(n_splits=5, test_size=0.2, random_state=0)
     estimator = self.get_pure_model()
     Learning_curve_plotter(estimator, title, self.data.X, self.data.Y, cv=cv)
     plt.show()
Ejemplo n.º 2
0
 def learning_curves(self):
     warnings.filterwarnings("ignore")
     title = "Learning Curves NeuralNetwork"
     cv = ShuffleSplit(n_splits=5, test_size=0.2, random_state=0)
     estimator = self.get_pure_model()
     Learning_curve_plotter(estimator, title, self.data.X, self.data.Y, cv=cv)
     bytes_image = io.BytesIO()
     plt.savefig(bytes_image, format='png')
     bytes_image.seek(0)
     return bytes_image
Ejemplo n.º 3
0
 def learning_curves(self):
     warnings.filterwarnings("ignore")
     title = "Learning Curves LinearRegression"
     cv = ShuffleSplit(n_splits=50, test_size=0.2, random_state=0)
     estimator = linear_model.LinearRegression()
     Learning_curve_plotter(estimator, title, self.data.X, self.data.Y, cv=cv)
     bytes_image = io.BytesIO()
     plt.savefig(bytes_image, format='png')
     bytes_image.seek(0)
     return bytes_image
Ejemplo n.º 4
0
 def plot_learning_curves(self):
     """
     Plots the learning curves of the model..
     """
     warnings.filterwarnings("ignore")
     title = "Learning Curves LinearRegression"
     cv = ShuffleSplit(n_splits=50, test_size=0.2, random_state=0)
     estimator = linear_model.LinearRegression()
     Learning_curve_plotter(estimator, title, self.data.X, self.data.Y, cv=cv)
     plt.show()
Ejemplo n.º 5
0
 def plot_learning_curves(self):
     warnings.filterwarnings("ignore")
     title = "Learning Curves Lasso"
     cv = ShuffleSplit(n_splits=50, test_size=0.2, random_state=0)
     estimator = linear_model.Lasso(alpha=1.0)
     Learning_curve_plotter(estimator,
                            title,
                            self.data.X,
                            self.data.Y,
                            cv=cv)
     plt.show()
Ejemplo n.º 6
0
 def plot_learning_curves(self):
     warnings.filterwarnings("ignore")
     title = "Learning Curves ElasticNet"
     cv = ShuffleSplit(n_splits=50, test_size=0.2, random_state=0)
     estimator = ElasticNetModel(alpha=0.1)
     Learning_curve_plotter(estimator,
                            title,
                            self.data.X,
                            self.data.Y,
                            cv=cv)
     plt.show()
Ejemplo n.º 7
0
 def plot_learning_curves(self):
     warnings.filterwarnings("ignore")
     title = "Learning Curves RandomForest"
     cv = ShuffleSplit(n_splits=5, test_size=0.2, random_state=0)
     estimator = RandomForestRegressor(max_depth=2, random_state=0)
     Learning_curve_plotter(estimator,
                            title,
                            self.data.X,
                            self.data.Y,
                            cv=cv)
     plt.show()
Ejemplo n.º 8
0
 def plot_learning_curves(self):
     warnings.filterwarnings("ignore")
     title = "Learning Curves DecisionTree"
     cv = ShuffleSplit(n_splits=50, test_size=0.2, random_state=0)
     estimator = tree.DecisionTreeRegressor()
     Learning_curve_plotter(estimator,
                            title,
                            self.data.X,
                            self.data.Y,
                            cv=cv)
     plt.show()
Ejemplo n.º 9
0
 def learning_curves(self):
     warnings.filterwarnings("ignore")
     title = "Learning Curves ElasticNet"
     cv = ShuffleSplit(n_splits=50, test_size=0.2, random_state=0)
     estimator = ElasticNetModel(alpha=1.0)
     Learning_curve_plotter(estimator,
                            title,
                            self.data.X,
                            self.data.Y,
                            cv=cv)
     bytes_image = io.BytesIO()
     plt.savefig(bytes_image, format='png')
     bytes_image.seek(0)
     return bytes_image
Ejemplo n.º 10
0
 def learning_curves(self):
     warnings.filterwarnings("ignore")
     title = "Learning Curves RandomForest"
     cv = ShuffleSplit(n_splits=5, test_size=0.2, random_state=0)
     estimator = RandomForestRegressor(max_depth=2, random_state=0)
     Learning_curve_plotter(estimator,
                            title,
                            self.data.X,
                            self.data.Y,
                            cv=cv)
     bytes_image = io.BytesIO()
     plt.savefig(bytes_image, format='png')
     bytes_image.seek(0)
     return bytes_image