From the course: Develop ML Models with Python and T-SQL
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Demo: Using the model for linear regression predictions
From the course: Develop ML Models with Python and T-SQL
Demo: Using the model for linear regression predictions
- [Instructor] The next example will utilize the model that's already stored in the database. As we see here, demo 1B utilizes the pyodbc, pandas and pickle modules. We're going to be connecting to the database using pyodbc, and as we had done in the previous example, we had also specified our server name as well as our database name. In addition, after we establish the connection, we're going to create a cursor object and then we're going to utilize that to select from the models. You'll notice that I stipulated select top one model from the models table. And the reason for that is if we're maintaining version history and we're updating that table with various models over time, we want to select the best that's available. And so we're selecting the top model that has the name of LR model, and this is because we're sorting it by created date descending. We check to see that that row exists, and once it's retrieved, we then utilize the pickle module to be able to load that byte data…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Project overview1m 23s
-
Demo: Training the model for linear regression4m 15s
-
(Locked)
Demo: Using the model for linear regression predictions2m 22s
-
(Locked)
Demo: Loading classification data2m 7s
-
(Locked)
Demo: Training and using the model for classification predictions3m 45s
-
(Locked)
Demo: Loading data for sentiment analysis2m 31s
-
(Locked)
Demo: Training and using the model for sentiment analysis predictions3m 47s
-
(Locked)
Demo: Loading housing data for pipeline, cross validation, and hyperparameters1m 10s
-
(Locked)
Demo: Using data for pipeline, cross validation, and hyperparameters5m 32s
-
(Locked)
-