1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

説明変数、目的関数の作り方

Posted at

#目的関数の書き方
dfが

  • PassengerID (乗客のID)
  • Survived (trainデータだけ)
  • Pclass (部屋のクラス)
  • Name
  • Sex
  • Age
  • SibSp
  • Parch
  • Ticket
  • Fare
  • Cabin (客室を持っていたか)
  • Embarked (どこの港で乗ったか)

このような項目を持っていた時に
##説明変数は

x=df[["項目名1","項目名2","項目名3","項目名4"]]

というように、自分選びたい項目を[["項目"]]のように追加します。

##目的関数
目的関数は一つしか項目がないので、

t=df["目的関数の項目"]

###終わり
こんなかんじで、このあとモデルに学習させたりします。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?