Skip to content

Instantly share code, notes, and snippets.

View codeperfectplus's full-sized avatar
🟢
Online

Deepak Raj codeperfectplus

🟢
Online
View GitHub Profile
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix
iris = load_iris()
X = iris.data
y = iris.target
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=24)
from sklearn.datasets import make_regression
X, y = make_regression(n_samples=100, n_features=1, noise=0.1)
def LinearRegression(X, y, m_current=0, b_current=0, epochs=2000, learning_rate = 0.001):
N = float(len(y))
for i in range(epochs):
y_current = m_current * X + b_current
m_gradient = (-2/N) * sum(y-y_current) * X
b_gradient = (-2/N) * sum(y-y_current)
import random
compScore = 0
playerScore = 0
def ShowScore():
print("-" * 80)
print(
f"################ Computer Score : {compScore} ################"

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
## Importing the Libraries
import pandas as pd
import matplotlib.pyplot as plt
## Importing the dataset
data = pd.read_csv("https://raw.githubusercontent.com/codePerfectPlus/DataAnalysisWithJupyter/master/SalaryVsExperinceModel/Salary.csv")
X = data.iloc[:, :-1].values
y = data.iloc[:, -1].values
data.head()
## Importing the necessary Libraries
import pandas as pd
import matplotlib.pyplot as plt
## Importing the datasert
data = pd.read_csv("https://raw.githubusercontent.com/codePerfectPlus/DataAnalysisWithJupyter/master/SalaryVsExperinceModel/Salary.csv")
X = data.iloc[:, :-1].values
y = data.iloc[:, -1].values
data.head()
## Splitting the dataset into the Training set and Test set
from sklearn.model_selection import train_test_split
train_X, test_X, train_y, test_y = train_test_split(X, y, test_size = 0.3, random_state=12)
## Fit and Predict Model
from sklearn.linear_model import LinearRegression
lr = LinearRegression()
lr.fit(train_X, train_y)
predicted_y = lr.predict(test_X)
## Comparing the Test Set with Predicted Values
df = pd.DataFrame({'Real Values':test_y,"Predict Value":predicted_y})
df.head()
## Step 6: Visualising the Test set results
plt.scatter(test_X, test_y, color = 'red')
plt.scatter(test_X, predicted_y, color = 'green')
plt.plot(train_X, lr.predict(train_X), color = 'black')
plt.title('Salary vs Experience (Result)')
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
BOTNAME = "Jarvis"
def start():
bot = ChatBot(BOTNAME,
logic_adapters=[
{
'import_path': 'chatterbot.logic.BestMatch',