Welcome!
+This is a test page designed to check HTML to PDF conversion.
+About This Test
+This page includes various HTML elements to check how they appear in the converted PDF.
+Elements to Test
+-
+
- Headings & Paragraphs +
- Navigation & Links +
- Lists & Bullet Points +
- Background Colors & Styling +
- Margins & Spacing +
Need Help?
+For any issues with the HTML to PDF conversion, contact us at: info@example.com
+














+
+
+
+
+
+
+
+
+
+
+
+
+
+This training phase is possible when data points are linear, but there again comes a question can we predict non-linear relationship between x and y ? as shown below
+
+
+
diff --git a/local_weighted_learning/local_weighted_learning.py b/local_weighted_learning/local_weighted_learning.py
new file mode 100644
index 00000000000..193b82da738
--- /dev/null
+++ b/local_weighted_learning/local_weighted_learning.py
@@ -0,0 +1,117 @@
+# Required imports to run this file
+import matplotlib.pyplot as plt
+import numpy as np
+
+
+# weighted matrix
+def weighted_matrix(point: np.mat, training_data_x: np.mat, bandwidth: float) -> np.mat:
+ """
+ Calculate the weight for every point in the
+ data set. It takes training_point , query_point, and tau
+ Here Tau is not a fixed value it can be varied depends on output.
+ tau --> bandwidth
+ xmat -->Training data
+ point --> the x where we want to make predictions
+ """
+ # m is the number of training samples
+ m, n = np.shape(training_data_x)
+ # Initializing weights as identity matrix
+ weights = np.mat(np.eye((m)))
+ # calculating weights for all training examples [x(i)'s]
+ for j in range(m):
+ diff = point - training_data[j]
+ weights[j, j] = np.exp(diff * diff.T / (-2.0 * bandwidth**2))
+ return weights
+
+
+def local_weight(
+ point: np.mat, training_data_x: np.mat, training_data_y: np.mat, bandwidth: float
+) -> np.mat:
+ """
+ Calculate the local weights using the weight_matrix function on training data.
+ Return the weighted matrix.
+ """
+ weight = weighted_matrix(point, training_data_x, bandwidth)
+ W = (training_data.T * (weight * training_data)).I * (
+ training_data.T * weight * training_data_y.T
+ )
+ return W
+
+
+def local_weight_regression(
+ training_data_x: np.mat, training_data_y: np.mat, bandwidth: float
+) -> np.mat:
+ """
+ Calculate predictions for each data point on axis.
+ """
+ m, n = np.shape(training_data_x)
+ ypred = np.zeros(m)
+
+ for i, item in enumerate(training_data_x):
+ ypred[i] = item * local_weight(
+ item, training_data_x, training_data_y, bandwidth
+ )
+
+ return ypred
+
+
+def load_data(dataset_name: str, cola_name: str, colb_name: str) -> np.mat:
+ """
+ Function used for loading data from the seaborn splitting into x and y points
+ """
+ import seaborn as sns
+
+ data = sns.load_dataset(dataset_name)
+ col_a = np.array(data[cola_name]) # total_bill
+ col_b = np.array(data[colb_name]) # tip
+
+ mcol_a = np.mat(col_a)
+ mcol_b = np.mat(col_b)
+
+ m = np.shape(mcol_b)[1]
+ one = np.ones((1, m), dtype=int)
+
+ # horizontal stacking
+ training_data = np.hstack((one.T, mcol_a.T))
+
+ return training_data, mcol_b, col_a, col_b
+
+
+def get_preds(training_data: np.mat, mcol_b: np.mat, tau: float) -> np.ndarray:
+ """
+ Get predictions with minimum error for each training data
+ """
+ ypred = local_weight_regression(training_data, mcol_b, tau)
+ return ypred
+
+
+def plot_preds(
+ training_data: np.mat,
+ predictions: np.ndarray,
+ col_x: np.ndarray,
+ col_y: np.ndarray,
+ cola_name: str,
+ colb_name: str,
+) -> plt.plot:
+ """
+ This function used to plot predictions and display the graph
+ """
+ xsort = training_data.copy()
+ xsort.sort(axis=0)
+ plt.scatter(col_x, col_y, color="blue")
+ plt.plot(
+ xsort[:, 1],
+ predictions[training_data[:, 1].argsort(0)],
+ color="yellow",
+ linewidth=5,
+ )
+ plt.title("Local Weighted Regression")
+ plt.xlabel(cola_name)
+ plt.ylabel(colb_name)
+ plt.show()
+
+
+if __name__ == "__main__":
+ training_data, mcol_b, col_a, col_b = load_data("tips", "total_bill", "tip")
+ predictions = get_preds(training_data, mcol_b, 0.5)
+ plot_preds(training_data, predictions, col_a, col_b, "total_bill", "tip")
diff --git a/login.py b/login.py
new file mode 100644
index 00000000000..d4844b261f1
--- /dev/null
+++ b/login.py
@@ -0,0 +1,51 @@
+import os
+from getpass import getpass
+
+
+# Devloped By Black_angel
+# This is Logo Function
+def logo():
+ print(" ──────────────────────────────────────────────────────── ")
+ print(" | | ")
+ print(" | ######## ## ######### ## ## ### | ")
+ print(" | ## ## ## ## ## ## ## ## | ")
+ print(" | ## ### ## ## ## ## ## ## | ")
+ print(" | ## ### ## ######### ########### ########## | ")
+ print(" | ## ### ## ## ## ## ## ## | ")
+ print(" | ## ## ## ## ## ## ## ## | ")
+ print(" | ######## ## ######### ## ## ## ## | ")
+ print(" | | ")
+ print(" \033[1;91m| || Digital Information Security Helper Assistant || | ")
+ print(" | | ")
+ print(" ──────────────────────────────────────────────────────── ")
+ print("\033[1;36;49m")
+
+
+# This is Login Function
+def login():
+ # for clear the screen
+ os.system("clear")
+ print("\033[1;36;49m")
+ logo()
+ print("\033[1;36;49m")
+ print("")
+ usr = input("Enter your Username : ")
+ # This is username you can change here
+ usr1 = "raj"
+ psw = getpass("Enter Your Password : ")
+ # This is Password you can change here
+ psw1 = "5898"
+ if usr == usr1 and psw == psw1:
+ print("\033[1;92mlogin successfully")
+ os.system("clear")
+ print("\033[1;36;49m")
+ logo()
+ else:
+ print("\033[1;91m Wrong")
+
+ login()
+
+
+# This is main function
+if __name__ == "__main__":
+ login()
diff --git a/logs.py b/logs.py
index 2fdf209e9c8..11d9d041dd1 100644
--- a/logs.py
+++ b/logs.py
@@ -9,15 +9,19 @@
#
# Description : This script will search for all *.log files in the given directory, zip them using the program you specify and then date stamp them
-import os # Load the Library Module
-from time import strftime # Load just the strftime Module from Time
+import os # Load the Library Module
+from time import strftime # Load just the strftime Module from Time
-logsdir = "c:\puttylogs" # Set the Variable logsdir
-zip_program = "zip.exe" # Set the Variable zip_program - 1.1
+logsdir = r"c:\puttylogs" # Set the Variable logsdir
+zip_program = "zip.exe" # Set the Variable zip_program - 1.1
-for files in os.listdir(logsdir): # Find all the files in the directory
- if files.endswith(".log"): # Check to ensure the files in the directory end in .log
- files1 = files + "." + strftime("%Y-%m-%d") + ".zip" # Create the Variable files1, this is the files in the directory, then we add a suffix with the date and the zip extension
- os.chdir(logsdir) # Change directory to the logsdir
- os.system(zip_program + " " + files1 +" "+ files) # Zip the logs into dated zip files for each server. - 1.1
- os.remove(files) # Remove the original log files
+for files in os.listdir(logsdir): # Find all the files in the directory
+ if files.endswith(".log"): # Check to ensure the files in the directory end in .log
+ files1 = (
+ files + "." + strftime("%Y-%m-%d") + ".zip"
+ ) # Create the Variable files1, this is the files in the directory, then we add a suffix with the date and the zip extension
+ os.chdir(logsdir) # Change directory to the logsdir
+ os.system(
+ zip_program + " " + files1 + " " + files
+ ) # Zip the logs into dated zip files for each server. - 1.1
+ os.remove(files) # Remove the original log files
diff --git a/longest_increasing_subsequence_length.py b/longest_increasing_subsequence_length.py
new file mode 100644
index 00000000000..a2244cffdf5
--- /dev/null
+++ b/longest_increasing_subsequence_length.py
@@ -0,0 +1,23 @@
+"""
+Author- DIWAKAR JAISWAL
+find lenth Longest increasing subsequence of given array.
+"""
+
+
+def lis(a):
+ n = len(a)
+ # initialize ans array same lenth as 1
+ ans = [1] * n
+ for i in range(1, n):
+ # now compare with first index to that index
+ for j in range(i):
+ if a[i] > a[j] and ans[i] < ans[j] + 1:
+ ans[i] = ans[j] + 1
+ return max(ans)
+
+
+a = [1, 3, 2, 6, 4]
+
+# longest increasing subsequence=[{1<3<6},{1<3<4},{1<2<6},{1<2<4}] length is 3
+
+print("Maximum Length of longest increasing subsequence ", lis(a))
diff --git a/loops.py b/loops.py
new file mode 100644
index 00000000000..985ffb8af4e
--- /dev/null
+++ b/loops.py
@@ -0,0 +1,40 @@
+# 2 loops
+
+# for loop:
+
+"""
+Syntax..
+-> "range" : starts with 0.
+-> The space after the space is called as identiation, python generally identifies the block of code with the help of indentation,
+indentation is generally 4 spaces / 1 tab space..
+
+
+for