How to use the yellowbrick.datasets.load_concrete function in yellowbrick

To help you get started, we’ve selected a few yellowbrick examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DistrictDataLabs / yellowbrick / tests / test_model_selection / test_importances.py View on Github external
def test_integration_coef(self):
        """
        Integration test of visualizer with coef param
        """

        # Load the test dataset
        dataset = load_concrete(return_dataset=True)
        X, y = dataset.to_numpy()
        features = dataset.meta["features"]

        fig = plt.figure()
        ax = fig.add_subplot()

        reg = Lasso(random_state=42)
        features = list(map(lambda s: s.title(), features))
        viz = FeatureImportances(reg, ax=ax, labels=features, relative=False)
        viz.fit(X, y)
        viz.finalize()

        # Appveyor and Linux conda non-text-based differences
        self.assert_images_similar(viz, tol=16.2)
github DistrictDataLabs / yellowbrick / tests / test_regressor / test_influence.py View on Github external
def test_numpy_integration(self):
        """
        Test on concrete dataset with numpy arrays
        """
        data = load_concrete(return_dataset=True)
        X, y = data.to_numpy()

        assert isinstance(X, np.ndarray)
        assert isinstance(y, np.ndarray)

        _, ax = plt.subplots()
        viz = CooksDistance(ax=ax).fit(X, y)
        assert_fitted(viz)

        assert viz.distance_.sum() == pytest.approx(1.2911900571300652)
        assert viz.p_values_.sum() == pytest.approx(1029.9999525376425)
        assert viz.influence_threshold_ == pytest.approx(0.003883495145631068)
        assert viz.outlier_percentage_ == pytest.approx(7.3786407766990285)

        viz.finalize()
        self.assert_images_similar(viz)
github DistrictDataLabs / yellowbrick / docs / gallery.py View on Github external
def peplot():
    X, y = load_concrete()
    X_train, X_test, y_train, y_test = tts(X, y, test_size=0.2)
    oz = PredictionError(Lasso(), ax=newfig())
    oz.fit(X_train, y_train)
    oz.score(X_test, y_test)
    savefig(oz, "prediction_error")
github DistrictDataLabs / yellowbrick / docs / api / features / manifold.py View on Github external
algorithm, dataset, e
                    )
                )
                continue

        # Break here!
        return

    # Create single example
    _, ax = plt.subplots(figsize=(9, 6))
    oz = Manifold(ax=ax, manifold=manifold, **kwargs)

    if dataset == "occupancy":
        X, y = load_occupancy()
    elif dataset == "concrete":
        X, y = load_concrete()
    else:
        raise Exception("unknown dataset '{}'".format(dataset))

    oz.fit(X, y)
    oz.show(outpath=path)
github DistrictDataLabs / yellowbrick / docs / gallery.py View on Github external
def binning():
    _, y = load_concrete()
    oz = BalancedBinningReference(ax=newfig())
    oz.fit(y)
    savefig(oz, "balanced_binning_reference")
github DistrictDataLabs / yellowbrick / docs / images / readme / readme_imgs.py View on Github external
def alpha_selection(ax=None):
    data = load_concrete(return_dataset=True)
    X, y = data.to_pandas()

    alphas = np.logspace(-10, 1, 400)
    viz = AlphaSelection(LassoCV(alphas=alphas), ax=ax)
    return tts_plot(viz, X, y)
github DistrictDataLabs / yellowbrick / docs / gallery.py View on Github external
def manifold(dataset, manifold):
    if dataset == "concrete":
        X, y = load_concrete()
    elif dataset == "occupancy":
        X, y = load_occupancy()
    else:
        raise ValueError("unknown dataset")

    oz = Manifold(manifold=manifold, ax=newfig())
    oz.fit_transform(X, y)
    savefig(oz, "{}_{}_manifold".format(dataset, manifold))
github DistrictDataLabs / yellowbrick / docs / images / readme / readme_imgs.py View on Github external
def residuals_plot(ax=None):
    data = load_concrete(return_dataset=True)
    X, y = data.to_pandas()

    viz = ResidualsPlot(Ridge(), ax=ax)
    return tts_plot(viz, X, y)