Python script for time series forecasting with Random Forest
Technical assignment (TA) for the development of a program for forecasting electricity consumption time series
Project goal:
Develop a program for forecasting electricity consumption based on time series using the Random Forest method. The program should accept historical electricity consumption data, train the model, save the model and scaler, and use the trained model to forecast future consumption and save the results in a file.
Input data:
CSV file with historical data containing the following columns:
year: Year of observation.
month: Month of observation.
day: Day of observation.
hour: Hour of observation.
weekday: Day of the week.
temp: Air temperature (°C).
function: Electricity consumption (MW/h).
Target variable:
The target variable is electricity consumption (column function).
Main stages of the program:
- Data loading:
- Import data from CSV files.
- Split data into features and target variable (electricity consumption).
- Data scaling:
- Use a scaler (e.g., StandardScaler) to bring data to a common scale (normalization or standardization).
- Creating time windows:
- Form feature sets and target values for each time window (e.g., 24 hours).
- Features: year, month, day, hour, weekday, temp.
- Target variable: function (electricity consumption).
- Model training:
- Use the RandomForestRegressor model to train on time series data.
- Split data into training and testing sets for model evaluation.
- Evaluate the model using RMSE or other suitable metrics.
- Saving the model and scaler:
- Save the trained model and scaler to files for future use.
- Using time windows for forecasting:
- Use the model to forecast future values based on new data.
- Saving forecasting results:
- Forecasted values should be saved in a CSV file for further analysis.
- Technical requirements:
- Programming
language: Python 3.x. - Libraries used:
- pandas
- scikit-learn
- numpy
- Success criteria:
- The program correctly trains the model on historical data and saves it to a file.
- The program uses the trained model for forecasting on new data and
saves the results. - The program logs all key processes (training, forecasting,
errors). - The program structure and code are well documented, with instructions for running and
using the program. - The program should provide forecasts with a total deviation of no more than 5%. This means that
the average error between actual data (in the test set) and the forecast
should not exceed 5% of the actual values.
Additionally, there is ready-made code with a result error above 17%. It may be useful to you.
Applications 3
-
Hello, I reviewed your assignment (it looks more like a university project), I have experience using these libraries (I also know R) and I have a good algorithmic knowledge base in machine learning algorithms. I can complete your task. For any additional questions, please send me a private message. I would be happy to collaborate.
-
434 9 0 Good evening. I have some experience in this area. If it will be useful, feel free to reach out. The link contains the prediction results for your file predict_data.csv
Google Drive the error is within +-6%.
-
4270 93 1 3 Hello
I am a Python developer
I have completed many similar projects
I am ready to take on the work and complete it in the shortest time in the best possible way
I perform the work efficiently and on time
You can read the reviews
-
8796 60 0 1 Good afternoon!
I am ready to implement a program for forecasting electricity consumption based on time series using the Random Forest method.
I write in Python. I hold 2nd place on the platform for this language.
Portfolio:Freelancehunt
I would be happy to collaborate!
-
3020 73 4 2 Good day! I have experience = I can do it!!!!!!!!!! Contact me!!!!!
-
UI нужен или можно конослью? Можете скинуть имеющийся код в личку?
-
У ГПТ про таке питали? Він цікаво такі завдання вирішує, та скрипт теж правити проходиться)
-
Для себе робив прогнози цін крипто бирж, по цій моделі також.
-
Current freelance projects in the category AI & Machine Learning
n8n specialist for automation setup + training (coaching format)I'm looking for an experienced specialist in n8n and AI (LLM API) to set up recruitment automation. Main condition: work in the format of coaching/mentoring. I need not a "black box", but training: we will have calls, you explain the logic — I set everything up myself under your… AI & Machine Learning, Web Programming ∙ 28 minutes back ∙ 2 proposals |
AI advertising automation - FACEBOOK ADS
150 USD
Hello everyone! We are looking for specialists who have effectively automated the management / launch and analytics of Facebook advertising through AI Claude / GPT / GEMINI. We need to quickly set up automation / launch / exports / analytics. Please share your… AI & Machine Learning, Enterprise Resource Planning (ERP) ∙ 23 hours 16 minutes back ∙ 18 proposals |
Create an offline II that analyzes engineering informationCreate an offline AI that analyzes engineering documentation in text format, PDF files, and spreadsheet formats. The assistant should be able to extract key requirements, identify errors, compare document versions, and assist the engineer in project work. AI & Machine Learning ∙ 2 days 6 hours back ∙ 13 proposals |
Generation and segmentation of the database of drivers and transportation companies in the USA
173 USD
Project Description We are an American company in the HR / transportation recruitment sector. We need a specialist who can use artificial intelligence and available data tools to collect, enrich, and segment a database for our team's further work. What Needs to Be Done A system… AI & Machine Learning ∙ 4 days 2 hours back ∙ 18 proposals |
Technical consultant for hardware optimization and memory stability audit
1200 USD
Hello everyone! I am looking for a hardware specialist or systems engineer who can help me understand the unstable performance of my local server. I built it for work tasks, but it seems my amateur knowledge is not enough to get the most out of it. I would rather pay for an hour… AI & Machine Learning ∙ 4 days 11 hours back ∙ 9 proposals |
