Пример #1
0
    def models(self):
        """
        Access to create or load the various models available in sparktk  (See the <a href="models/index.html">Models API</a>)

        Examples
        --------

        Train an SVM model:

            <skip>
            >>> svm_model = tc.models.classification.svm.train(frame, 'label', ['data'])

        Train a Random Forest regression model:

            >>> rf = tc.models.regression.random_forest_regressor.train(frame,
            ...                                                         'Class',
            ...                                                         ['Dim_1', 'Dim_2'],
            ...                                                         num_trees=1,
            ...                                                         impurity="variance",
            ...                                                         max_depth=4,
            ...                                                         max_bins=100)

        Train a KMeans clustering model:

            >>> km = tc.models.clustering.kmeans.train(frame, ["data"], k=3)

            </skip>

        """
        return get_lazy_loader(self, "models", implicit_kwargs={'tc': self})
Пример #2
0
    def models(self):
        """
        Access to create or load the various models available in sparktk  (See the <a href="models/index.html">Models API</a>)

        Examples
        --------

        Train an SVM model:

            <skip>
            >>> svm_model = tc.models.classification.svm.train(frame, 'label', ['data'])

        Train a Random Forest regression model:

            >>> rf = tc.models.regression.random_forest_regressor.train(frame,
            ...                                                         'Class',
            ...                                                         ['Dim_1', 'Dim_2'],
            ...                                                         num_trees=1,
            ...                                                         impurity="variance",
            ...                                                         max_depth=4,
            ...                                                         max_bins=100)

        Train a KMeans clustering model:

            >>> km = tc.models.clustering.kmeans.train(frame, ["data"], k=3)

            </skip>

        """
        return get_lazy_loader(self, "models", implicit_kwargs={'tc': self})
Пример #3
0
    def frame(self):
        """
        Access to create or load the sparktk Frames  (See the <a href="frame.m.html">Frame API</a>)

        Example
        -------

            >>> frame = tc.frame.create([[1, 3.14, 'blue'], [7, 1.61, 'red'], [4, 2.72, 'yellow']])

            >>> frame.inspect()
            [#] C0  C1    C2
            =====================
            [0]  1  3.14  blue
            [1]  7  1.61  red
            [2]  4  2.72  yellow


            >>> frame2 = tc.frame.import_csv("../datasets/basic.csv")

            >>> frame2.inspect(5)
            [#]  C0   C1     C2  C3
            ================================
            [0]  132  75.4    0  correction
            [1]  133  77.66   0  fitness
            [2]  134  71.22   1  proposal
            [3]  201   72.3   1  utilization
            [4]  202   80.1   0  commission


        """
        return get_lazy_loader(self, "frame", implicit_kwargs={
            'tc': self
        }).frame  # .frame to account for extra 'frame' in name vis-a-vis scala
Пример #4
0
    def frame(self):
        """
        Access to create or load the sparktk Frames  (See the <a href="frame.m.html">Frame API</a>)

        Example
        -------

            >>> frame = tc.frame.create([[1, 3.14, 'blue'], [7, 1.61, 'red'], [4, 2.72, 'yellow']])

            >>> frame.inspect()
            [#] C0  C1    C2
            =====================
            [0]  1  3.14  blue
            [1]  7  1.61  red
            [2]  4  2.72  yellow


            >>> frame2 = tc.frame.import_csv("../datasets/basic.csv")

            >>> frame2.inspect(5)
            [#]  C0   C1     C2  C3
            ================================
            [0]  132  75.4    0  correction
            [1]  133  77.66   0  fitness
            [2]  134  71.22   1  proposal
            [3]  201   72.3   1  utilization
            [4]  202   80.1   0  commission


        """
        return get_lazy_loader(self, "frame", implicit_kwargs={'tc': self}).frame  # .frame to account for extra 'frame' in name vis-a-vis scala
Пример #5
0
    def dicom(self):
        """
        Access to create or load the sparktk Dicom objects  (See the <a href="dicom.m.html">Dicom API</a>)

        Example
        -------

            <skip>
            >>> d = tc.dicom.import_dcm('path/to/dicom/images/')

            >>> type(d)
            sparktk.dicom.dicom.Dicom
            </skip>

        """
        return get_lazy_loader(self, "dicom", implicit_kwargs={'tc': self}).dicom  # .dicom to account for extra 'dicom' in name vis-a-vis scala
Пример #6
0
    def graph(self):
        """
        Access to create or load the sparktk Graphs (See the <a href="graph.m.html">Graph API</a>)

        Example
        -------

            <hide>
            >>> g = tc.examples.graphs.get_movie_graph()
            >>> g.save('sandbox/my_saved_graph')
            </hide>

            >>> g = tc.graph.load('sandbox/my_saved_graph')

        """
        return get_lazy_loader(self, "graph", implicit_kwargs={'tc': self}).graph  # .graph to account for extra 'graph' in name vis-a-vis scala
Пример #7
0
    def dicom(self):
        """
        Access to create or load the sparktk Dicom objects  (See the <a href="dicom.m.html">Dicom API</a>)

        Example
        -------

            <skip>
            >>> d = tc.dicom.import_dcm('path/to/dicom/images/')

            >>> type(d)
            sparktk.dicom.dicom.Dicom
            </skip>

        """
        return get_lazy_loader(self, "dicom", implicit_kwargs={
            'tc': self
        }).dicom  # .dicom to account for extra 'dicom' in name vis-a-vis scala
Пример #8
0
    def graph(self):
        """
        Access to create or load the sparktk Graphs (See the <a href="graph.m.html">Graph API</a>)

        Example
        -------

            <hide>
            >>> g = tc.examples.graphs.get_movie_graph()
            >>> g.save('sandbox/my_saved_graph')
            </hide>

            >>> g = tc.graph.load('sandbox/my_saved_graph')

        """
        return get_lazy_loader(self, "graph", implicit_kwargs={
            'tc': self
        }).graph  # .graph to account for extra 'graph' in name vis-a-vis scala
Пример #9
0
    def examples(self):
        """
        Access to some example data structures

        Example
        -------

        Get a small, built-in sparktk Frame object:

            >>> cities = tc.examples.frames.get_cities_frame()

            >>> cities.inspect(5)
            [#]  rank  city       population_2013  population_2010  change  county
            ==========================================================================
            [0]  1     Portland   609456           583776           4.40%   Multnomah
            [1]  2     Salem      160614           154637           3.87%   Marion
            [2]  3     Eugene     159190           156185           1.92%   Lane
            [3]  4     Gresham    109397           105594           3.60%   Multnomah
            [4]  5     Hillsboro  97368            91611            6.28%   Washington

        """
        return get_lazy_loader(self, "examples", implicit_kwargs={'tc': self})
Пример #10
0
    def examples(self):
        """
        Access to some example data structures

        Example
        -------

        Get a small, built-in sparktk Frame object:

            >>> cities = tc.examples.frames.get_cities_frame()

            >>> cities.inspect(5)
            [#]  rank  city       population_2013  population_2010  change  county
            ==========================================================================
            [0]  1     Portland   609456           583776           4.40%   Multnomah
            [1]  2     Salem      160614           154637           3.87%   Marion
            [2]  3     Eugene     159190           156185           1.92%   Lane
            [3]  4     Gresham    109397           105594           3.60%   Multnomah
            [4]  5     Hillsboro  97368            91611            6.28%   Washington

        """
        return get_lazy_loader(self, "examples", implicit_kwargs={'tc': self})
Пример #11
0
 def examples(self):
     return get_lazy_loader(self, "examples", implicit_kwargs={'tc': self})
Пример #12
0
 def graph(self):
     return get_lazy_loader(self, "graph", implicit_kwargs={
         'tc': self
     }).graph  # .graph to account for extra 'graph' in name vis-a-vis scala
Пример #13
0
 def graph(self):
     return get_lazy_loader(self, "graph", implicit_kwargs={'tc': self}).graph  # .graph to account for extra 'graph' in name vis-a-vis scala
Пример #14
0
 def examples(self):
     return get_lazy_loader(self, "examples", implicit_kwargs={'tc': self})
Пример #15
0
 def dicom(self):
     return get_lazy_loader(self, "dicom", implicit_kwargs={'tc': self}).dicom  # .dicom to account for extra 'dicom' in name vis-a-vis scala
Пример #16
0
 def models(self):
     """access to the various models of sparktk"""
     return get_lazy_loader(self, "models", implicit_kwargs={'tc': self})
Пример #17
0
 def frame(self):
     return get_lazy_loader(self, "frame", implicit_kwargs={'tc': self}).frame  # .frame to account for extra 'frame' in name vis-a-vis scala
Пример #18
0
 def dicom(self):
     return get_lazy_loader(self, "dicom", implicit_kwargs={
         'tc': self
     }).dicom  # .dicom to account for extra 'dicom' in name vis-a-vis scala