"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Badge } from "@/components/ui/badge"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { Switch } from "@/components/ui/switch"; import { Progress } from "@/components/ui/progress"; import { BrainCircuit, Clock, Database, Play, Plus, Settings, Sliders, Trash2, AlertTriangle, Check, ArrowRight, Info, } from "lucide-react"; import Link from "next/link"; import PageHeader from "@/components/page-header"; export default function ModelsPage() { const [activeTab, setActiveTab] = useState("my-models"); const [selectedPipeline, setSelectedPipeline] = useState(null); const [trainingProgress, setTrainingProgress] = useState(0); const [isTraining, setIsTraining] = useState(false); const [modelName, setModelName] = useState(""); const [modelDescription, setModelDescription] = useState(""); const dataPipelines = [ { id: "pipeline-1", name: "Property Listings", records: 1240, lastUpdated: "2 hours ago" }, { id: "pipeline-2", name: "Rental Market Data", records: 830, lastUpdated: "Yesterday" }, { id: "pipeline-3", name: "Price Comparison", records: 1560, lastUpdated: "2 days ago" }, { id: "pipeline-4", name: "Commercial Properties", records: 450, lastUpdated: "1 week ago" }, ]; const models = [ { id: "model-1", name: "Standard ML Model v2.4", type: "Regression", hyperparameters: { learningRate: "0.01", maxDepth: "6", numEstimators: "100", }, dataSource: "System Base Model", status: "active", lastUpdated: "3 days ago", isSystem: true, }, { id: "model-2", name: "Enhanced Neural Network v1.8", type: "Neural Network", hyperparameters: { layers: "4", neurons: "128,64,32,16", dropout: "0.2", }, dataSource: "System Base Model", status: "active", lastUpdated: "1 week ago", isSystem: true, }, { id: "model-3", name: "Geospatial Regression v3.1", type: "Geospatial", hyperparameters: { spatialWeight: "0.7", kernelType: "gaussian", bandwidth: "adaptive", }, dataSource: "System Base Model", status: "active", lastUpdated: "2 weeks ago", isSystem: true, }, { id: "model-4", name: "Time Series Forecast v2.0", type: "Time Series", hyperparameters: { p: "2", d: "1", q: "2", seasonal: "true", }, dataSource: "System Base Model", status: "active", lastUpdated: "1 month ago", isSystem: true, }, { id: "model-5", name: "Custom Model (User #1242)", type: "Ensemble", hyperparameters: { baseEstimators: "3", votingMethod: "weighted", weights: "0.4,0.4,0.2", }, dataSource: "Property Listings Pipeline", status: "active", lastUpdated: "5 days ago", isSystem: false, }, ]; const handleStartTraining = () => { if (!selectedPipeline || !modelName) return; setIsTraining(true); setTrainingProgress(0); // Simulate training progress const interval = setInterval(() => { setTrainingProgress((prev) => { if (prev >= 100) { clearInterval(interval); setIsTraining(false); return 100; } return prev + 5; }); }, 500); }; return (
My Models System Models Train New Model {activeTab !== "train-model" && ( )}
{models .filter((model) => !model.isSystem) .map((model) => ( ))}
{models.filter((model) => !model.isSystem).length === 0 && (

No Custom Models Yet

Train your first custom model to get started with personalized property predictions.

)}
{models .filter((model) => model.isSystem) .map((model) => ( ))}
Training Configuration Configure your new model
setModelName(e.target.value)} />