Wednesday, May 24, 2023

Create a Decision Tree Chart in R Language based on One Variable

--The Data is in Excel file, first we are installing required libraries, if not already done.

--Our Target variable is Income, here in this code example.


install.packages("rpart")

install.packages("rpart.plot")

install.packages("readxl")


library(rpart)

library(rpart.plot)

library(readxl)


data = read_excel("C:\\Users\\Khan\\Downloads\\customer_dbase (1).xlsx")


selected_data <- customer_dbase[, c("age", "income")]


tree_model <- rpart(income ~ ., data = selected_data)


rpart.plot(tree_model)

Monday, May 15, 2023

Python Word Cloud

 #Use below Simple Python Code to create Word Cloud Chart based on text saved in a TXT File

#Replace File path in below code

#Replace or Add the stop words that you want to remove along standard stop words

#Change the Max words (from current 30) as per your need


from wordcloud import WordCloud, STOPWORDS

import matplotlib.pyplot as plt

file = open(r"C:\Users\Khan\Desktop\stopwords.txt", errors='ignore')

text = file.read()

stopwords = set(STOPWORDS)

stopwords.update(["drink", "now", "wine", "flavor", "flavors"])

wordcloud = WordCloud(max_words=30, stopwords = stopwords, background_color="white").generate(text)

plt.imshow(wordcloud, interpolation='bilinear')

plt.axis("off")

plt.show()

Monday, May 16, 2022

Post your add for free (Sell a Product/Service)

Post free classified Ads, fill the form appearing on left side or simply email to amiqullah@gmail.com your ad request with details

 Want to post a free Ad?

Please fill the form appearing on your right side, once submitted in 24 Hrs. the site admin will contact you for any further detail i.e. images and will confirm when your Ad is live.

In the Message box, you can mention your contact no., product description and city/area.

Jobs

Electronics & Appliances
Real Estate

Your Safety information


  • This site is never involved in any transaction, and does not handle payments, shipping, guarantee transactions, provide escrow services, or offer "buyer protection" or "seller certification".
  • Make yourself aware of common scams and fraud.
  • When buying or selling, you should meet in-person to see the product at a safe location.
  • Never send or wire money to sellers.
  • Don't accept cashier cheques from outside your country.