Linear Regression using Turicreate Last Updated : 23 May, 2024 Comments Improve Suggest changes Like Article Like Report Linear Regression is a method or approach for Supervised Learning.Supervised Learning takes the historical or past data and then train the model and predict the things according to the past results.Linear Regression comes from the word 'Linear' and 'Regression'.Regression concept deals with predicting the future using the past data.Linear means the able to represented by a straight line on graph.Linear Regression has two things one independent variable and other dependent variable and Linear Regression is a relationship between the two. In this article, we are going to learn about how we can implement Linear Regression with the help of Turicreate. Turicreate is Library in Python which helps the beginners to learn and implement Machine Learning Algorithm easily as well as efficiently. Step 1: Importing the Turicreate Library Python3 import turicreate as tc Step 2: Reading the datasets. Python3 """ The good thing about Turicreate is that we don't have import any other library for data loading.Turicreate itself can load data with the help of it's SFrame Data Structure """ data_sets = tc.SFrame("data.csv") Step 3: Exploring the data Python3 # It will display the first few Lines of the data data.head() Output: datasets first few lines Step 4: Make a Linear Regression model . Python3 # We will have a target variable that stores the thing # to the predicted and feature is the list of elements # which we will take for making the model. model = tc.linear_regression.create( data, target ="charges", features =['region']) Step 5: Now evaluate the model Python3 # this will tell us about the max error and # the rmse (root mean squared error) model.evaluate(data) Output: Max error and Rmse Step 6: Now predicting the charges according to the B.M.I of person Python3 # this variable will be containing the data # of person having the bmi 27.9 bmi_person = data[data['bmi']== 27.9] # it will predict the charges for the person with bmi 27.9 model.predict(bmi_person) Output: The Prediction of the charges Create Quiz Comment A abhisheksrivastaviot18 Follow 0 Improve A abhisheksrivastaviot18 Follow 0 Improve Article Tags : Machine Learning AI-ML-DS python Explore Machine Learning BasicsIntroduction to Machine Learning8 min readTypes of Machine Learning7 min readWhat is Machine Learning Pipeline?6 min readApplications of Machine Learning3 min readPython for Machine LearningMachine Learning with Python Tutorial5 min readNumPy Tutorial - Python Library3 min readPandas Tutorial4 min readData Preprocessing in Python4 min readEDA - Exploratory Data Analysis in Python6 min readFeature EngineeringWhat is Feature Engineering?5 min readIntroduction to Dimensionality Reduction4 min readFeature Selection Techniques in Machine Learning4 min readSupervised LearningSupervised Machine Learning7 min readLinear Regression in Machine learning14 min readLogistic Regression in Machine Learning10 min readDecision Tree in Machine Learning8 min readRandom Forest Algorithm in Machine Learning5 min readK-Nearest Neighbor(KNN) Algorithm8 min readSupport Vector Machine (SVM) Algorithm9 min readNaive Bayes Classifiers6 min readUnsupervised LearningWhat is Unsupervised Learning5 min readK means Clustering â Introduction6 min readHierarchical Clustering in Machine Learning6 min readDBSCAN Clustering in ML - Density based clustering6 min readApriori Algorithm6 min readFrequent Pattern Growth Algorithm5 min readECLAT Algorithm - ML5 min readPrincipal Component Analysis (PCA)7 min readModel Evaluation and TuningEvaluation Metrics in Machine Learning9 min readRegularization in Machine Learning5 min readCross Validation in Machine Learning5 min readHyperparameter Tuning5 min readUnderfitting and Overfitting in ML3 min readBias and Variance in Machine Learning6 min readAdvanced TechniquesReinforcement Learning9 min readSemi-Supervised Learning in ML5 min readSelf-Supervised Learning (SSL)6 min readEnsemble Learning8 min readMachine Learning PracticeMachine Learning Interview Questions and Answers15+ min read100+ Machine Learning Projects with Source Code5 min read Like