RPubs will retire in June 2027. Your existing documents will stay accessible through December 31, 2031
and Connect Cloud is the recommended home for new publishing. Read the blog post

Recently Published

IMAGE DATASET
Plot
Neural Network and its Structure
This R Markdown script sets up a neural network using the `neuralnet` package to approximate the square root of the sum of two input values. The training data is randomly generated, with each input feature scaled from 0 to 100. The neural network configuration has one hidden layer with three nodes, and the trained model's structure is visualized at the end.
MACHINE LEARNING ASSIGNMENT
The R code implements an image classification pipeline that includes data loading, exploratory analysis, logistic regression, clustering, and neural network modeling. It begins by loading images from a directory, resizing them, and organizing the data into a structured format. The dataset is explored using summary statistics. A multinomial logistic regression model is fitted after applying PCA for dimensionality reduction. Clustering techniques, including hierarchical clustering and K-means, are used to assess data groupings. Finally, a neural network model is developed to predict classes based on varying hidden layer sizes, and accuracy metrics are computed to evaluate model performance.
NEURAL NETWORK
This R code demonstrates the creation and training of a simple neural network using synthetic data. It begins by setting up the environment and installing necessary libraries, including neuralnet, tidyverse, and GGally. Random training data is generated with two input features and an output representing the square root of the sum of the squares of the inputs. A neural network with one hidden layer of three neurons is defined and trained on this data. The training results are printed, and the structure of the trained neural network is visualized, showcasing foundational concepts in neural network modeling.
Technical Document - Password Strength Checker
## Script Explanation 1. check_password_strength(password): This function checks the password based on specific criteria and assigns a score. 2. give_feedback(...): This function provides feedback to help improve weak passwords. 3. main(): This function takes user input, evaluates the password strength, and displays feedback.
Praktikum 5 APG
Fruits_Prediction
Neural Networks
The code demonstrates how to build a simple neural network in R. It starts by installing and loading necessary libraries. Random input data is generated, and the output is computed as the square root of the sum of inputs. The input and output are combined into a dataframe, and a neural network is configured with one hidden layer containing three neurons. The network is trained to predict the output based on the inputs, with training stopping when the error is below a set threshold. Finally, the trained network's results are printed and visualized with a plot for further analysis.
HABERMAN SURVIVAL DATASET
The RMarkdown file is well-structured and includes comprehensive sections on loading the dataset, logistic regression, clustering, and neural networks. Here’s the summary : Library Installation and Loading: Installed and loaded essential R packages for image processing (imager, EBImage), data manipulation (dplyr, tidyverse), and modeling (caret, nnet). Dataset Preparation: Loaded images from a specified directory, resizing them for uniformity. Created a data frame containing the labels (derived from folder names) and the resized image data. Exploratory Data Analysis: Analyzed the dataset's structure, dimensions, and class distributions to understand the data better. Logistic Regression: Flattened the image data and performed normalization. Applied PCA for dimensionality reduction, retaining components that explain 95% of the variance. Split the dataset into training and testing sets, trained a multinomial logistic regression model, and evaluated its performance using accuracy and a confusion matrix. Clustering: Assessed the clusterability of the data with the Hopkins statistic. Conducted hierarchical clustering and visualized the results using a dendrogram. Implemented K-means clustering and visualized clusters based on the first two PCA components. Neural Networks: Defined a function to fit a neural network model and calculate accuracy. Evaluated models with varying hidden neuron sizes to determine the best configuration.
ch9_measurement