php教程--案例28(体验类与对象)

<?php
//case 28 体验类与对象
//声明类
class student1
{
    public $name;
    public $student_id;
    public $age;
    public $gender;

    public function introduce()
    {
        echo "大家好,我是{$this->name},今年{$this->age}岁。<br>我的学号是{$this->student_id},很高兴认识大家。<br>";

    }

    public function study($time)
    {
        $time = date("Y-m-d H:i:s",$time);
        echo "当前时间为{$time},学习中,请勿打扰......<br>";
    }
}

//实例化
$stu = new student1();
$stu->name = '小明';
$stu->student_id = '20200111178';
$stu->age = 18;
$stu->gender = '男性';

$stu2 = new student1();
$stu2->name = '小红';
$stu2->student_id = '20200111179';
$stu2->age = 19;
$stu2->gender = '女性';

echo '<pre>';
var_dump($stu,$stu2);
echo '</pre>';

$stu->introduce();
$stu->study(time());

$stu2->introduce();
$stu2->study(time());

 

AI实战-加拿大的工业产品价格指数数据集分析预测实例(含4个源代码+18.20 MB完整的数据集) 代码手工整理,无语法错误,可运行。 包括:4个代码,共38.64 KB;数据大小:1个文件共18.20 MB。 使用到的模块: numpy pandas os sklearn.model_selection.train_test_split tensorflow.keras.models.Sequential tensorflow.keras.layers.Dense sklearn.impute.KNNImputer sklearn.impute.IterativeImputer sklearn.linear_model.LinearRegression matplotlib.pyplot sklearn.datasets.make_blobs sklearn.cluster.DBSCAN sklearn.neighbors.LocalOutlierFactor sklearn.ensemble.IsolationForest sklearn.svm.OneClassSVM sklearn.preprocessing.MinMaxScaler sklearn.preprocessing.StandardScaler sklearn.preprocessing.MaxAbsScaler sklearn.preprocessing.RobustScaler sklearn.preprocessing.PowerTransformer sklearn.preprocessing.QuantileTransformer sklearn.preprocessing.OneHotEncoder sklearn.preprocessing.LabelEncoder category_encoders seaborn sklearn.cluster.KMeans sklearn.metrics.silhouette_score sklearn.decomposition.PCA sklearn.datasets.load_iris scipy.cluster.hierarchy.linkage scipy.cluster.hierarchy.dendrogram sklearn.cluster.AgglomerativeClustering sklearn.mixture.GaussianMixture matplotlib warnings sklearn.metrics.mean_squared_error sklearn.metrics.r2_score plotly.express sklearn.ensemble.RandomForestRegressor sklearn.ensemble.GradientBoostingRegressor catboost.CatBoostRegressor sklearn.metrics.mean_absolute_error sklearn.model_selection.RandomizedSearchCV statsmodels.tsa.arima.model.ARIMA
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

虾米大王

有你的支持,我会更有动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值