def fit(self, X, y=None, input_type='<STR_LIT:data>'):
X = self._validate_input(X, input_type)<EOL>self.fit_geometry(X, input_type)<EOL>if not hasattr(self, '<STR_LIT>'):<EOL><INDENT>self.distance_matrix = None<EOL><DEDENT>if not hasattr(self, '<STR_LIT>'):<EOL><INDENT>self.graph_distance_matrix = None<EOL><DEDENT>if not hasattr(self, '<STR_LIT>'):<EOL><INDENT>self.centered_matrix = None<EOL><DEDENT>if (self.distance_matrix is None and self.geom_.adjacency_matrix is None):<EOL><INDENT>self.distance_matrix = self.geom_.compute_adjacency_matrix()<EOL><DEDENT>elif self.distance_matrix is None:<EOL><INDENT>self.distance_matrix = self.geom_.adjacency_matrix<EOL><DEDENT>if self.graph_distance_matrix is None:<EOL><INDENT>self.graph_distance_matrix = graph_shortest_path(self.distance_matrix,<EOL>method = self.path_method,<EOL>directed = False)<EOL><DEDENT>if self.centered_matrix is None:<EOL><INDENT>self.centered_matrix = center_matrix(self.graph_distance_matrix)<EOL><DEDENT>self.embedding_ = isomap(self.geom_, n_components=self.n_components,<EOL>eigen_solver=self.eigen_solver,<EOL>random_state=self.random_state,<EOL>path_method = self.path_method,<EOL>distance_matrix = self.distance_matrix,<EOL>graph_distance_matrix = self.graph_distance_matrix,<EOL>centered_matrix = self.centered_matrix,<EOL>solver_kwds = self.solver_kwds)<EOL>return self<EOL>
Fit the model from data in X.

        Parameters
        ----------
        input_type : string, one of: 'data', 'distance'.
            The values of input data X. (default = 'data')

        X : array-like, shape (n_samples, n_features)
            Training vector, where n_samples in the number of samples
            and n_features is the number of features.

        If self.input_type is 'distance':

        X : array-like, shape (n_samples, n_samples),
            Interpret X as precomputed distance or adjacency graph
            computed from samples.

        eigen_solver : {None, 'arpack', 'lobpcg', or 'amg'}
            The eigenvalue decomposition strategy to use. AMG requires pyamg
            to be installed. It can be faster on very large, sparse problems,
            but may also lead to instabilities.

        Returns
        -------
        self : object
            Returns the instance itself.