Posts

Showing posts with the label Scikit-learn

Linear Regression Prediction of future values in Python using Scatter Plot - Machine Learning

Image
We are Importing Necessary Libraries for this project  import pandas as pandas  import numpy as numpy  import matplotlib.pyplot as pyplot  from sklearn.linear_model import LinearRegression Importing Data using Pandas library and creating table dataframe data = pandas.read_csv('python_linear_regression_prediction_python_data.csv')  print(data) Assigning Input / Independent columns to X variable and Assigning Output / Dependent Column to Y Variable x = data[['Experience_Years','Calls_Made','Meetings_Conducted']]  y = data['Sales_Amount'] Asking Linear Regression Model to learn data from X and Y variables model = LinearRegression() model.fit(x,y) Printing Coefficient and Intercept to check their values print("Coefficient:",model.coef_)  print("Intercept",model.intercept_) Adding New Inputs / Independent Values to predict Output / Dependent values new_data = pandas.DataFrame({ 'Experience_Years': [8, 12, 15], '...

Scikit-learn Library for Data Science and Machine Learning

Image
Scikit-learn is a Python library for Machine Learning . It has  tools to create models, train data and test models for predicting or classifying data. Why Scikit-learn is used in Python for Data Science: It has Simple functions to train models and make predictions. It Supports many algorithms: Linear Regression, Decision Trees, Random Forest, K-Nearest Neighbors, Clustering, etc. Test Model and Provides metrics like accuracy, r-squared, mean squared error. Prepare data with  Scaling, encoding, splitting data into train / test datasets. Works with NumPy , Pandas , and Matplotlib easily.