Posts

what is good dataset?

Image
    First things first, we need  to learn how to identify good data set! .I can make it easy for you  acronyms:                                                                            R-O-C-C-C                                                                                                                        R for reliable.       Like a good friend, good data sources are ...

image clustering technique using Kmeans

Image
 Kmeans algorithm is widely used to cluster image i.e grouping the image as per the color.  Kmeans basically use the technique to form a cluster by making decision boundry the code below will help you to get the proper grip on the idea. code import numpy as np import cv2 import matplotlib.pyplot as plt original_image = cv2.imread("/content/sample_data/ocen.png") original_image this few lines is importing essential lib. and uploading the image to see the cluster image of it. img=cv2.cvtColor(original_image,cv2.COLOR_BGR2RGB) #Next, converts the MxNx3 image into a Kx3 matrix where K=MxN and each row is now a vector in the 3-D space of RGB. vectorized = img.reshape(( -1 , 3 )) #We convert the unit8 values to float as it is a requirement of the k-means method of OpenCV. vect...

whats the difference between insert and append ? with python code.

"insert" and "append" method in list in Python bigginer basically get confused when to use insert and append method in list. heras is the very simple understanding format of  it.   insert: to add some element in the list at certain position. append: to add element in the list. code: append ................................................................................................................... shop=['bread','banana','egg'] shop.append("apple") print(shop) output: ['bread', 'banana', 'egg', 'apple'] ..................................................................... insert: python code: shop.insert(2,"lemmon") shop output: ['bread', 'banana', 'lemmon', 'egg', 'apple']  

lest just create a basic bot operation in python

 hers the code ....................................python code ...................................................................... name=(input("whats your name :")) print("hello",name) ans=(input("have you thought of black hole today: say yess or no!")) print("iam so glad you said {}, I was thinking the same thing".format(ans)) ........................................................................................................................ output: whats your name :animesh hello animesh have you thought of black hole today: say yess or no!yess! iam so glad you said yess!, I was thinking the same thing hears another: ...........................................python code .......................................................................... #print("how intillegenat are you in the range of 0-10?:") x=(int(input("how intillegenat are you in the range of 0-10?:"))) if (x>=5 and x<=10):     print("you are in...

rock paper scisor game

for the exact code: https://github.com/animeesh/game-rock-paper-scissor code  random lib is used to get the random value  import random #input_list = ["Rock", "Paper", "Scissor"] while True:     input_user = input("Select the input: ")     print (input_user)      possible_action=["rock","paper","scissor"]     computer_action=random.choice(possible_action)          print(f"\nyou chose :{input_user},computer chose :{computer_action}.\n")     #hear starts the real technique     if input_user ==computer_action:         print(f"both player selected {input_user}.hence its a tie!")     elif input_user== "rock":         if computer_action=="scissor":             print("rock smashes scissor! you win")         else:             print("paper covers the rock! you lose") ...

using your age and duration of workout finding how much calories you burned!

dataset: https://www.kaggle.com/fmendes/fmendesdat263xdemos/download ......................................................................................................................................................... import pandas as  pd import matplotlib.pyplot as plt import numpy as np import pickle  from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression df_calories=pd.read_csv("ineuron/calories.csv") df_exercise=pd.read_csv("ineuron/exercise.csv") data=df_exercise.merge(df_calories, on='User_ID') #print(data.head()) #[:,0:-1] all rows and all expect last column (independent  variable) also feature column #data_x = data.iloc[:,:-1].values data_x= df.loc[:,[ 'Weight','Age','Duration']] data_y=df.iloc[:,-1] #[:,-1]all rows and only last column (dependent variable) also target column #data_y = data.iloc[:,-1].values x_train,x_test,y_train,y_test = train_test_split(data_x,data_y,test...

Logestic Regression

In [18]: import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split df = pd . read_csv ( "framingham_heart_disease.csv" ) df . head () Out[18]: male age education currentSmoker cigsPerDay BPMeds prevalentStroke prevalentHyp diabetes totChol sysBP diaBP BMI heartRate glucose TenYearCHD 0 1 39 4.0 0 0.0 0.0 0 0 0 195.0 106.0 70.0 26.97 80.0 77.0 0 1 0 46 2.0 0 0.0 0.0 0 0 0 250.0 121.0 81.0 28.73 95.0 76.0 0 2 1 48 1.0 1 20.0 0.0 0 0 0 245.0 127.5 80.0 25.34 75.0 70.0 0 3 0 61 3.0 1 30.0 0.0 0 1 0 225.0 150.0 95.0 28.58 65.0 103.0 1 4 0 46 3.0 1 23.0 0.0 0 0 0 285.0 130.0 84.0 23.10 85.0 85.0 0 In [5]: df . describe () Out[5]: male age education currentSmoker cigsPerDay BPMeds prevalentStroke prevalentHyp diabetes totChol sysBP diaBP BMI heartRate glucose TenYearCHD count 4238.000000 4238.000000 4133.000000 4238.000000 4209.000000 4185.000000 4238.000000 4238.000000 4238.000000 4188.000000 423...