# Load the iris dataset
iris <- read.csv("iris.csv")
str(iris)
# Load the iris dataset
import pandas as pd
iris = pd.read_csv("iris.csv")
print(iris.info())
library(C50)
iris_model <- C5.0(iris_train[-5], iris_train$variety)
from sklearn.tree import DecisionTreeClassifier
iris_model = DecisionTreeClassifier()
iris_model.fit(iris_train.iloc[:, :-1], iris_train.iloc[:, -1])
summary(iris_model)
from sklearn.metrics import classification_report
print(classification_report(iris_test['variety'], iris_predict))
library(arules)
plants <- read.transactions("plants.csv", sep = ",")
summary(plants)
from mlxtend.frequent_patterns import apriori
plants = pd.read_csv("plants.csv")
frequent_itemsets = apriori(plants, min_support=0.0731, use_colnames=True)
print(frequent_itemsets)
Both R and Python are powerful tools for data analysis. R is particularly strong in statistical analysis and visualization, while Python excels in machine learning and general-purpose programming. The choice between R and Python depends on the specific needs of the project and the familiarity of the user with the language.