0Pricing
Data Science Academy · レッスン

決定木回帰

データを非線形に分割する

「決定木回帰」はCoddyKit上の無料Data Science Academyレッスンです。 これはレッスン3/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはData Science Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Data Science Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Beyond Straight Lines

A decision tree predicts numbers by asking yes-or-no questions about your features, splitting the data step by step. No straight line required. 🌳

Splits Are the Questions

Each branch is a split, like is size above 80? The tree keeps asking, narrowing rows into smaller and smaller groups.

Leaves Hold the Answer

At the bottom sit the leaves. Each leaf predicts one number: the average target of all training rows that landed there.

Choosing the Best Split

The tree tries many split points and keeps the one that most reduces prediction error in the resulting groups. Greedy, one step at a time.

Train One in Two Lines

The familiar fit-predict contract holds. Create a DecisionTreeRegressor, fit it, and predict just like any other estimator.

from sklearn.tree import DecisionTreeRegressor
model = DecisionTreeRegressor().fit(X, y)

Predictions Look Like Steps

Because each leaf gives one flat value, a tree's predictions form a staircase, not a smooth curve. That is fine for many real patterns.

Trees Catch Non-Linear Shapes

Splits can bend any direction, so a tree captures non-linear relationships that a line would completely miss. That is its real strength.

Deep Trees Overfit

Left unchecked, a tree grows until each leaf holds one row, memorizing noise. That deep tree overfits and fails on new data.

Limit the Depth

Control growth with max_depth. A shallower tree stays general and is far easier to read and trust.

DecisionTreeRegressor(max_depth=4)

More Pruning Knobs

You can also set min_samples_leaf so leaves keep enough rows. This stops the tree from carving out tiny, noisy groups.

DecisionTreeRegressor(min_samples_leaf=10)

No Scaling Needed

Trees split on thresholds, so feature units do not matter. You can skip scaling, a nice contrast to Ridge and Lasso.

Quick Check

Think about how a tree turns rows into a prediction.

Recap

A decision tree splits data with questions, predicts a leaf average, and bends to non-linear shapes. Cap its depth so it generalizes. 🎯

よくある質問

「決定木回帰」レッスンは無料ですか?

はい。「決定木回帰」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Data Science Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Data Science Academyコースには全4レッスンが含まれています。

「決定木回帰」で何を学びますか?

データを非線形に分割する ブラウザで直接実行するハンズオンコードでData Science Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Data Science Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのData Science Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン3/4です。

「決定木回帰」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このData Science Academyレッスンでコードを書いて実行できますか?

はい。すべてのData Science Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. 線形回帰を再確認する
  2. RidgeとLassoの正則化
  3. 決定木回帰
  4. 回帰に使うランダムフォレスト
← Data Science Academyに戻る