<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: JinChul Moon</title>
    <description>The latest articles on DEV Community by JinChul Moon (@creative_moon).</description>
    <link>https://dev.to/creative_moon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2965068%2F252782a7-1e40-4394-abde-e7dcb754118d.jpg</url>
      <title>DEV Community: JinChul Moon</title>
      <link>https://dev.to/creative_moon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/creative_moon"/>
    <language>en</language>
    <item>
      <title>Creating Dynamic Pages with Next.js and Fetching Data from a REST API</title>
      <dc:creator>JinChul Moon</dc:creator>
      <pubDate>Sun, 23 Mar 2025 04:45:06 +0000</pubDate>
      <link>https://dev.to/creative_moon/creating-dynamic-pages-with-nextjs-and-fetching-data-from-a-rest-api-55l4</link>
      <guid>https://dev.to/creative_moon/creating-dynamic-pages-with-nextjs-and-fetching-data-from-a-rest-api-55l4</guid>
      <description>&lt;p&gt;In this tutorial, we’ll go over how to create dynamic pages in Next.js using React and REST API integration. This approach allows us to fetch data dynamically and render it on the page.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating the REST API Endpoint in WordPress&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First, we use WordPress to expose a REST API that provides our content. In this case, we are fetching portfolio items via the API endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://creative-moon.com/wp-json/wp/v2/portfolio?per_page=100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This endpoint returns a list of portfolio items, which we can then use in Next.js to render pages dynamically.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fetching Data in Next.js with getStaticPaths and getStaticProps&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Next, we use getStaticPaths and getStaticProps in Next.js to generate dynamic pages based on the fetched data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/pages/works/[slug].tsx

import { GetStaticProps, GetStaticPaths } from 'next';

export const getStaticPaths: GetStaticPaths = async () =&amp;gt; {
  const res = await fetch('https://creative-moon.com/wp-json/wp/v2/portfolio?per_page=100');
  const posts = await res.json();

  // Generating paths based on the slug
  const paths = posts.map((post: any) =&amp;gt; ({
    params: { slug: post.slug },
  }));

  return {
    paths,
    fallback: 'blocking',  // The page will wait to be generated before serving
  };
};

export const getStaticProps: GetStaticProps = async ({ params }) =&amp;gt; {
  const res = await fetch(`https://creative-moon.com/wp-json/wp/v2/portfolio?slug=${params?.slug}`);
  const postData = await res.json();

  if (!postData || postData.length === 0) {
    return { notFound: true };  // Return 404 if no data is found
  }

  const post = postData[0];

  return {
    props: { post },
    revalidate: 60,  // Revalidate the page every 60 seconds
  };
};

const WorkDetail = ({ post }: { post: any }) =&amp;gt; {
  if (!post) return &amp;lt;div&amp;gt;Loading...&amp;lt;/div&amp;gt;;  // Show loading if the data is still fetching

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;{post.title.rendered}&amp;lt;/h1&amp;gt;
      &amp;lt;div&amp;gt;{post.content.rendered}&amp;lt;/div&amp;gt;  {/* Render the content fetched from the API */}
    &amp;lt;/div&amp;gt;
  );
};

export default WorkDetail;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Explanation of getStaticPaths and getStaticProps&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;getStaticPaths: This function is responsible for generating dynamic routes. It fetches data from the REST API, extracts the slug for each post, and uses it to generate paths that Next.js will build statically.&lt;/li&gt;
&lt;li&gt;getStaticProps: This function fetches the data for a specific post based on the slug. It fetches content dynamically from the REST API and passes it as props to the page component.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Rendering Dynamic Pages&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With Next.js, dynamic pages are created based on the slug of each portfolio post. The title and content of each post are fetched from the API and displayed on the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Inside the WorkDetail component
const WorkDetail = ({ post }: { post: any }) =&amp;gt; {
  if (!post) return &amp;lt;div&amp;gt;Loading...&amp;lt;/div&amp;gt;;

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;{post.title.rendered}&amp;lt;/h1&amp;gt;  // Dynamically render post title
      &amp;lt;div&amp;gt;{post.content.rendered}&amp;lt;/div&amp;gt;  // Dynamically render post content
    &amp;lt;/div&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Final Outcome&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;When navigating to &lt;a href="http://localhost:3000/works/%7Bslug%7D" rel="noopener noreferrer"&gt;http://localhost:3000/works/{slug}&lt;/a&gt;, Next.js will fetch the data from the REST API and display the content dynamically on the page.&lt;/li&gt;
&lt;li&gt;This method allows Next.js to generate static pages based on dynamic data fetched from WordPress.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;By using this method, you can easily fetch and render dynamic content from REST APIs in Next.js, making it ideal for headless CMS like WordPress. The combination of static generation and server-side rendering in Next.js powers this integration effectively.&lt;/p&gt;

&lt;p&gt;I spent hours today troubleshooting a small issue with pages/works/[slug].tsx. It turned out to be a simple path problem, but after checking and fixing the file structure, everything started working as expected. It was frustrating but rewarding to finally resolve it!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Excited to Dive into React, Next.js, and GSAP!</title>
      <dc:creator>JinChul Moon</dc:creator>
      <pubDate>Sat, 22 Mar 2025 15:43:57 +0000</pubDate>
      <link>https://dev.to/creative_moon/excited-to-dive-into-react-nextjs-and-gsap-40ij</link>
      <guid>https://dev.to/creative_moon/excited-to-dive-into-react-nextjs-and-gsap-40ij</guid>
      <description>&lt;p&gt;Today, I’m absolutely thrilled to share that I’ve learned some fantastic new skills! I’ve been diving into React and Next.js, and it feels amazing to be able to build dynamic, modern web applications with these tools. I’m also integrating GSAP for smooth animations and interactions—it’s a game-changer!&lt;/p&gt;

&lt;p&gt;The best part? I’ve moved away from WordPress and am now embracing native development (in the true sense!). It’s been such an exciting journey, and I’m finally in control of the entire stack. Starting from the very basics, I set up my React and Next.js environment, ensuring everything was organized right from the start. Here’s how I approached the process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setting up React and Next.js&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I began with a clean slate, installing React and Next.js and configuring the folder structure properly to keep everything organized:&lt;/p&gt;

&lt;p&gt;npx create-next-app@latest my-project --typescript&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Folder Structure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I’ve set up a clear and structured folder layout to keep my project organized as it grows. Here’s what I’ve structured so far:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/app
  ├── /components        # All reusable components
  ├── /pages            # Page-level components, including Home, About, etc.
  ├── /styles           # SCSS/CSS files
  ├── /public           # Static assets like images
  └── /utils            # Utility functions and helpers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By organizing my project like this, I can easily maintain and scale it without getting lost in the code. Everything is modular and easy to find.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Integrating GSAP for Smooth Animations&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On top of setting up the project and structure, I’ve been integrating GSAP to add dynamic animations to the page. Here’s a sample of how I used GSAP to animate text when it appears on scroll:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useEffect } from 'react';
import { gsap } from 'gsap';
import ScrollTrigger from 'gsap/ScrollTrigger';

gsap.registerPlugin(ScrollTrigger);

export default function HomePage() {
  useEffect(() =&amp;gt; {
    const homeTitle = document.querySelector('.home-intro-top__title');
    const aniTitle = document.querySelector('.home-intro-top__ani');
    const baseTitle = document.querySelector('.home-intro-top__base');

    if (homeTitle &amp;amp;&amp;amp; aniTitle &amp;amp;&amp;amp; baseTitle) {
      const words = baseTitle.innerText.trim().split(' ');

      // Wrap each word in a div for animation
      aniTitle.innerHTML = words.map(word =&amp;gt;
        `&amp;lt;div class="home-intro-top__word"&amp;gt;
          &amp;lt;div class="home-intro-top__word-child"&amp;gt;${word}&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;`
      ).join(' ');

      // GSAP animation
      const wordElements = aniTitle.querySelectorAll('.home-intro-top__word');
      wordElements.forEach((word, index) =&amp;gt; {
        gsap.fromTo(
          word,
          { opacity: 0, y: 50 },
          { opacity: 1, y: 0, delay: index * 0.1, duration: 0.8 }
        );
      });
    }

    ScrollTrigger.refresh();
  }, []);

  return (
    &amp;lt;div className="home-intro-top__title"&amp;gt;
      &amp;lt;div className="home-intro-top__ani"&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;div className="home-intro-top__base"&amp;gt;Transform Ideas into Fluid Digital Solutions&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The Excitement of Native Development&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I’ve always wanted to get into native development, and now I feel like I’ve made that transition! Moving away from WordPress and embracing React and Next.js means I get to create custom, scalable web apps from scratch. And what better way to start than by working on my personal homepage?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What’s Next?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is just the beginning. Now that I’ve gotten the hang of React, Next.js, and GSAP, I’m eager to take on more commercial and public projects. I want to build websites that are not only functional but also visually dynamic and user-friendly.&lt;/p&gt;

&lt;p&gt;I’m super pumped about what’s coming next, and I can’t wait to challenge myself with more complex projects. These new tools and techniques are opening up endless possibilities, and I’m ready to dive even deeper into native development.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building a House Price Prediction Model with FastAPI and Deployment</title>
      <dc:creator>JinChul Moon</dc:creator>
      <pubDate>Sat, 22 Mar 2025 15:42:21 +0000</pubDate>
      <link>https://dev.to/creative_moon/building-a-house-price-prediction-model-with-fastapi-and-deployment-50gn</link>
      <guid>https://dev.to/creative_moon/building-a-house-price-prediction-model-with-fastapi-and-deployment-50gn</guid>
      <description>&lt;p&gt;In the previous post, we built a Random Forest model to predict house prices using the Toronto housing dataset. Now, let’s move forward by creating a FastAPI web application to serve this model and deploy it so others can interact with it. Below, I’ll guide you through the process of creating the FastAPI application, setting up Nginx as a reverse proxy, and deploying the model on AWS EC2.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setting Up the FastAPI Application&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First, we need to set up the FastAPI app that will serve our machine learning model. We’ll structure the app as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install FastAPI and Uvicorn:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;pip install fastapi uvicorn&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the FastAPI App:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In the app.py file, we will create a POST endpoint /predict that accepts the input features of the house and returns the predicted price using our trained model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from fastapi import FastAPI
from pydantic import BaseModel
import joblib
import pandas as pd
import numpy as np
import logging

# Load the trained model
model_path = "models/random_forest_model.pkl"
model = joblib.load(model_path)

app = FastAPI()

# Define the input data model
class HouseFeatures(BaseModel):
    sqft: int
    bedrooms: int
    bathrooms: int
    parking: int
    mean_district_income: int

@app.post("/predict")
async def predict_house_price(data: HouseFeatures):
    try:
        input_data = data.dict()
        logging.info(f"🔍 Received input: {input_data}")

        input_df = pd.DataFrame([input_data])
        input_df = input_df.reindex(columns=expected_features, fill_value=0)

        logging.info(f"📊 Processed DataFrame for prediction:\n{input_df}")

        predicted_price = model.predict(input_df)[0]

        if predicted_price &amp;lt; 20:
            predicted_price = np.exp(predicted_price)

        logging.info(f"💰 Predicted price: {predicted_price}")

        return {"predicted_price": predicted_price}

    except Exception as e:
        logging.error(f"❌ Prediction error: {str(e)}")
        raise HTTPException(status_code=400, detail=f"Prediction error: {str(e)}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Setting Up Reverse Proxy with Nginx&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After your FastAPI app is working locally, you can set it up on a server. For production, we recommend using Nginx as a reverse proxy to route requests from port 80 or 8080 to FastAPI running on port 8000.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Nginx:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Nginx Configuration:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Edit the /etc/nginx/nginx.conf file or the server block configuration to forward the requests to FastAPI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 8080;
    server_name localhost;

    location / {
        proxy_pass http://127.0.0.1:8000;  # Forward requests to FastAPI server
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /predict {
        proxy_pass http://127.0.0.1:8000/predict;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    root /usr/share/nginx/html;
    index index.html;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Test and Reload Nginx:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Test the Nginx configuration and reload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nginx -t
sudo nginx -s reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Deploying to AWS EC2&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, let’s deploy the FastAPI app to AWS EC2 to make it accessible from anywhere. This involves several steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launch an EC2 Instance:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;• Use AWS EC2 to create an instance.&lt;/p&gt;

&lt;p&gt;• Choose an appropriate AMI, such as the latest Ubuntu.&lt;/p&gt;

&lt;p&gt;• Ensure the security group allows inbound traffic on ports 80 (HTTP), 443 (HTTPS), and 8000 (for FastAPI).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SSH into the EC2 Instance:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i "your-key.pem" ubuntu@&amp;lt;your-ec2-public-ip&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Transfer Files to EC2:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use scp to copy your project files to the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scp -i "your-key.pem" /path/to/app.py ubuntu@&amp;lt;your-ec2-public-ip&amp;gt;:/home/ubuntu/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install Dependencies on EC2:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Inside the EC2 instance, create a virtual environment and install FastAPI, Uvicorn, and other dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m venv fastapi_env
source fastapi_env/bin/activate
pip install fastapi uvicorn joblib pandas scikit-learn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run the Application:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Run the FastAPI app on the EC2 instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uvicorn app:app --host 0.0.0.0 --port 8000 --reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can test the /predict endpoint using curl or Postman, or through the Swagger UI provided by FastAPI.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Accessing the API&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once the app is running, you can access it via the public IP of the EC2 instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://3.135.188.21:8000/docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can test the /predict endpoint using curl or Postman, or through the Swagger UI provided by FastAPI.&lt;/p&gt;

&lt;p&gt;GitHub Repository&lt;/p&gt;

&lt;p&gt;You can access the source code for this project on my GitHub repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Touch-Moon/House_price_Toronto.git" rel="noopener noreferrer"&gt;GitHub – House Price Prediction&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building a House Price Prediction Model Using Random Forest in Python</title>
      <dc:creator>JinChul Moon</dc:creator>
      <pubDate>Sat, 22 Mar 2025 15:20:59 +0000</pubDate>
      <link>https://dev.to/creative_moon/building-a-house-price-prediction-model-using-random-forest-in-python-7di</link>
      <guid>https://dev.to/creative_moon/building-a-house-price-prediction-model-using-random-forest-in-python-7di</guid>
      <description>&lt;p&gt;Today, I want to share my experience of building a House Price Prediction Model using the Random Forest algorithm in Python. This was an exciting project that gave me hands-on experience with Machine Learning and data analysis. Here’s a quick breakdown of how I approached the project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data Collection and Preprocessing: I used a publicly available dataset of house prices. The dataset included various features like the number of rooms, location, and other house attributes. First, I cleaned and preprocessed the data by handling missing values and encoding categorical variables.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
data = pd.read_csv('house_prices.csv')
data.fillna(method='ffill', inplace=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Feature Selection: I then selected the most relevant features for the prediction. I used correlation matrices and domain knowledge to choose which columns would help the model make accurate predictions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Model Training: I used the Random Forest Regressor from the Scikit-learn library. This model works well for regression tasks and can handle non-linear relationships between features.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.ensemble import RandomForestRegressor
model = RandomForestRegressor(n_estimators=100, random_state=42)
model.fit(X_train, y_train)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Model Evaluation: After training the model, I evaluated its performance using metrics like Mean Squared Error (MSE) and R-squared to ensure the model was accurate enough for predictions.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.metrics import mean_squared_error, r2_score
y_pred = model.predict(X_test)
print(mean_squared_error(y_test, y_pred))
print(r2_score(y_test, y_pred))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Making Predictions: Once satisfied with the model’s performance, I used it to make predictions on new house data and see how well the model generalized to unseen data.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_data = pd.DataFrame({'rooms': [3], 'location': ['suburb'], 'size': [120]})
predicted_price = model.predict(new_data)
print(predicted_price)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was a very practical and engaging project that allowed me to apply machine learning concepts in a real-world scenario. The model was able to predict house prices with a good degree of accuracy, and I learned a lot about data preprocessing, model evaluation, and the power of Random Forest for regression tasks.&lt;/p&gt;

&lt;p&gt;For a more detailed breakdown, including all code snippets and the dataset used, check out the full post at the link below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://creative-moon.com/building-a-house-price-prediction-model-using-random-forest-in-python/" rel="noopener noreferrer"&gt;Building a House Price Prediction Model Using Random Forest in Python&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Setting Up a Machine Learning Development Environment on Mac</title>
      <dc:creator>JinChul Moon</dc:creator>
      <pubDate>Sat, 22 Mar 2025 05:08:43 +0000</pubDate>
      <link>https://dev.to/creative_moon/setting-up-a-machine-learning-development-environment-on-mac-2nal</link>
      <guid>https://dev.to/creative_moon/setting-up-a-machine-learning-development-environment-on-mac-2nal</guid>
      <description>&lt;p&gt;Getting into Machine Learning is an exciting journey, and setting up the right development environment is key to success. I’ve just finished setting up my ML environment on my Mac, and it’s been a rewarding experience. Here’s a quick overview of what I did to get started:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Installing Python &amp;amp; Necessary Libraries: I began by installing Python and setting up essential libraries like NumPy, Pandas, Matplotlib, and Scikit-learn for data analysis and visualization.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install python
pip install numpy pandas matplotlib scikit-learn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Setting Up Jupyter Notebooks: Jupyter Notebooks is a great tool for experimenting with ML models and data. I installed it and configured it for an easy-to-use interface.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install jupyter
jupyter notebook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Creating Virtual Environments: To keep everything organized, I set up virtual environments to isolate dependencies for different projects.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python -m venv myenv
source myenv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Installing TensorFlow &amp;amp; PyTorch: As I dive deeper into Deep Learning, setting up TensorFlow and PyTorch was crucial to work with neural networks and deep learning models.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install tensorflow
pip install torch torchvision
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I’m now ready to begin exploring ML concepts, building models, and applying these tools to real-world data. This setup is the foundation for all the ML experiments I’m excited to try!&lt;/p&gt;

&lt;p&gt;If you’re looking to set up a similar environment, I’ve detailed the entire process. You can read the full guide here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://creative-moon.com/setting-up-a-machine-learning-development-environment-on-mac/" rel="noopener noreferrer"&gt;Read the full post on setting up a Machine Learning environment on Mac&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
