Spaces:
Sleeping
Sleeping
File size: 1,309 Bytes
ed82320 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import pandas as pd
import numpy as np
def generate_business_data():
np.random.seed(0)
n_samples = 100
usage_patterns = np.random.rand(n_samples) * 100
demographics = np.random.randint(0, 2, n_samples)
churn = (
10 + 5 * usage_patterns - 2 * demographics + np.random.randn(n_samples) * 5
)
df = pd.DataFrame({"Usage": usage_patterns, "Demographics": demographics, "Churn": churn})
df.to_csv("business_data.csv", index=False)
def generate_engineering_data():
np.random.seed(1)
n_samples = 100
sensor_data = np.random.rand(n_samples) * 50
rul = 100 - 2 * sensor_data + np.random.randn(n_samples) * 10
df = pd.DataFrame({"Sensor_Data": sensor_data, "RUL": rul})
df.to_csv("engineering_data.csv", index=False)
def generate_education_data():
np.random.seed(2)
n_samples = 100
study_hours = np.random.rand(n_samples) * 50
prev_grades = np.random.rand(n_samples) * 4
test_scores = 20 + 5 * study_hours + 10 * prev_grades + np.random.randn(n_samples) * 5
df = pd.DataFrame({"Study_Hours": study_hours, "Prev_Grades": prev_grades, "Test_Scores": test_scores})
df.to_csv("education_data.csv", index=False)
if __name__ == "__main__":
generate_business_data()
generate_engineering_data()
generate_education_data() |